缺少物资名称搜索的模块添加查询

This commit is contained in:
cwchen 2025-03-19 11:28:52 +08:00
parent 02a0d10ddb
commit fd4fa2b204
2 changed files with 54 additions and 47 deletions

View File

@ -289,10 +289,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) )
</if> </if>
<if test="typeName != null and typeName != ''"> <if test="typeName != null and typeName != ''">
and bs.type_name like CONCAT('%',#{typeName},'%') and mt1.type_name like CONCAT('%',#{typeName},'%')
</if> </if>
<if test="typeModelName != null and typeModelName != ''"> <if test="typeModelName != null and typeModelName != ''">
and bs.type_model_name like CONCAT('%',#{typeModelName},'%') and mt.type_name like CONCAT('%',#{typeModelName},'%')
</if> </if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND bs.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') AND bs.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')

View File

@ -92,54 +92,61 @@
</select> </select>
<select id="getList" resultType="com.bonus.material.ma.domain.DirectApplyInfo"> <select id="getList" resultType="com.bonus.material.ma.domain.DirectApplyInfo">
SELECT DISTINCT SELECT * FROM (
dai.create_time AS createTime, SELECT DISTINCT
su.user_name AS createName, dai.create_time AS createTime,
bui.unit_id AS backUnitId, su.user_name AS createName,
bui.unit_name AS backUnitName, bui.unit_id AS backUnitId,
bpl.pro_id AS backProId, bui.unit_name AS backUnitName,
bpl.pro_name AS backProName, bpl.pro_id AS backProId,
bui1.unit_id AS leaseUnitId, bpl.pro_name AS backProName,
bui1.unit_name AS leaseUnitName, bui1.unit_id AS leaseUnitId,
bpl1.pro_id AS leaseProId, bui1.unit_name AS leaseUnitName,
bpl1.pro_name AS leaseProName, bpl1.pro_id AS leaseProId,
GROUP_CONCAT(DISTINCT mt2.type_name) as typeName, bpl1.pro_name AS leaseProName,
swr.workflow_status as status GROUP_CONCAT(DISTINCT mt2.type_name) as typeName,
FROM swr.workflow_status as status
direct_apply_info dai FROM
LEFT JOIN bm_agreement_info bai ON dai.back_agreement_id = bai.agreement_id direct_apply_info dai
LEFT JOIN bm_agreement_info bai1 ON dai.lease_agreement_id = bai1.agreement_id LEFT JOIN bm_agreement_info bai ON dai.back_agreement_id = bai.agreement_id
LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id LEFT JOIN bm_agreement_info bai1 ON dai.lease_agreement_id = bai1.agreement_id
LEFT JOIN bm_project bpl1 ON bpl1.pro_id = bai1.project_id LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id LEFT JOIN bm_project bpl1 ON bpl1.pro_id = bai1.project_id
LEFT JOIN bm_unit bui1 ON bui1.unit_id = bai1.unit_id LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
LEFT JOIN direct_apply_details dad on dad.direct_id=dai.id LEFT JOIN bm_unit bui1 ON bui1.unit_id = bai1.unit_id
LEFT JOIN ma_type mt1 on mt1.type_id=dad.type_id LEFT JOIN direct_apply_details dad on dad.direct_id=dai.id
LEFT JOIN ma_type mt2 on mt2.type_id=mt1.parent_id LEFT JOIN ma_type mt1 on mt1.type_id=dad.type_id
left join sys_user su on dai.create_by = su.user_id LEFT JOIN ma_type mt2 on mt2.type_id=mt1.parent_id
left join sys_workflow_record swr on swr.task_id = dai.id left join sys_user su on dai.create_by = su.user_id
left join sys_workflow_record swr on swr.task_id = dai.id
<where>
<if test="lotId != null and lotId != ''">
and bpl.pro_id = #{lotId}
</if>
<if test="unitId != null and unitId != ''">
and bui.unit_id = #{unitId}
</if>
<if test="status != null and status != ''">
and dai.status = #{status}
</if>
<if test="isApp != null and taskStatus==0">and dai.status = 0 </if>
<if test="isApp != null and taskStatus==1">and (dai.status = 1 or dai.status = 2)</if>
</where>
GROUP BY dai.id
order by dai.create_time desc
) a
<where> <where>
<if test="keyWord != null and keyWord != ''"> <if test="keyWord!=null and keyWord!=''">
and ( AND (
bui.unit_name like concat('%', #{keyWord}, '%') or INSTR(a.typeName,#{keyWord}) > 0 OR
bpl.pro_name like concat('%', #{keyWord}, '%') or INSTR(a.backUnitName,#{keyWord}) > 0 OR
bui1.unit_name like concat('%', #{keyWord}, '%') or INSTR(a.backProName,#{keyWord}) > 0 OR
bpl1.pro_name like concat('%', #{keyWord}, '%')) INSTR(a.leaseUnitName,#{keyWord}) > 0 OR
INSTR(a.leaseProName,#{keyWord}) > 0
)
</if> </if>
<if test="lotId != null and lotId != ''">
and bpl.pro_id = #{lotId}
</if>
<if test="unitId != null and unitId != ''">
and bui.unit_id = #{unitId}
</if>
<if test="status != null and status != ''">
and dai.status = #{status}
</if>
<if test="isApp != null and taskStatus==0">and dai.status = 0 </if>
<if test="isApp != null and taskStatus==1">and (dai.status = 1 or dai.status = 2)</if>
</where> </where>
GROUP BY dai.id
order by dai.create_time desc
</select> </select>
<select id="getInfoById" resultType="com.bonus.material.ma.domain.DirectApplyInfo"> <select id="getInfoById" resultType="com.bonus.material.ma.domain.DirectApplyInfo">