This commit is contained in:
linfso 2024-06-13 22:52:08 +08:00
parent 95d01b1c12
commit 589ab24067
2 changed files with 54 additions and 13 deletions

View File

@ -35,11 +35,11 @@
<where>
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="packNo != null and packNo != ''"> and pack_no like concat('%', #{packNo}, '%')</if>
<if test="billCode != null and billCode != ''"> and bill_code = #{billCode}</if>
<if test="packNo != null and packNo != ''"> and ( FIND_IN_SET(`pack_no`,#{packNo}) or pack_no like concat('%', #{packNo}, '%') )</if>
<if test="billCode != null and billCode != ''"> and ( FIND_IN_SET(`bill_code`,#{billCode}) or bill_code like concat('%', #{billCode}, '%') )</if>
<if test="scanDate != null "> and scan_date = #{scanDate}</if>
<if test="scanStatus != null and scanStatus != ''"> and scan_status like concat('%', #{scanStatus}, '%')</if>
<if test="packStatus != null and packStatus != ''"> and pack_status like concat('%', #{packStatus}, '%')</if>
<if test="scanStatus != null and scanStatus != ''"> and scan_status=#{scanStatus}</if>
<if test="packStatus != null and packStatus != ''"> and pack_status=#{packStatus}</if>
<if test="scanMan != null and scanMan != ''"> and scan_man like concat('%', #{scanMan}, '%')</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="tenantId != null and tenantId != ''"> and tenant_id like concat('%', #{tenantId}, '%')</if>
@ -48,8 +48,29 @@
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
<if test="createSite != null and createSite != ''"> and create_site=#{createSite}</if>
<if test="updateSite != null and updateSite != ''"> and update_site=#{updateSite}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != ''">
and create_time <![CDATA[ >= ]]> #{params.beginCreateTime}
</if>
<if test="params.endCreateTime != null and params.endCreateTime != ''">
and create_time <![CDATA[ <= ]]> #{params.endCreateTime}
</if>
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
and (
create_site in (
SELECT t1.site_code FROM (
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
#{params.privSiteCode} ) pd
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
UNION
SELECT #{params.privSiteCode} FROM dual
)
)
</if>
</where>
order by create_time desc
</select>

View File

@ -34,13 +34,13 @@
<where>
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="billCode != null and billCode != ''"> and bill_code like concat('%', #{billCode}, '%')</if>
<if test="batchNo != null and batchNo != ''"> and batch_no like concat('%', #{batchNo}, '%')</if>
<if test="billCode != null and billCode != ''"> and ( FIND_IN_SET(`bill_code`,#{billCode}) or bill_code like concat('%', #{billCode}, '%') )</if>
<if test="batchNo != null and batchNo != ''"> and ( FIND_IN_SET(`batch_no`,#{batchNo}) or batch_no like concat('%', #{batchNo}, '%') )</if>
<if test="scanDate != null "> and scan_date = #{scanDate}</if>
<if test="scanStatus != null and scanStatus != ''"> and scan_status like concat('%', #{scanStatus}, '%')</if>
<if test="groupStatus != null and groupStatus != ''"> and group_status like concat('%', #{groupStatus}, '%')</if>
<if test="scanStatus != null and scanStatus != ''"> and scan_status=#{scanStatus}</if>
<if test="groupStatus != null and groupStatus != ''"> and group_status=#{groupStatus}</if>
<if test="scanMan != null and scanMan != ''"> and scan_man like concat('%', #{scanMan}, '%')</if>
<if test="scanSite != null and scanSite != ''"> and scan_site like concat('%', #{scanSite}, '%')</if>
<if test="scanSite != null and scanSite != ''"> and scan_site =#{scanSite}</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="tenantId != null and tenantId != ''"> and tenant_id like concat('%', #{tenantId}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
@ -48,8 +48,28 @@
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
<if test="createSite != null and createSite != ''"> and create_site=#{createSite}</if>
<if test="updateSite != null and updateSite != ''"> and update_site=#{updateSite}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != ''">
and create_time <![CDATA[ >= ]]> #{params.beginCreateTime}
</if>
<if test="params.endCreateTime != null and params.endCreateTime != ''">
and create_time <![CDATA[ <= ]]> #{params.endCreateTime}
</if>
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
and (
create_site in (
SELECT t1.site_code FROM (
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
#{params.privSiteCode} ) pd
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
UNION
SELECT #{params.privSiteCode} FROM dual
)
)
</if>
</where>
order by create_time desc
</select>