宁夏测试问题修改

This commit is contained in:
csyue 2024-06-17 16:30:46 +08:00
parent ee30623248
commit 113ed727af
1 changed files with 50 additions and 46 deletions

View File

@ -1026,52 +1026,56 @@
lad.id lad.id
</select> </select>
<select id="getLeaseOutListByUser" resultType="com.bonus.sgzb.app.domain.TmTask"> <select id="getLeaseOutListByUser" resultType="com.bonus.sgzb.app.domain.TmTask">
SELECT SELECT
tt.*, tt.*,
lai.id AS id, lai.id AS id,
bpl.lot_id AS proId, bpl.lot_id AS proId,
bpl.lot_name AS proName, bpl.lot_name AS proName,
bui.unit_id AS unitId, bui.unit_id AS unitId,
bui.unit_name AS unitName, bui.unit_name AS unitName,
lai.lease_person AS leasePerson, lai.lease_person AS leasePerson,
lai.phone AS leasePhone, lai.phone AS leasePhone,
tt.create_by AS applyFor, tt.create_by AS applyFor,
d.`name` AS taskName, d.`name` AS taskName,
lai.lease_type AS leaseType, lai.lease_type AS leaseType,
d.id AS examineStatusId, d.id AS examineStatusId,
bai.agreement_code AS agreementCode, bai.agreement_code AS agreementCode,
tt.create_time AS createTimes, tt.create_time AS createTimes,
IFNULL(sum(lad.pre_num),0) as preCountNum, IFNULL( sum( lad.pre_num ), 0 ) AS preCountNum,
IFNULL(sum(lad.al_num),0) as alNum, IFNULL( sum( lad.al_num ), 0 ) AS alNum,
tt.update_time AS updateTimes tt.update_time AS updateTimes
from FROM
lease_apply_info lai lease_apply_info lai
LEFT JOIN tm_task tt on lai.task_id = tt.task_id LEFT JOIN tm_task tt ON lai.task_id = tt.task_id
LEFT JOIN sys_dic d ON d.id = tt.task_status LEFT JOIN sys_dic d ON d.id = tt.task_status
LEFT JOIN tm_task_agreement tta ON lai.task_id = tta.task_id LEFT JOIN tm_task_agreement tta ON lai.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
LEFT JOIN bm_project_lot bpl ON bpl.lot_id = bai.project_id LEFT JOIN bm_project_lot bpl ON bpl.lot_id = bai.project_id
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
LEFT JOIN lease_apply_details lad on lai.id = lad.parennt_id LEFT JOIN lease_apply_details lad ON lai.id = lad.parennt_id
LEFT JOIN ma_type_keeper mtk on lad.type_id = mtk.type_id LEFT JOIN ( SELECT mtk.type_id, mtk.user_id FROM ma_type_keeper mtk LEFT JOIN lease_apply_details lad1 ON lad1.type_id = mtk.type_id LIMIT 1 ) aa ON lad.type_id = aa.type_id
WHERE tt.task_status in(33,34,35) WHERE
<if test="userId != 1"> tt.task_status IN ( 33, 34, 35 )
and mtk.user_id = #{userId} <if test="userId != 1">
</if> and aa.user_id = #{userId}
<if test="code != null and code != ''"> </if>
and tt.code like concat('%', #{code}, '%') <if test="code != null and code != ''">
</if> and tt.code like concat('%', #{code}, '%')
<if test="unitId != null"> </if>
and bui.unit_id = #{unitId} <if test="unitId != null">
</if> and bui.unit_id = #{unitId}
<if test="proId != null"> </if>
and bpl.lot_id = #{proId} <if test="proId != null">
</if> and bpl.lot_id = #{proId}
<if test="taskStatus != null"> </if>
and tt.task_status = #{taskStatus} <if test="taskStatus != null">
</if> and tt.task_status = #{taskStatus}
GROUP BY lai.id </if>
ORDER BY tt.task_status,tt.create_time desc GROUP BY
lai.id
ORDER BY
tt.task_status,
tt.create_time DESC
</select> </select>
<select id="getLeaseDetailByParentId" resultType="com.bonus.sgzb.app.domain.TmTask"> <select id="getLeaseDetailByParentId" resultType="com.bonus.sgzb.app.domain.TmTask">
SELECT SELECT