出库数字查询修改

This commit is contained in:
bonus 2025-11-17 10:43:28 +08:00
parent 992897b829
commit 81a356779f
1 changed files with 93 additions and 2 deletions

View File

@ -927,10 +927,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM
lease_out_details lod
LEFT JOIN lease_apply_info lai on lod.parent_id = lai.id
LEFT JOIN tm_task_agreement tta on lai.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai on tta.agreement_id = bai.agreement_id
LEFT JOIN bm_unit bu2 on bai.unit_id = bu2.unit_id
LEFT JOIN bm_project bp2 on bai.project_id = bp2.pro_id
LEFT JOIN sys_dept sd on bp2.imp_unit = sd.dept_id
LEFT JOIN bm_unit bu on lai.unit_id = bu.unit_id
LEFT JOIN bm_project bp on lai.project_id = bp.pro_id
LEFT JOIN sys_dept sd2 on bp.imp_unit = sd2.dept_id
LEFT JOIN ma_type mt on lod.type_id = mt.type_id
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
where lai.direct_id is null
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
and lod.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if>
<if test="leaseProjectId != null ">
and (bp2.pro_id = #{leaseProjectId} OR bp.pro_id = #{leaseProjectId})
</if>
<if test="leaseUnitId != null ">
and (bu2.unit_id = #{leaseUnitId} OR bu.unit_id = #{leaseUnitId})
</if>
<if test="impUnitName != null ">
and (sd2.dept_name = #{impUnitName} OR sd.dept_name = #{impUnitName})
</if>
</select>
<select id="getInfoList" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo">
@ -1102,6 +1126,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM
lease_out_details lod
LEFT JOIN lease_apply_info lai on lod.parent_id = lai.id
LEFT JOIN tm_task_agreement tta on lai.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai on tta.agreement_id = bai.agreement_id
LEFT JOIN bm_unit bu2 on bai.unit_id = bu2.unit_id
LEFT JOIN bm_project bp2 on bai.project_id = bp2.pro_id
LEFT JOIN sys_dept sd on bp2.imp_unit = sd.dept_id
LEFT JOIN bm_unit bu on lai.unit_id = bu.unit_id
LEFT JOIN bm_project bp on lai.project_id = bp.pro_id
LEFT JOIN sys_dept sd2 on bp.imp_unit = sd2.dept_id
LEFT JOIN ma_type mt on lod.type_id = mt.type_id
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
where lai.direct_id is null
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
and lod.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
@ -1112,6 +1146,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item}
</foreach>
</if>
<if test="leaseProjectId != null ">
and (bp2.pro_id = #{leaseProjectId} OR bp.pro_id = #{leaseProjectId})
</if>
<if test="leaseUnitId != null ">
and (bu2.unit_id = #{leaseUnitId} OR bu.unit_id = #{leaseUnitId})
</if>
<if test="impUnitName != null ">
and (sd2.dept_name = #{impUnitName} OR sd.dept_name = #{impUnitName})
</if>
</select>
<select id="getRopeNum" resultType="java.math.BigDecimal">
@ -1120,7 +1167,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM
lease_out_details lod
LEFT JOIN lease_apply_info lai on lod.parent_id = lai.id
LEFT JOIN ma_type mt ON lod.type_id = mt.type_id and mt.del_flag = '0'
LEFT JOIN tm_task_agreement tta on lai.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai on tta.agreement_id = bai.agreement_id
LEFT JOIN bm_unit bu2 on bai.unit_id = bu2.unit_id
LEFT JOIN bm_project bp2 on bai.project_id = bp2.pro_id
LEFT JOIN sys_dept sd on bp2.imp_unit = sd.dept_id
LEFT JOIN bm_unit bu on lai.unit_id = bu.unit_id
LEFT JOIN bm_project bp on lai.project_id = bp.pro_id
LEFT JOIN sys_dept sd2 on bp.imp_unit = sd2.dept_id
LEFT JOIN ma_type mt on lod.type_id = mt.type_id
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
where
mt.unit_value = '1' and lai.direct_id is null
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
@ -1132,6 +1188,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item}
</foreach>
</if>
<if test="leaseProjectId != null ">
and (bp2.pro_id = #{leaseProjectId} OR bp.pro_id = #{leaseProjectId})
</if>
<if test="leaseUnitId != null ">
and (bu2.unit_id = #{leaseUnitId} OR bu.unit_id = #{leaseUnitId})
</if>
<if test="impUnitName != null ">
and (sd2.dept_name = #{impUnitName} OR sd.dept_name = #{impUnitName})
</if>
</select>
<select id="getInCountNum" resultType="java.math.BigDecimal">
@ -1140,7 +1208,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM
lease_out_details lod
LEFT JOIN lease_apply_info lai on lod.parent_id = lai.id
LEFT JOIN ma_type mt ON lod.type_id = mt.type_id and mt.del_flag = '0'
LEFT JOIN tm_task_agreement tta on lai.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai on tta.agreement_id = bai.agreement_id
LEFT JOIN bm_unit bu2 on bai.unit_id = bu2.unit_id
LEFT JOIN bm_project bp2 on bai.project_id = bp2.pro_id
LEFT JOIN sys_dept sd on bp2.imp_unit = sd.dept_id
LEFT JOIN bm_unit bu on lai.unit_id = bu.unit_id
LEFT JOIN bm_project bp on lai.project_id = bp.pro_id
LEFT JOIN sys_dept sd2 on bp.imp_unit = sd2.dept_id
LEFT JOIN ma_type mt on lod.type_id = mt.type_id
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
where
mt.unit_value = '0' and lai.direct_id is null
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
@ -1152,6 +1229,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item}
</foreach>
</if>
<if test="leaseProjectId != null ">
and (bp2.pro_id = #{leaseProjectId} OR bp.pro_id = #{leaseProjectId})
</if>
<if test="leaseUnitId != null ">
and (bu2.unit_id = #{leaseUnitId} OR bu.unit_id = #{leaseUnitId})
</if>
<if test="impUnitName != null ">
and (sd2.dept_name = #{impUnitName} OR sd.dept_name = #{impUnitName})
</if>
</select>
<select id="selectPublishSignList" resultType="java.lang.Long">