给单据等其它模块优化接口

This commit is contained in:
jishenghua
2025-02-24 00:49:03 +08:00
parent e589d5f9cd
commit 1122598771
63 changed files with 540 additions and 2197 deletions

View File

@@ -69,68 +69,6 @@
</if>
and ifnull(ah.delete_flag,'0') !='1'
order by ah.id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
</select>
<select id="countsByAccountHead" resultType="java.lang.Long">
SELECT
COUNT(1) from
(select distinct ah.* FROM jsh_account_head ah
left join jsh_account_item ai on ah.id=ai.header_id and ifnull(ai.delete_flag,'0') !='1'
left join jsh_depot_head dh on dh.id=ai.bill_id and ifnull(dh.delete_flag,'0') !='1'
WHERE 1=1
<if test="billNo != null">
<bind name="bindBillNo" value="'%'+billNo+'%'"/>
and ah.bill_no like #{bindBillNo}
</if>
<if test="type != null">
and ah.type=#{type}
</if>
<if test="beginTime != null">
and ah.bill_time &gt;= #{beginTime}
</if>
<if test="endTime != null">
and ah.bill_time &lt;= #{endTime}
</if>
<if test="organId != null">
and ah.organ_id=#{organId}
</if>
<if test="handsPersonId != null">
and ah.hands_person_id=#{handsPersonId}
</if>
<if test="creator != null">
and ah.creator=#{creator}
</if>
<if test="creatorArray != null">
and ah.creator in (
<foreach collection="creatorArray" item="creator" separator=",">
#{creator}
</foreach>
)
</if>
<if test="accountId != null">
and ah.account_id=#{accountId}
</if>
<if test="status != null and status != ''">
and ah.status=#{status}
</if>
<if test="remark != null and remark !=''">
<bind name="bindRemark" value="'%'+remark+'%'"/>
and ah.remark like #{bindRemark}
</if>
<if test="number != null and number !=''">
<if test="number == 'QiChu'">
and ai.bill_id is null
</if>
<if test="number != 'QiChu'">
<bind name="bindNumber" value="'%'+number+'%'"/>
and dh.number like #{bindNumber}
</if>
</if>
and ifnull(ah.delete_flag,'0') !='1') tb
</select>
<select id="getDetailByNumber" parameterType="com.jsh.erp.datasource.entities.AccountHeadExample" resultMap="ResultMapEx">

View File

@@ -159,10 +159,7 @@
</if>
and ifnull(dh.delete_flag,'0') !='1'
group by dh.id
order by dh.id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>) tb
order by dh.id desc) tb
left join jsh_depot_head jdh on jdh.id=tb.id and ifnull(jdh.delete_flag,'0') !='1'
left join jsh_supplier s on jdh.organ_id=s.id and ifnull(s.delete_flag,'0') !='1'
left join jsh_user u on jdh.creator=u.id
@@ -170,105 +167,6 @@
order by jdh.id desc
</select>
<select id="countsByDepotHead" resultType="java.lang.Long">
select
count(1) from
(select distinct dh.id from jsh_depot_head dh
left join jsh_depot_item di on dh.Id = di.header_id and ifnull(di.delete_flag,'0') !='1'
left join jsh_material m on di.material_id = m.Id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_material_extend me on di.material_extend_id = me.id and ifnull(me.delete_flag,'0') !='1'
WHERE 1=1
<if test="type != null">
and dh.type=#{type}
</if>
<if test="subType != null">
and dh.sub_type=#{subType}
</if>
<if test="statusArray != null and statusArray !=''">
and dh.status in (
<foreach collection="statusArray" item="status" separator=",">
#{status}
</foreach>
)
</if>
<if test="purchaseStatusArray != null and purchaseStatusArray !=''">
and dh.purchase_status in (
<foreach collection="purchaseStatusArray" item="purchaseStatus" separator=",">
#{purchaseStatus}
</foreach>
)
</if>
<if test="number != null">
<bind name="bindNumber" value="'%'+number+'%'"/>
and dh.number like #{bindNumber}
</if>
<if test="linkApply != null">
<bind name="bindLinkApply" value="'%'+linkApply+'%'"/>
and dh.link_apply like #{bindLinkApply}
</if>
<if test="linkNumber != null">
<bind name="bindLinkNumber" value="'%'+linkNumber+'%'"/>
and dh.link_number like #{bindLinkNumber}
</if>
<if test="beginTime != null">
and dh.oper_time >= #{beginTime}
</if>
<if test="endTime != null">
and dh.oper_time &lt;= #{endTime}
</if>
<if test="materialParam != null and materialParam !=''">
<bind name="bindKey" value="'%'+materialParam+'%'"/>
and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.mnemonic like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey}
or m.color like #{bindKey} or m.mfrs like #{bindKey} or m.brand like #{bindKey} or m.other_field1 like #{bindKey}
or m.other_field2 like #{bindKey} or m.other_field3 like #{bindKey})
</if>
<if test="organId != null">
and dh.organ_id=#{organId}
</if>
<if test="organArray != null and organArray !=''">
and dh.organ_id in (
<foreach collection="organArray" item="organId" separator=",">
#{organId}
</foreach>
)
</if>
<if test="creator != null">
and dh.creator=#{creator}
</if>
<if test="depotId != null">
and di.depot_id=#{depotId}
</if>
<if test="depotArray != null and depotArray !=''">
and di.depot_id in (
<foreach collection="depotArray" item="depotId" separator=",">
#{depotId}
</foreach>
)
</if>
<if test="creatorArray != null">
and dh.creator in (
<foreach collection="creatorArray" item="creator" separator=",">
#{creator}
</foreach>
)
</if>
<if test="accountId != null">
<bind name="bindAccountId" value="'%'+accountId+'%'"/>
and (dh.account_id=#{accountId} or dh.account_id_list like #{bindAccountId})
</if>
<if test="hasDebt != null and hasDebt ==1">
and (ifnull(dh.discount_last_money,0)+ifnull(dh.other_money,0)-ifnull(dh.deposit,0)-abs(ifnull(dh.change_amount,0))>0)
</if>
<if test="hasDebt != null and hasDebt ==0">
and (ifnull(dh.discount_last_money,0)+ifnull(dh.other_money,0)-ifnull(dh.deposit,0)-abs(ifnull(dh.change_amount,0))=0)
</if>
<if test="remark != null and remark !=''">
<bind name="bindRemark" value="'%'+remark+'%'"/>
and (dh.remark like #{bindRemark} or di.remark like #{bindRemark})
</if>
and ifnull(dh.delete_Flag,'0') !='1') tb
</select>
<select id="findMaterialsListMapByHeaderIdList" resultType="com.jsh.erp.datasource.vo.MaterialsListVo">
select jsh_depot_item.header_id, group_concat(concat(jsh_material.name,' ',ifnull(jsh_material.standard,''),' ',
ifnull(jsh_material.model,''),' ',ifnull(jsh_material.color,''))) as materialsList

View File

@@ -11,9 +11,6 @@
</if>
and ifnull(ma.delete_flag,'0') !='1'
order by ma.id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
</select>
<update id="batchDeleteMaterialAttributeByIds">

View File

@@ -147,16 +147,6 @@
)
</foreach>
</insert>
<update id="batchDeleteSerialNumberByIds">
update jsh_serial_number
set update_time=#{updateTime},updater=#{updater},delete_flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
<select id="getEnableSerialNumberList" resultType="com.jsh.erp.datasource.entities.SerialNumberEx">
select

