增加查询未完成维修单列表功能,优化相关SQL逻辑
This commit is contained in:
parent
535e9ccc2f
commit
ba3470bc26
|
|
@ -307,5 +307,9 @@ public interface SltAgreementInfoMapper {
|
||||||
*/
|
*/
|
||||||
List<PeriodCostResultVo> selectPeriodCostListForCharge(PeriodCostQueryDto queryDto);
|
List<PeriodCostResultVo> selectPeriodCostListForCharge(PeriodCostQueryDto queryDto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询某个协议未完成的维修单列表
|
||||||
|
* @param bean 协议ID
|
||||||
|
*/
|
||||||
List<SltAgreementInfo> getRepairCodeList(SltAgreementInfo bean);
|
List<SltAgreementInfo> getRepairCodeList(SltAgreementInfo bean);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1370,27 +1370,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
tt.task_id as taskId,
|
tt.task_id as taskId,
|
||||||
tt.code as repairCode,
|
tt.code as repairCode,
|
||||||
tt.task_type as taskType,
|
tt.task_type as taskType,
|
||||||
sdd.dict_label as repairStatus
|
sdd.dict_label as repairStatus
|
||||||
|
from
|
||||||
from tm_task tt
|
tm_task tt
|
||||||
left join tm_task_agreement tta on tta.task_id = tt.task_id
|
left join tm_task_agreement tta on tta.task_id = tt.task_id
|
||||||
left join sys_dict_data sdd on sdd.dict_value = tt.task_status and sdd.dict_type = 'repair_task_status'
|
left join sys_dict_data sdd on sdd.dict_value = tt.task_status and sdd.dict_type = 'repair_task_status'
|
||||||
where tta.agreement_id = #{agreementId} and tt.task_type = 4 and tt.task_status != 1
|
where
|
||||||
|
tta.agreement_id = #{agreementId} and tt.task_type = 4 and tt.task_status != 1
|
||||||
and tt.task_id not in ( select
|
and tt.task_id not in (
|
||||||
tt.task_id as taskId
|
select
|
||||||
|
tt.task_id as taskId
|
||||||
from tm_task tt
|
from tm_task tt
|
||||||
left join tm_task_agreement tta on tta.task_id = tt.task_id
|
left join tm_task_agreement tta on tta.task_id = tt.task_id
|
||||||
LEFT JOIN repair_apply_details rad on tt.task_id = rad.task_id and is_ds =1
|
left join repair_apply_details rad on tt.task_id = rad.task_id and is_ds =1
|
||||||
where tta.agreement_id = #{agreementId} and tt.task_type = 4 and tt.task_status != 1
|
where
|
||||||
AND IFNULL(rad.repaired_num,0) > 0
|
tta.agreement_id = #{agreementId} and tt.task_type = 4 and tt.task_status != 1
|
||||||
)
|
AND IFNULL(rad.repaired_num,0) > 0
|
||||||
|
)
|
||||||
|
<if test="repairCode != null">
|
||||||
<if test="repairCode != null">
|
and tt.code like concat('%', #{repairCode}, '%')
|
||||||
and tt.code like concat('%', #{repairCode}, '%')
|
</if>
|
||||||
</if>
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getLeaseSltDetails" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
|
<select id="getLeaseSltDetails" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue