diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/domain/vo/sltAgreementInfo/MaterialSltInfoVo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/domain/vo/sltAgreementInfo/MaterialSltInfoVo.java index 285f2015..ffde166e 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/domain/vo/sltAgreementInfo/MaterialSltInfoVo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/domain/vo/sltAgreementInfo/MaterialSltInfoVo.java @@ -23,18 +23,22 @@ public class MaterialSltInfoVo { * 结算工程 */ private String projectName; + /** * 租赁费用列表 */ List leaseList; + /** * 维修费用列表 */ List repairList; + /** * 报废费用列表 */ List scrapList; + /** * 丢失费用列表 */ @@ -90,6 +94,7 @@ public class MaterialSltInfoVo { @Excel(name = "创建时间", dateFormat = "yyyy-MM-dd HH:mm:ss") private Date createTime; + @ApiModelProperty(value = "更新人") private String updateBy; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/mapper/ClzSltAgreementInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/mapper/ClzSltAgreementInfoMapper.java index 75790c31..0a8f9105 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/mapper/ClzSltAgreementInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/mapper/ClzSltAgreementInfoMapper.java @@ -35,12 +35,12 @@ public interface ClzSltAgreementInfoMapper { /** * 更新协议结算状态 */ - int updateClzSltInfoByIds(@Param("agreementIds") List agreementIds); + int updateClzAgreementInfoByIds(@Param("agreementIds") List agreementIds); /** * 更新协议明细表状态 */ - int updateClzSltDetailsByIds(@Param("agreementIds") List agreementIds); + int updateClzSltInfoByIds(@Param("agreementIds") List agreementIds); /** * 查询结算审批列表 diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/ClzSltAgreementInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/ClzSltAgreementInfoServiceImpl.java index 6ca74834..efee8394 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/ClzSltAgreementInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/ClzSltAgreementInfoServiceImpl.java @@ -54,6 +54,7 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic * @param sltAgreementApply */ @Override + @Transactional(rollbackFor = Exception.class) public AjaxResult costExamine(SltAgreementApply sltAgreementApply) { if (Objects.isNull(sltAgreementApply) || Objects.isNull(sltAgreementApply.getStatus())) { return AjaxResult.error("结算信息为空,请刷新后重试!"); @@ -82,18 +83,19 @@ public class ClzSltAgreementInfoServiceImpl implements ClzSltAgreementInfoServic } else if (Objects.equals(REVIEW_PASS, sltAgreementApply.getStatus())) { // 通过,更新slt_apply协议审批状态 int examNum = clzSltAgreementInfoMapper.costExame(sltAgreementApply); - if (examNum == GlobalConstants.INT_0) { + if (examNum <= 0) { return AjaxResult.error("结算审批失败"); } else { // 更新结算协议表及相关信息 + clzSltAgreementInfoMapper.updateClzAgreementInfoByIds(idsBySltApplyCode); clzSltAgreementInfoMapper.updateClzSltInfoByIds(idsBySltApplyCode); - clzSltAgreementInfoMapper.updateClzSltDetailsByIds(idsBySltApplyCode); - return AjaxResult.success(); + return AjaxResult.success("审批完成"); } } else { return AjaxResult.error("审批错误,状态码错误"); } } catch (Exception e) { + System.err.println("结算审批失败,失败原因:" + e.getMessage()); return AjaxResult.error(); } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/IwsCostPushController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/IwsCostPushController.java index 3c1ea6e6..494413b7 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/IwsCostPushController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/IwsCostPushController.java @@ -107,9 +107,9 @@ public class IwsCostPushController extends BaseController { // 计算统计信息 BigDecimal totalLeaseMoney = exportVoList.stream().map(IwsCostPushExportVo::getLeaseMoney).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal totalRepairMoney = exportVoList.stream().map(IwsCostPushExportVo::getRepairMoney).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal totalLostMoney = exportVoList.stream().map(IwsCostPushExportVo::getLostMoney).reduce(BigDecimal.ZERO, BigDecimal::add); - BigDecimal totalScrapMoney = exportVoList.stream().map(IwsCostPushExportVo::getScrapMoney).reduce(BigDecimal.ZERO, BigDecimal::add); +// BigDecimal totalRepairMoney = exportVoList.stream().map(IwsCostPushExportVo::getRepairMoney).reduce(BigDecimal.ZERO, BigDecimal::add); +// BigDecimal totalLostMoney = exportVoList.stream().map(IwsCostPushExportVo::getLostMoney).reduce(BigDecimal.ZERO, BigDecimal::add); +// BigDecimal totalScrapMoney = exportVoList.stream().map(IwsCostPushExportVo::getScrapMoney).reduce(BigDecimal.ZERO, BigDecimal::add); // 创建统计行 IwsCostPushExportVo summaryVo = new IwsCostPushExportVo(); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementApplyController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementApplyController.java index 7e0a4aff..90ce6c57 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementApplyController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementApplyController.java @@ -34,6 +34,7 @@ import com.bonus.common.core.web.page.TableDataInfo; @RestController @RequestMapping("/slt_agreement_apply") public class SltAgreementApplyController extends BaseController { + @Autowired private ISltAgreementApplyService sltAgreementApplyService; @@ -49,20 +50,6 @@ public class SltAgreementApplyController extends BaseController { return getDataTable(list); } - /** - * 导出结算协议申请列表 - */ - @ApiOperation(value = "导出结算协议申请列表") - @PreventRepeatSubmit - @RequiresPermissions("settlement:apply:export") - @SysLog(title = "结算协议申请", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出结算协议申请") - @PostMapping("/export") - public void export(HttpServletResponse response, SltAgreementApply sltAgreementApply) { - List list = sltAgreementApplyService.selectSltAgreementApplyList(sltAgreementApply); - ExcelUtil util = new ExcelUtil(SltAgreementApply.class); - util.exportExcel(response, list, "结算协议申请数据"); - } - /** * 获取结算协议申请详细信息 */ @@ -116,4 +103,18 @@ public class SltAgreementApplyController extends BaseController { public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(sltAgreementApplyService.deleteSltAgreementApplyByIds(ids)); } + + /** + * 导出结算协议申请列表 + */ + @ApiOperation(value = "导出结算协议申请列表") + @PreventRepeatSubmit + @RequiresPermissions("settlement:apply:export") + @SysLog(title = "结算协议申请", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出结算协议申请") + @PostMapping("/export") + public void export(HttpServletResponse response, SltAgreementApply sltAgreementApply) { + List list = sltAgreementApplyService.selectSltAgreementApplyList(sltAgreementApply); + ExcelUtil util = new ExcelUtil<>(SltAgreementApply.class); + util.exportExcel(response, list, "结算协议申请数据"); + } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java index da8037da..ac12d626 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java @@ -71,10 +71,10 @@ public class SltAgreementInfoController extends BaseController { @Autowired private ISltAgreementInfoService sltAgreementInfoService; - @Autowired + @Resource private SltAgreementInfoMapper sltAgreementInfoMapper; - @Autowired + @Resource private TmTaskMapper taskMapper; @Resource @@ -197,14 +197,11 @@ public class SltAgreementInfoController extends BaseController { return AjaxResult.success(bean); } - public SltInfoVo mergerData(SltInfoVo vo,List list,List unitNames,List projectNames){ + public SltInfoVo mergerData(SltInfoVo vo,List list, List unitNames, List projectNames) { vo.setUnitName(handleData(unitNames)); vo.setProjectName(handleData(projectNames)); - BigDecimal leaseCost = BigDecimal.valueOf(0.00); - BigDecimal repairCost = BigDecimal.valueOf(0.00); - BigDecimal scrapCost = BigDecimal.valueOf(0.00); - BigDecimal loseCost = BigDecimal.valueOf(0.00); - BigDecimal reducCost = BigDecimal.valueOf(0.00); + BigDecimal leaseCost = BigDecimal.ZERO, repairCost = BigDecimal.ZERO, scrapCost = BigDecimal.ZERO;; + BigDecimal loseCost = BigDecimal.ZERO, reducCost = BigDecimal.ZERO; //租赁费用列表 List leaseList = new ArrayList<>(); //维修费用列表 @@ -1426,10 +1423,10 @@ public class SltAgreementInfoController extends BaseController { public AjaxResult submitCosts(@RequestBody SltInfoVo sltInfoVo) { return toAjax(sltAgreementInfoService.submitCosts(sltInfoVo)); } + /** * 维修单据查询 */ - @ApiOperation(value = "维修报表list查询") @GetMapping("/viewRepairCode") public TableDataInfo viewRepairCode(SltAgreementInfo bean) { @@ -1499,7 +1496,6 @@ public class SltAgreementInfoController extends BaseController { @ApiOperation(value = "未结算报表list查询") @GetMapping("/getSltReportList") public TableDataInfo getSltReportList(SltAgreementInfo query) { - long startTime = System.currentTimeMillis(); try { // 参数预处理和校验 if (query == null) { @@ -1514,7 +1510,6 @@ public class SltAgreementInfoController extends BaseController { if (CollectionUtils.isEmpty(list)) { return getDataTable(new ArrayList<>()); } - log.info("查询到未结算协议数量: {}", list.size()); // ----------- 给查询出来的协议设置权限控制(例如只查询工器具) --------------- @@ -1558,8 +1553,6 @@ public class SltAgreementInfoController extends BaseController { // && CollectionUtils.isEmpty(vo.getLoseList()) // ); - long endTime = System.currentTimeMillis(); - log.info("未结算报表查询完成,耗时: {}ms,返回数据: {}条", (endTime - startTime), dataList.size()); TableDataInfo resultTableData = getDataTable(dataList); if (RequestContext.get("unSltAgreementListCount") != null) { diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementApply.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementApply.java index 77fa49b8..0e940597 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementApply.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementApply.java @@ -16,11 +16,10 @@ import org.apache.poi.ss.usermodel.HorizontalAlignment; * @author xsheng * @date 2024-10-16 */ - - @Data @ToString public class SltAgreementApply extends BaseEntity { + private static final long serialVersionUID = 1L; /** $column.columnComment */ @@ -35,7 +34,8 @@ public class SltAgreementApply extends BaseEntity { private String code; /** 结算类型 1工器具 2安全工器具 */ - private Byte settlementType; + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Integer settlementType; /** * 是否结算 0未结算 1结算完成 2部分结算 diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java index 8640f744..58fb1dc7 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java @@ -23,6 +23,12 @@ import org.apache.ibatis.annotations.Param; * @date 2024-10-16 */ public interface SltAgreementInfoMapper { + + /** + * 根据协议ID+结算类型去更新对应的费用明细 + */ + int updateSltInfoByAgreementIdType(SltAgreementInfo sltAgreementInfo); + /** * 查询结算信息 * @@ -237,6 +243,11 @@ public interface SltAgreementInfoMapper { */ int costExame(SltAgreementApply sltAgreementApply); + + /** + * 删除结算明细 + * @param sltAgreementApply 结算申请单 + */ void costDeleteDetail(SltAgreementApply sltAgreementApply); /** diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java index 72845100..9077b080 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java @@ -29,6 +29,7 @@ import com.bonus.material.settlement.domain.SltAgreementApply; import com.bonus.material.settlement.domain.SltAgreementReduce; import com.bonus.material.settlement.domain.SltAgreementRelation; import com.bonus.material.settlement.domain.vo.SltInfoVo; +import com.bonus.material.settlement.mapper.SltAgreementApplyMapper; import com.bonus.material.settlement.mapper.SltAgreementReduceMapper; import com.bonus.material.task.domain.TmTask; import com.bonus.material.task.mapper.TmTaskMapper; @@ -74,16 +75,25 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { // 安全工器具结算类型settlement_type键值 private static final int SAFETY_EQUIPMENT_SETTLEMENT_TYPE = GlobalConstants.INT_2; - @Autowired + // 结算审核通过 + private static final String REVIEW_PASS = "2"; + + // 结算审核驳回 + private static final String REVIEW_REJECT = "3"; + + @Resource private SltAgreementInfoMapper sltAgreementInfoMapper; - @Autowired + @Resource private BmAgreementInfoMapper bmAgreementInfoMapper; - @Autowired + @Resource + private SltAgreementApplyMapper sltAgreementApplyMapper; + + @Resource private BmConfigMapper bmConfigMapper; - @Autowired + @Resource private TmTaskMapper taskMapper; @Resource @@ -227,12 +237,12 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { } } for (SltAgreementInfo lose : loseList) { - if(lose.getCosts()!=null){ + if (lose.getCosts() != null) { loseCost = loseCost.add(lose.getCosts()); } } for (SltAgreementReduce reduction : reductionList) { - if(reduction.getLeaseMoney()!=null){ + if (reduction.getLeaseMoney() != null) { reducCost = reducCost.add(reduction.getLeaseMoney()); } } @@ -642,6 +652,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { throw new ServiceException("协议id错误"); } + // 查询【待审核】+【审核通过】的结算单数量 int theSettledCount = sltAgreementInfoMapper.selectTheSettledCountByAgreementIdType(sltInfoVo.getSettlementType(), agreementId); if (sltInfoVo.getAgreementIds().length <= 1) { // 如果不是批量提交,已结算的费用类型就直接提示已结算 @@ -804,7 +815,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { public List getSltList(SltAgreementInfo bean) { List list = sltAgreementInfoMapper.getSltList(bean); if (CollectionUtils.isNotEmpty(list)) { - for (SltAgreementInfo row : list){ + for (SltAgreementInfo row : list) { SltInfoVo sltInfoVo; sltInfoVo = getSltInfo(row); if (sltInfoVo != null) { @@ -959,41 +970,74 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { * @return 结果 */ @Override + @Transactional(rollbackFor = Exception.class) public AjaxResult costExamine(SltAgreementApply sltAgreementApply) { + if (Objects.isNull(sltAgreementApply) || Objects.isNull(sltAgreementApply.getStatus())) { + return AjaxResult.error("结算信息为空,请刷新后重试!"); + } try { - Long userid = SecurityUtils.getLoginUser().getUserid(); - sltAgreementApply.setAuditor(String.valueOf(userid)); + sltAgreementApply.setAuditor(String.valueOf(SecurityUtils.getLoginUser().getUserid())); sltAgreementApply.setAuditTime(DateUtils.getNowDate()); sltAgreementApply.setUpdateTime(DateUtils.getNowDate()); - if (sltAgreementApply.getStatus().equals("3")) { - // 驳回,更新slt协议审批状态 - int count = sltAgreementInfoMapper.costExame(sltAgreementApply); + + if (Objects.equals(REVIEW_REJECT, sltAgreementApply.getStatus())) { + // 驳回,更新slt_apply协议审批状态 + int updateNum = sltAgreementInfoMapper.costExame(sltAgreementApply); // 删除结算详情 sltAgreementInfoMapper.costDeleteDetail(sltAgreementApply); - if (count != 1) { + if (updateNum != GlobalConstants.INT_1) { return AjaxResult.error("结算审批失败"); } else { - // 更新协议状态 + // 获取已审核和待审核的条数 int beforeSettlementCount = sltAgreementInfoMapper.getBeforeSettlementCount(new SltInfoVo().setAgreementId(sltAgreementApply.getAgreementId())); // 根据待审核+已审核的数量来决定更新到哪种状态 sltAgreementApply.setIsSlt(beforeSettlementCount > GlobalConstants.INT_0 ? GlobalConstants.INT_2 : GlobalConstants.INT_0); int countTwo = sltAgreementInfoMapper.updateBmAgreementReject(sltAgreementApply); - if(countTwo != GlobalConstants.INT_1) { + if (countTwo != GlobalConstants.INT_1) { return AjaxResult.error("bm_agreement_info修改失败"); } return AjaxResult.success(); } - } else { - //通过 - int count = sltAgreementInfoMapper.costExame(sltAgreementApply); - if (count == GlobalConstants.INT_0) { + } else if (Objects.equals(REVIEW_PASS, sltAgreementApply.getStatus())) { + // 根据ID查询settlement_type + SltAgreementApply sltAgreementApplyFromDb = sltAgreementApplyMapper.selectSltAgreementApplyById(sltAgreementApply.getId()); + if (sltAgreementApplyFromDb == null || sltAgreementApplyFromDb.getSettlementType() == null) { + return AjaxResult.error("结算类型错误,结算权限码为空"); + } + + // 通过,更新slt_apply协议审批状态 + int examNum = sltAgreementInfoMapper.costExame(sltAgreementApply); + + // 更新bm_agreement_info结算状态 + int beforeCount = sltAgreementInfoMapper.getBeforeSettlementCount(new SltInfoVo().setAgreementId(sltAgreementApply.getAgreementId())); + sltAgreementApply.setIsSlt(beforeCount == 0 ? GlobalConstants.INT_1 : GlobalConstants.INT_2); + int countTwo = bmAgreementInfoMapper.updateBmAgreementInfo(new BmAgreementInfo().setIsSlt(Long.valueOf(sltAgreementApply.getIsSlt())) + .setAgreementId(sltAgreementApply.getAgreementId()) + ); + if (countTwo != GlobalConstants.INT_1) { + throw new ServiceException("bm_agreement_info修改失败"); + } + + // 修改slt_agreement_info的结算状态 + int countThree = sltAgreementInfoMapper.updateSltInfoByAgreementIdType( + new SltAgreementInfo() + .setAgreementId(sltAgreementApply.getAgreementId()) + .setSettlementType(Integer.valueOf(sltAgreementApplyFromDb.getSettlementType())) + ); + if (countThree == 0) { + throw new ServiceException("slt_agreement_info修改失败"); + } + + if (examNum == GlobalConstants.INT_0) { return AjaxResult.error("结算审批失败"); } else { return AjaxResult.success(); } + } else { + return AjaxResult.error("审批错误,状态码错误"); } } catch (Exception e) { - return AjaxResult.error(); + throw new ServiceException(e.getMessage()); } } diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/ClzAgreementInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/ClzAgreementInfoMapper.xml index cfce416d..964cbbd0 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/ClzAgreementInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/ClzAgreementInfoMapper.xml @@ -3,6 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + insert into clz_slt_agreement_apply @@ -52,42 +53,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -294,7 +295,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" saa.`code` = #{sltApplyCode} - + where `code` = #{code} + - + update clz_bm_agreement_info - set is_slt = 1, update_time = now(), slt_time = now() + set is_slt = 1, update_time = now() where agreement_id in #{item} - + update clz_slt_agreement_info - set end_time = now(), update_time = now() - where id in - + set slt_time = now(), update_time = now(), is_slt = '1' + where agreement_id in + #{item} diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementApplyMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementApplyMapper.xml index 23868f0b..f1e93545 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementApplyMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementApplyMapper.xml @@ -15,10 +15,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select id, code, creator, create_time, update_time, auditor, audit_time, status, company_id, cost, remark from slt_agreement_apply + select id, code, creator, create_time, update_time, auditor, audit_time, status, company_id, cost, remark, settlement_type from slt_agreement_apply + + + UPDATE + slt_agreement_info sai + JOIN + ma_type mt ON sai.type_id = mt.type_id AND mt.`level` = '4' + SET + sai.is_slt = '1', sai.slt_time = NOW() + WHERE + sai.agreement_id = #{agreementId} AND mt.jiju_type = #{settlementType} +