View File

@@ -29,38 +29,6 @@
</if>
and ifnull(delete_flag,'0') !='1'
order by sort asc, id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
</select>
<select id="countsBySupplier" resultType="java.lang.Long">
SELECT
COUNT(id)
FROM jsh_supplier
WHERE 1=1
<if test="supplier != null and supplier !=''">
<bind name="bindSupplier" value="'%'+supplier+'%'"/>
and supplier like #{bindSupplier}
</if>
<if test="type != null and type !=''">
and type=#{type}
</if>
<if test="phonenum != null and phonenum !=''">
<bind name="bindPhoneNum" value="'%'+phonenum+'%'"/>
and phone_num like #{bindPhoneNum}
</if>
<if test="telephone != null and telephone !=''">
<bind name="bindTelephone" value="'%'+telephone+'%'"/>
and telephone like #{bindTelephone}
</if>
<if test="creatorArray != null">
and creator in (
<foreach collection="creatorArray" item="creator" separator=",">
#{creator}
</foreach>
)
</if>
and ifnull(delete_flag,'0') !='1'
</select>
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.SupplierExample" resultMap="com.jsh.erp.datasource.mappers.SupplierMapper.BaseResultMap">

View File

@@ -10,21 +10,8 @@
and company_name like #{bindCompanyName}
</if>
and ifnull(delete_flag,'0') !='1'
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
</select>
<select id="countsBySystemConfig" resultType="java.lang.Long">
SELECT
COUNT(id)
FROM jsh_system_config
WHERE 1=1
<if test="companyName != null">
<bind name="bindCompanyName" value="'%'+companyName+'%'"/>
and company_name like #{bindCompanyName}
</if>
and ifnull(delete_flag,'0') !='1'
</select>
<update id="batchDeleteSystemConfigByIds">
update jsh_system_config
set delete_flag='1'

View File

@@ -11,21 +11,8 @@
</if>
and ifnull(delete_flag,'0') !='1'
order by id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
</select>
<select id="countsByUnit" resultType="java.lang.Long">
SELECT
COUNT(id)
FROM jsh_unit
WHERE 1=1
<if test="name != null">
<bind name="bindName" value="'%'+name+'%'"/>
and name like #{bindName}
</if>
and ifnull(delete_flag,'0') !='1'
</select>
<update id="batchDeleteUnitByIds">
update jsh_unit
set delete_flag='1'

View File

@@ -36,11 +36,9 @@
and user.login_name like #{bindLoginName}
</if>
order by rel.user_blng_orga_dspl_seq,user.id desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>
) tb
</select>
<select id="countsByUser" resultType="java.lang.Long">
select count(user.id)
FROM jsh_user user