Merge remote-tracking branch 'origin/master'

This commit is contained in:
wcy 2024-09-28 13:39:23 +08:00
commit 34a1a81673
25 changed files with 362 additions and 20 deletions

View File

@ -0,0 +1,27 @@
package com.bonus.sgzb.base.api.domain;
import lombok.Data;
import java.math.BigDecimal;
/**
* @Authorliang.chao
* @Date2024/9/27 - 9:44
*/
@Data
public class ApplyRelation {
/**
* 费用描述
*/
private String costRemark;
/**
* 费用价格
*/
private BigDecimal addCost;
/**
* 协议id
*/
private String agreementId;
}

View File

@ -65,7 +65,7 @@ public class SltAgreementInfo {
@ExcelProperty(index = 6, value = "开始日期")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date startTime;
private String startTime;
/**
* 退料时间
*/
@ -73,7 +73,7 @@ public class SltAgreementInfo {
@ExcelProperty(index = 7, value = "结算日期")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date endTime;
private String endTime;
/**
* 0在用1退回
*/

View File

@ -65,4 +65,5 @@ public class SltAgreementRelation {
*数据所属
*/
private String companyId;
private List<ApplyRelation> applyRelation;
}

View File

@ -32,6 +32,10 @@ public class SltInfoVo {
* 丢失费用列表
*/
List<SltAgreementInfo> loseList;
/**
* 额外增加费用明细
*/
List<ApplyRelation> addCostList;
List<SltAgreementRelation> relations;

View File

@ -477,7 +477,7 @@ public class TmTaskController extends BaseController {
* @return 列表
*/
@Log(title = "查询单个领料出库详情- app/web", businessType = BusinessType.QUERY)
@GetMapping(value = "getLeaseAuditListDetail")
@GetMapping(value = "/getLeaseAuditListDetail")
public AjaxResult getLeaseAuditListDetail(TmTask task) {
if (StringUtils.isNull(task)) {
return AjaxResult.error("参数错误");
@ -497,13 +497,33 @@ public class TmTaskController extends BaseController {
}
}
@Log(title = "领料出库详情记录", businessType = BusinessType.QUERY)
@GetMapping(value = "/getLeaseOutDetailRecord")
public AjaxResult getLeaseOutDetailRecord(TmTask task) {
if (StringUtils.isNull(task)) {
return AjaxResult.error("参数错误");
}
List<TmTask> leaseAuditList = tmTaskService.getLeaseOutDetailRecord(task);
return AjaxResult.success(leaseAuditList);
}
@Log(title = "导出领料出库详情明细记录", businessType = BusinessType.EXPORT)
@PostMapping(value = "/exportLeaseOutDetailRecord")
public void exportLeaseOutDetailRecord(HttpServletResponse response, TmTask task) {
List<TmTask> leaseAuditList = tmTaskService.getLeaseOutDetailRecord(task);
List<LeaseOutDetailRecord> tmTaskDtos = Convert.toList(LeaseOutDetailRecord.class, leaseAuditList);
ExcelUtil<LeaseOutDetailRecord> util = new ExcelUtil<LeaseOutDetailRecord>(LeaseOutDetailRecord.class);
util.exportExcel(response, tmTaskDtos, "领料出库明细记录");
}
/**
* 导出领料出库列表
*
* @param task 筛选条件
* @return 列表
*/
@Log(title = "导出领料出库列表", businessType = BusinessType.QUERY)
@Log(title = "导出领料出库列表", businessType = BusinessType.EXPORT)
@PostMapping(value = "export")
public void export(HttpServletResponse response, TmTask task) {

View File

@ -0,0 +1,30 @@
package com.bonus.sgzb.app.domain;
import com.bonus.sgzb.common.core.annotation.Excel;
import lombok.Data;
/**
* @Authorliang.chao
* @Date2024/9/26 - 18:01
*/
@Data
public class LeaseOutDetailRecord {
@Excel(name = "规格型号")
private String typeModelName;
@Excel(name = "类型名称")
private String typeName;
private String maCode;
@Excel(name = "出库时间")
private String createTime;
@Excel(name = "出库数量")
private String outNum;
@Excel(name = "出库人")
private String userName;
}

View File

@ -147,4 +147,6 @@ public interface TmTaskMapper {
int updateLeaseApplyInfoRejectInfoCq(@Param("record") LeaseApplyInfo leaseApplyInfo);
int updateLeaseApplyInfoAuditInfoCq(@Param("record") LeaseApplyInfo leaseApplyInfo);
List<TmTask> getLeaseOutDetailRecord(TmTask record);
}

View File

@ -27,6 +27,7 @@ public interface TmTaskService{
List<TmTask> getLeaseAuditList(TmTask record);
List<TmTask> getLeaseAuditListByOne(TmTask record);
List<TmTask> getLeaseOutDetailRecord(TmTask record);
List<TmTask> getLeaseAuditListByAdmin(TmTask record);

View File

@ -270,6 +270,11 @@ public class TmTaskServiceImpl implements TmTaskService {
return leaseDetailByParentId;
}
@Override
public List<TmTask> getLeaseOutDetailRecord(TmTask record) {
return tmTaskMapper.getLeaseOutDetailRecord(record);
}
/**
* 创建审批流领料申请
*

View File

@ -8,6 +8,7 @@ import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import com.bonus.sgzb.common.security.annotation.RequiresPermissions;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.CollectionUtils;

View File

@ -6,6 +6,7 @@ import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import com.bonus.sgzb.material.domain.InputRecord;
import com.bonus.sgzb.material.domain.OutRecord;
import com.bonus.sgzb.material.domain.ScrapRecord;
import com.bonus.sgzb.material.service.InputRecordService;
import com.bonus.sgzb.material.service.ScrapRecordService;
@ -21,8 +22,8 @@ import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* @description 综合查询--机具入库查询
* @author hay
* @description 综合查询--机具入库查询
* @date 2024/2/26 14:15
*/
@Api(tags = "综合查询--机具入库查询")
@ -43,17 +44,33 @@ public class InputRecordController extends BaseController {
return AjaxResult.success(getDataTable(list));
}
@ApiOperation(value = "综合查询--机具出库查询列表")
@GetMapping("/getOutputRecordList")
public AjaxResult getOutputRecordList(OutRecord bean) {
startPage();
List<OutRecord> list = inputRecordService.getOutputRecordList(bean);
return AjaxResult.success(getDataTable(list));
}
/**
* 导出综合查询机具入库查询列表
*/
@ApiOperation("导出综合查询机具入库查询列表")
@Log(title = "导出综合查询机具入库查询列表", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, InputRecord bean)
{
public void exInputport(HttpServletResponse response, InputRecord bean) {
List<InputRecord> list = inputRecordService.getInputRecordList(bean);
ExcelUtil<InputRecord> util = new ExcelUtil<InputRecord>(InputRecord.class);
util.exportExcel(response, list, "综合查询--入库记录");
}
@ApiOperation("导出综合查询机具出库查询列表")
@Log(title = "导出综合查询机具出库查询列表", businessType = BusinessType.EXPORT)
@PostMapping("/exOutputport")
public void exOutputport(HttpServletResponse response, OutRecord bean) {
List<OutRecord> list = inputRecordService.getOutputRecordList(bean);
ExcelUtil<OutRecord> util = new ExcelUtil<OutRecord>(OutRecord.class);
util.exportExcel(response, list, "综合查询--出库记录");
}
}

View File

@ -212,6 +212,15 @@ public class SltAgreementInfoController extends BaseController {
util.exportExcel(response, leaseInfoList, "维修明细导出");
}
/**
* 校验该类型是否有归还记录有的话该类型都按最后一次提交时间规划
*/
/* @ApiOperation(value = "费用结算提交")
@PostMapping("/checkSltEndTime")
public AjaxResult checkSltEndTime(@RequestBody SltAgreementApply apply) {
return sltAgreementInfoService.submitFee(apply);
}*/
/**
* 费用结算提交
*/

View File

@ -0,0 +1,80 @@
package com.bonus.sgzb.material.domain;
import com.bonus.sgzb.common.core.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* @author hay
* @description 综合查询--机具入库查询
* @date 2024/2/26 14:51
*/
@ApiModel(description = "机具出库查询")
@Data
public class OutRecord {
private static final long serialVersionUID = 2227217051604273598L;
@ApiModelProperty(value = "领料单号")
@Excel(name = "领料单号")
private String code;
@ApiModelProperty(value = "工程名称")
@Excel(name = "工程名称")
private String lotName;
@ApiModelProperty(value = "单位id")
private String unitId;
@ApiModelProperty(value = "工程id")
private String lotId;
@ApiModelProperty(value = "领料单位")
@Excel(name = "领料单位")
private String unitName;
@ApiModelProperty(value = "规格型号")
@Excel(name = "规格型号")
private String typeModelName;
@ApiModelProperty(value = "机具名称")
@Excel(name = "机具名称")
private String typeName;
@ApiModelProperty(value = "设备编码")
@Excel(name = "设备编码")
private String maCode;
@ApiModelProperty(value = "出库时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "出库时间")
private Date createTime;
@ApiModelProperty(value = "出库数量")
@Excel(name = "出库数量")
private Integer outNum;
@ApiModelProperty(value = "设备状态")
@Excel(name = "设备状态")
private String maStauts;
@ApiModelProperty(value = "开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private String startTime;
@ApiModelProperty(value = "结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private String endTime;
@ApiModelProperty(value = "关键字")
private String keyWord;
}

View File

@ -210,4 +210,10 @@ public class ProjUsingRecord {
@ApiModelProperty(value = "实时库存")
private Integer num;
/**
* 在用标识
*/
@ApiModelProperty(value = "在用标识")
private Integer useFlag;
}

View File

@ -34,13 +34,13 @@ public class ProjectMonthDetail {
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date startTime;
private String startTime;
/**
* 结束日期
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date endTime;
private String endTime;
/**
* 结算天数
*/

View File

@ -1,6 +1,7 @@
package com.bonus.sgzb.material.mapper;
import com.bonus.sgzb.material.domain.InputRecord;
import com.bonus.sgzb.material.domain.OutRecord;
import com.bonus.sgzb.material.domain.ScrapRecord;
import org.apache.ibatis.annotations.Mapper;
@ -20,4 +21,6 @@ public interface InputRecordMapper {
* @return List<InputRecord>
*/
List<InputRecord> getInputRecordList(InputRecord bean);
List<OutRecord> getOutputRecordList(OutRecord bean);
}

View File

@ -1,5 +1,6 @@
package com.bonus.sgzb.material.mapper;
import com.bonus.sgzb.base.api.domain.ApplyRelation;
import com.bonus.sgzb.base.api.domain.SltAgreementApply;
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
import com.bonus.sgzb.base.api.domain.SltAgreementRelation;
@ -72,4 +73,10 @@ public interface SltAgreementInfoMapper {
int updateBmAgreementInfo(@Param("agreementId") String agreementId);
int updateRecodeIsSlt(String id);
int insertApplyRelation(ApplyRelation applyRelation1);
List<ApplyRelation> getAddLoseList(AgreementInfo bean);
List<SltAgreementInfo> checkEndTime(SltAgreementApply apply);
}

View File

@ -1,6 +1,7 @@
package com.bonus.sgzb.material.service;
import com.bonus.sgzb.material.domain.InputRecord;
import com.bonus.sgzb.material.domain.OutRecord;
import com.bonus.sgzb.material.domain.ScrapRecord;
import java.util.List;
@ -18,4 +19,5 @@ public interface InputRecordService {
* @return List<InputRecord>
*/
List<InputRecord> getInputRecordList(InputRecord bean);
List<OutRecord> getOutputRecordList(OutRecord bean);
}

View File

@ -1,6 +1,7 @@
package com.bonus.sgzb.material.service.impl;
import com.bonus.sgzb.material.domain.InputRecord;
import com.bonus.sgzb.material.domain.OutRecord;
import com.bonus.sgzb.material.domain.ScrapRecord;
import com.bonus.sgzb.material.mapper.InputRecordMapper;
import com.bonus.sgzb.material.mapper.ScrapRecordMapper;
@ -26,4 +27,9 @@ public class InputRecordServiceImpl implements InputRecordService {
public List<InputRecord> getInputRecordList(InputRecord bean) {
return inputRecordMapper.getInputRecordList(bean);
}
@Override
public List<OutRecord> getOutputRecordList(OutRecord bean) {
return inputRecordMapper.getOutputRecordList(bean);
}
}

View File

@ -2,10 +2,7 @@ package com.bonus.sgzb.material.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.bonus.sgzb.base.api.domain.SltAgreementApply;
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
import com.bonus.sgzb.base.api.domain.SltAgreementRelation;
import com.bonus.sgzb.base.api.domain.SltInfoVo;
import com.bonus.sgzb.base.api.domain.*;
import com.bonus.sgzb.common.core.exception.ServiceException;
import com.bonus.sgzb.common.core.utils.DateTimeHelper;
@ -64,17 +61,29 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
List<SltAgreementInfo> preScrapList = getPreScrapList(list);
//丢失费用列表
List<SltAgreementInfo> loseList = getLoseList(list);
//额外增加费用
List<ApplyRelation> addCostList = getAddLoseList(list);
sltInfoVo.setLeaseListOne(leaseListOne);
sltInfoVo.setLeaseListThree(leaseListThree);
sltInfoVo.setRepairList(repairList);
sltInfoVo.setScrapList(scrapList);
sltInfoVo.setPreScrapList(preScrapList);
sltInfoVo.setLoseList(loseList);
List<SltAgreementRelation> relations = getRelations(leaseListOne, leaseListThree, repairList, scrapList, preScrapList, loseList, list);
sltInfoVo.setAddCostList(addCostList);
List<SltAgreementRelation> relations = getRelations(leaseListOne, leaseListThree, repairList, scrapList, preScrapList, loseList, addCostList, list);
sltInfoVo.setRelations(relations);
return sltInfoVo;
}
private List<ApplyRelation> getAddLoseList(List<AgreementInfo> list) {
List<ApplyRelation> applyRelations = new ArrayList<>();
for (AgreementInfo bean : list) {
List<ApplyRelation> addLoseList = sltAgreementInfoMapper.getAddLoseList(bean);
applyRelations.addAll(addLoseList);
}
return applyRelations;
}
@Override
public List<SltAgreementInfo> getPreScrapList(List<AgreementInfo> list) {
List<SltAgreementInfo> scrapList = new ArrayList<>();
@ -214,7 +223,7 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
return leaseList;
}
private List<SltAgreementRelation> getRelations(List<SltAgreementInfo> leaseListOne, List<SltAgreementInfo> leaseListThree, List<SltAgreementInfo> repairList, List<SltAgreementInfo> scrapList, List<SltAgreementInfo> preScrapList, List<SltAgreementInfo> loseList, List<AgreementInfo> list) {
private List<SltAgreementRelation> getRelations(List<SltAgreementInfo> leaseListOne, List<SltAgreementInfo> leaseListThree, List<SltAgreementInfo> repairList, List<SltAgreementInfo> scrapList, List<SltAgreementInfo> preScrapList, List<SltAgreementInfo> loseList, List<ApplyRelation> addCostList, List<AgreementInfo> list) {
List<SltAgreementRelation> relations = new ArrayList<>();
for (AgreementInfo info : list) {
SltAgreementRelation relation = new SltAgreementRelation();
@ -224,6 +233,7 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
BigDecimal scrapCost = BigDecimal.ZERO;
BigDecimal preScrapCost = BigDecimal.ZERO;
BigDecimal repairCost = BigDecimal.ZERO;
BigDecimal addCost = BigDecimal.ZERO;
for (SltAgreementInfo lease : leaseListOne) {
if (lease.getAgreementId().equals(info.getAgreementId().toString())) {
relation.setAgreementId(lease.getAgreementId());
@ -274,6 +284,13 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
loseCost = loseCost.add(cost);
}
}
for (ApplyRelation applyRelation : addCostList) {
if (applyRelation.getAgreementId().equals(info.getAgreementId().toString())) {
BigDecimal cost = applyRelation.getAddCost();
addCost = addCost.add(cost);
}
}
// 判断是否已经结算(01承担方)
boolean b = leaseListOne.stream().allMatch(t -> "1".equals(t.getIsSlt()));
if (b) {
@ -294,6 +311,7 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
relation.setScrapCost(scrapCost);
relation.setPreScrapCost(preScrapCost);
relation.setLoseCost(loseCost);
relation.setAddCost(addCost);
relations.add(relation);
}
return relations;
@ -303,6 +321,7 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
@Transactional
public AjaxResult submitFee(SltAgreementApply apply) {
SltAgreementRelation relation = apply.getRelation();
BigDecimal addPrice = new BigDecimal(0);
if (StringUtils.isNotBlank(apply.getRepairIds())) {
for (String id : apply.getRepairIds().split(",")) {
sltAgreementInfoMapper.updateRecodeIsSlt(id);
@ -311,6 +330,15 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
sltAgreementInfoMapper.updateInfoStatus(apply.getAgreementId());
sltAgreementInfoMapper.updateBmAgreementInfo(apply.getAgreementId());
relation.setAgreementId(apply.getAgreementId());
List<ApplyRelation> applyRelation = relation.getApplyRelation();
if (applyRelation != null && applyRelation.size() > 0) {
for (ApplyRelation applyRelation1 : applyRelation) {
addPrice = addPrice.add(applyRelation1.getAddCost());
applyRelation1.setAgreementId(apply.getAgreementId());
sltAgreementInfoMapper.insertApplyRelation(applyRelation1);
}
}
relation.setAddCost(addPrice);
int i = sltAgreementInfoMapper.insRelation(relation);
if (i > 0) {
return AjaxResult.success("结算成功");

View File

@ -5,4 +5,11 @@ spring:
name: sgzb-material
profiles:
# 环境配置
active: sgzb_cq_local
active: sgzb_nw_local
# Spring Boot Actuator V2中风险漏洞处理禁止远程端口访问
management:
endpoint:
env:
enabled: false

View File

@ -1193,4 +1193,25 @@
left join ma_type mt3 on mt2.parent_id = mt3.type_id
where lod.id = #{id}
</select>
<select id="getLeaseOutDetailRecord" resultType="com.bonus.sgzb.app.domain.TmTask">
SELECT
mt.type_name typeModelName,
mt2.type_name typeName,
mm.ma_code maCode,
lod.create_time createTime,
lod.out_num outNum,
su.nick_name userName
FROM
lease_out_details lod
LEFT JOIN ma_type mt ON lod.type_id = mt.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
LEFT JOIN ma_machine mm ON mm.ma_id = lod.ma_id
left join ma_type_keeper mtk on mtk.type_id = lod.type_id
left join sys_user su on mtk.user_id = su.user_id
WHERE
lod.parent_id = #{id} and lod.type_id = #{typeId}
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND lod.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if>
</select>
</mapper>

View File

@ -50,4 +50,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND iad.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if>
</select>
<select id="getOutputRecordList" resultType="com.bonus.sgzb.material.domain.OutRecord">
SELECT
lai.code,
bpl.lot_name,
bui.unit_name,
mt.type_name as typeModelName,
mt2.type_name as typeName,
mm.ma_code,
lod.create_time,
lod.out_num,
sd.name as maStauts
FROM
lease_out_details lod
LEFT JOIN lease_apply_info lai ON lod.parent_id = lai.id
LEFT JOIN tm_task tt ON tt.task_id = lai.task_id
LEFT JOIN tm_task_agreement tta ON tta.task_id = tt.task_id
LEFT JOIN bm_agreement_info bagi ON bagi.agreement_id = tta.agreement_id
LEFT JOIN bm_project_lot bpl ON bpl.lot_id = bagi.project_id
LEFT JOIN bm_unit_info bui ON bui.unit_id = bagi.unit_id
LEFT JOIN ma_type mt ON mt.type_id = lod.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
LEFT JOIN ma_machine mm ON mm.ma_id = lod.ma_id
LEFT JOIN sys_dic sd on mm.ma_status = sd.id
WHERE
1 = 1
<if test="code != null and code != ''">
and lai.code like concat('%',#{code},'%')
</if>
<if test="unitId != null">
and bui.unit_id = #{unitId}
</if>
<if test="lotId != null">
and bpl.lot_id = #{lotId}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND lod.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if>
<if test="keyWord != null and keyWord != ''">
and (mt2.type_name like concat('%',#{keyWord},'%') or
mt.type_name like concat('%',#{keyWord},'%') or
mm.ma_code like concat('%',#{keyWord},'%'))
</if>
</select>
</mapper>

View File

@ -122,5 +122,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY bai.agreement_id,
mt.type_id) AS subquery2 ON subquery1.type_id = subquery2.type_id
AND subquery1.agreement_id = subquery2.agreement_id
<if test="useFlag == 1">
WHERE IFNULL(subquery1.outNum, 0) - IFNULL(subquery2.backNum, 0) > 0
</if>
</select>
</mapper>

View File

@ -61,11 +61,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="partType != null">#{partType},</if>
</trim>
</insert>
<insert id="insertApplyRelation">
insert into slt_agreement_add_cost (cost_remark,add_cost,agreement_id)
values (#{costRemark},#{addCost},#{agreementId})
</insert>
<update id="updateInfoStatus">
update slt_agreement_info
set is_slt = '1',
slt_time = now(),
update_time = now(),
update_time = now()
where agreement_id = #{agreementId}
</update>
<update id="updateRelation">
@ -591,4 +595,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
group by sad.type_id,sad.ma_id,sad.scrap_type
</select>
<select id="getAddLoseList" resultType="com.bonus.sgzb.base.api.domain.ApplyRelation">
select cost_remark,add_cost,agreement_id from slt_agreement_add_cost where agreement_id = #{agreementId}
</select>
<select id="checkEndTime" resultType="com.bonus.sgzb.base.api.domain.SltAgreementInfo">
select sai.id,
sai.agreement_id as agreementId,
sai.type_id as typeId,
sai.ma_id as maId,
sai.is_slt as isSlt,
DATE(sai.end_time) as endTime
from slt_agreement_info sai
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.lease_type = 0
</select>
</mapper>