结算接口修改

This commit is contained in:
bonus 2025-07-21 17:44:46 +08:00
parent 204924c35d
commit 953c7dcd8f
2 changed files with 76 additions and 39 deletions

View File

@ -75,7 +75,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
public List<SltAgreementInfo> getSltAgreementInfo4Project(SltAgreementInfo bean) {
Long userId = SecurityUtils.getLoginUser().getUserid();
List<SltAgreementInfo> list = sltAgreementInfoMapper.getSltAgreementInfo4Project(bean);
if (CollectionUtils.isNotEmpty(list)) {
/* if (CollectionUtils.isNotEmpty(list)) {
// 创建一个集合来保存需要移除的元素
List<SltAgreementInfo> toRemove = new ArrayList<>();
for (SltAgreementInfo info : list) {
@ -89,7 +89,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
}
// 遍历结束后统一移除元素
list.removeAll(toRemove);
}
}*/
return list;
}

View File

@ -256,6 +256,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<select id="getLeaseList" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
SELECT
res.agreementId,
res.unitName,
res.projectName,
res.companyId,
res.typeId,
res.typeName,
res.modelName,
res.mtUnitName,
res.leasePrice,
SUM(res.num) as num,
res.startTime,
res.endTime,
res.leaseDays
FROM
(
select sai.id,
sai.agreement_id as agreementId,
bui.unit_name as unitName,
@ -278,6 +294,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join ma_type mt on sai.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
where sai.agreement_id = #{agreementId}
) res
GROUP BY res.typeId,res.startTime,res.endTime
</select>
<select id="getRepairDetailsList" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
@ -337,7 +355,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
left join ma_type mt on rc.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
where rc.status in ('0','1') and rc.repair_type = '1'
where rc.status in ('0','1') and rc.repair_type = '3'
<if test="taskList != null and taskList.size() > 0">
and rc.task_id in
<foreach item="task" collection="taskList" open="(" separator="," close=")">
@ -347,6 +365,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getLoseList" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
SELECT
res.agreementId,
res.unitName,
res.projectName,
res.companyId,
res.typeId,
res.typeName,
res.modelName,
res.mtUnitName,
res.buyPrice,
SUM(res.num) as num,
res.startTime,
res.endTime,
res.leaseDays
FROM
(
select sai.id,
sai.agreement_id as agreementId,
bui.unit_name as unitName,
@ -357,7 +392,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt1.type_name as typeName,
mt.type_name as modelName,
mt.unit_name as mtUnitName,
sai.buy_price as buyPrice,
mt.buy_price as buyPrice,
sai.num as num,
sai.start_time as startTime,
sai.end_time as endTime,
@ -369,6 +404,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join ma_type mt on sai.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
where sai.agreement_id = #{agreementId} and sai.end_time is null
) res
GROUP BY res.typeId
</select>
<select id="getCost" resultType="java.lang.String">
@ -701,6 +738,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type_manage mt ON mt4.type_id = mt.type_id
WHERE
mt.user_id = #{userId}
LIMIT 1
GROUP BY sai.agreement_id
</select>
</mapper>