This commit is contained in:
mashuai 2025-04-27 15:03:45 +08:00
parent 38c6886c25
commit d29393b664
2 changed files with 35 additions and 39 deletions

View File

@ -72,7 +72,7 @@ public class MachineHistoryRecordBean {
private String leaseMan; private String leaseMan;
@ApiModelProperty(value = "领用时间") @ApiModelProperty(value = "领用时间")
@Excel(name = "领用时间") @Excel(name = "领用时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date leaseDate; private Date leaseDate;
@ -81,7 +81,7 @@ public class MachineHistoryRecordBean {
private String backMan; private String backMan;
@ApiModelProperty(value = "退料时间") @ApiModelProperty(value = "退料时间")
@Excel(name = "退料时间") @Excel(name = "退料时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date backDate; private Date backDate;

View File

@ -168,41 +168,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getMachineHistoryRecordList" resultType="com.bonus.material.basic.domain.MachineHistoryRecordBean"> <select id="getMachineHistoryRecordList" resultType="com.bonus.material.basic.domain.MachineHistoryRecordBean">
SELECT SELECT
bai.agreement_id as agreementId, bai.agreement_id as agreementId,
mt.type_id as typeId, mt.type_id as typeId,
bai.agreement_code AS agreementCode, bai.agreement_code AS agreementCode,
bui.unit_name AS unitName, bui.unit_name AS unitName,
bpl.pro_name AS proName, bpl.pro_name AS proName,
bpl.contract_part as contractPart, bpl.contract_part as contractPart,
sd.dept_name as impUnitName, sd.dept_name as impUnitName,
mt2.type_name AS typeName, mt2.type_name AS typeName,
mt.type_name AS typeModelName, mt.type_name AS typeModelName,
mt.unit_name AS unit, mt.unit_name AS unit,
lai.lease_person AS leaseMan, lai.lease_person AS leaseMan,
lod.create_time AS leaseDate, lai.create_time AS leaseDate,
mm.ma_code AS maCode, mm.ma_code AS maCode,
baif.back_person AS backMan, baif.back_person AS backMan,
bcd.create_time AS backDate, sai.end_time AS backDate,
CASE CASE
WHEN baif.back_person IS NULL THEN '在用' WHEN baif.back_person IS NULL THEN '在用'
ELSE '已退' ELSE '已退'
END AS statusName END AS statusName
FROM FROM
lease_out_details lod slt_agreement_info sai
LEFT JOIN lease_apply_info lai ON lai.id = lod.parent_id LEFT JOIN lease_apply_info lai ON lai.id = sai.lease_id
LEFT JOIN tm_task_agreement tta ON tta.task_id = lai.task_id LEFT JOIN bm_agreement_info bai ON bai.agreement_id = sai.agreement_id
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id
LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id LEFT JOIN sys_dept sd on sd.dept_id = bpl.imp_unit
LEFT JOIN sys_dept sd on sd.dept_id = bpl.imp_unit LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id LEFT JOIN ma_type mt ON mt.type_id = sai.type_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_type mt2 ON mt2.type_id = mt.parent_id LEFT JOIN ma_machine mm ON mm.ma_id = sai.ma_id
LEFT JOIN ma_machine mm ON mm.ma_id = lod.ma_id LEFT JOIN back_apply_info baif ON baif.id = sai.back_id
LEFT JOIN back_check_details bcd ON bcd.ma_id = lod.ma_id
LEFT JOIN back_apply_info baif ON baif.id = bcd.parent_id
WHERE WHERE
1 = 1 1 = 1
AND lod.ma_id IS NOT NULL AND sai.ma_id IS NOT NULL
<if test="keyWord != null and keyWord != ''"> <if test="keyWord != null and keyWord != ''">
and (bai.agreement_code like concat('%',#{keyWord},'%') or and (bai.agreement_code like concat('%',#{keyWord},'%') or
bui.unit_name like concat('%',#{keyWord},'%') or bui.unit_name like concat('%',#{keyWord},'%') or
@ -241,10 +239,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
END = #{statusName} END = #{statusName}
) )
</if> </if>
GROUP BY
mm.ma_code
ORDER BY ORDER BY
bcd.create_time sai.end_time
</select> </select>
<select id="getInputRecordList" resultType="com.bonus.material.basic.domain.InputRecordInfo"> <select id="getInputRecordList" resultType="com.bonus.material.basic.domain.InputRecordInfo">
@ -569,7 +565,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt2.type_name AS typeName, mt2.type_name AS typeName,
mt2.type_id AS thirdTypeId, mt2.type_id AS thirdTypeId,
mt.type_name AS typeModelName, mt.type_name AS typeModelName,
SUM(IF(sad.ledger_status = '0', IFNULL(sad.scrap_num, 0), 0)) AS pendingScrapNum, SUM(IF(sad.status IN ('0','1'), IFNULL(sad.scrap_num, 0), 0)) AS pendingScrapNum,
SUM(IF(sad.ledger_status = '1', IFNULL(sad.scrap_num, 0), 0)) AS scrapNum SUM(IF(sad.ledger_status = '1', IFNULL(sad.scrap_num, 0), 0)) AS scrapNum
FROM scrap_apply_details sad FROM scrap_apply_details sad
LEFT JOIN ma_type mt ON mt.type_id = sad.type_id LEFT JOIN ma_type mt ON mt.type_id = sad.type_id
@ -842,7 +838,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
LEFT JOIN ma_machine mm ON mm.ma_id = sad.ma_id LEFT JOIN ma_machine mm ON mm.ma_id = sad.ma_id
LEFT JOIN sys_user su ON sad.audit_by = su.user_id LEFT JOIN sys_user su ON sad.audit_by = su.user_id
WHERE sad.ledger_status = '0' WHERE sad.status IN ('0','1')
<if test="typeId != null"> <if test="typeId != null">
AND sad.type_id = #{typeId} AND sad.type_id = #{typeId}
</if> </if>