增加结算类型筛选并优化查询- 在 IwsCostPushMapper.xml 中添加 settlementType 筛选条件

- 优化 IwsCostPushServiceImpl 中的代码格式
- 简化 SltAgreementInfoMapper.xml 中的查询语句
This commit is contained in:
syruan 2025-09-08 18:57:58 +08:00
parent b645ab383a
commit dd18b0daf5
3 changed files with 8 additions and 11 deletions

View File

@ -224,7 +224,8 @@ public class IwsCostPushServiceImpl implements IwsCostPushService {
// 获取已结算协议 ---- 安全工器具的本月租赁区间费用明细 // 获取已结算协议 ---- 安全工器具的本月租赁区间费用明细
settlementSafetyEquipmentCostsDetails = sltAgreementInfoService.selectPeriodCostList(new PeriodCostQueryDto() settlementSafetyEquipmentCostsDetails = sltAgreementInfoService.selectPeriodCostList(new PeriodCostQueryDto()
.setAgreementIds(safetySettlementAgreementList.stream().map(IwsCostPushBean::getAgreementId).collect(Collectors.toList())) .setAgreementIds(safetySettlementAgreementList.stream().map(IwsCostPushBean::getAgreementId).collect(Collectors.toList()))
.setStartDate(firstDate).setEndDate(lastDate) .setStartDate(firstDate)
.setEndDate(lastDate)
.setSltManageType((byte) 2) .setSltManageType((byte) 2)
); );
// 把区间计算的租赁费用覆盖已结算的用作展示 // 把区间计算的租赁费用覆盖已结算的用作展示

View File

@ -76,6 +76,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="month != null"> <if test="month != null">
AND cpm.month = #{month} AND cpm.month = #{month}
</if> </if>
<if test="settlementType != null">
AND pmc.TYPE = #{settlementType}
</if>
GROUP BY GROUP BY
pmc.AGREEMENT_ID, pmc.TYPE pmc.AGREEMENT_ID, pmc.TYPE

View File

@ -1122,23 +1122,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectLeasePeriodCostList" parameterType="com.bonus.material.settlement.domain.dto.PeriodCostQueryDto" resultMap="PeriodCostResultMap"> <select id="selectLeasePeriodCostList" parameterType="com.bonus.material.settlement.domain.dto.PeriodCostQueryDto" resultMap="PeriodCostResultMap">
SELECT SELECT
bai.agreement_id, bai.agreement_id, bai.agreement_code, bai.unit_id,
bai.agreement_code,
bai.unit_id,
bu.unit_name, bu.unit_name,
bai.project_id, bai.project_id,
bp.pro_name as project_name, bp.pro_name as project_name,
sai.type_id, sai.type_id,
mt.type_name as model_name, mt.buy_price, mt.type_name as model_name, mt.buy_price,
mt1.type_name as type_name, mt1.type_name as type_name,
sai.ma_id, sai.ma_id, sai.num, sai.lease_price, sai.start_time, sai.end_time,
sai.num,
sai.lease_price,
sai.start_time,
sai.end_time,
bai.is_slt AS is_settled, bai.is_slt AS is_settled,
sai.slt_time AS settlement_time, sai.slt_time AS settlement_time, sai.status,
sai.status,
mt.unit_name as mt_unit_name, mt.comsumable, mt.unit_name as mt_unit_name, mt.comsumable,
bai.remark bai.remark
FROM bm_agreement_info bai FROM bm_agreement_info bai