diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/CostPushBean.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/CostPushBean.java index 72e7ea8e..ff42cca6 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/CostPushBean.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/CostPushBean.java @@ -1,6 +1,7 @@ package com.bonus.material.push.domain; import com.bonus.common.core.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; @@ -29,6 +30,10 @@ public class CostPushBean implements java.io.Serializable { private String unitId; + @ApiModelProperty(value = "分公司") + @Excel(name = "分公司", sort = 0) + private String impUnitName; + @Excel(name = "工程名称", sort = 1) private String projectName; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/IwsCostPushBean.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/IwsCostPushBean.java index 925dca4f..b673502c 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/IwsCostPushBean.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/IwsCostPushBean.java @@ -28,6 +28,11 @@ public class IwsCostPushBean implements Serializable { private String id; private Long parentId; + + @ApiModelProperty(value = "分公司") + @Excel(name = "分公司", sort = 0) + private String impUnitName; + // 协议号 @Excel(name = "协议号", sort = 1) private String agreementCode; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/PartDetails.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/PartDetails.java index 6fb4adfc..36c22741 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/PartDetails.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/PartDetails.java @@ -27,6 +27,10 @@ public class PartDetails extends BaseEntity { */ private Long id; + @ApiModelProperty(value = "分公司") + @Excel(name = "分公司", sort = 1) + private String impUnitName; + /** * 任务ID */ diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/vo/RepairProjectInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/vo/RepairProjectInfo.java index 5f6a04e4..33a314af 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/vo/RepairProjectInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/vo/RepairProjectInfo.java @@ -25,6 +25,10 @@ public class RepairProjectInfo extends BaseEntity { /** $column.columnComment */ private Long id; + @ApiModelProperty(value = "分公司") + @Excel(name = "分公司") + private String impUnitName; + /** 维修时间 */ @Excel(name = "维修时间", width = 20) @ApiModelProperty(value = "维修时间") diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/vo/TestRecord.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/vo/TestRecord.java index 7e6deef9..520845ba 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/vo/TestRecord.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/repair/domain/vo/TestRecord.java @@ -12,6 +12,11 @@ import java.util.Date; public class TestRecord implements Serializable { private String id; + + @ApiModelProperty(value = "分公司") + @Excel(name = "分公司") + private String impUnitName; + /** * 退回单位名称 */ diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java index 6e47670a..31be7f5d 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java @@ -27,6 +27,10 @@ public class SltAgreementInfo extends BaseEntity { /** ID */ private Long id; + @ApiModelProperty(value = "分公司") + @Excel(name = "分公司") + private String impUnitName; + /** 协议id */ @Excel(name = "协议id") @ApiModelProperty(value = "协议id") diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementReduce.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementReduce.java index 91d1dc71..55761262 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementReduce.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementReduce.java @@ -33,6 +33,10 @@ public class SltAgreementReduce extends BaseEntity { @ApiModelProperty(value = "协议id") private Long agreementId; + @ApiModelProperty(value = "分公司") + @Excel(name = "分公司", sort = 1) + private String impUnitName; + private List agreementIds; /** 结算单号(例如:JM202402-1) */ diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementReduceRecord.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementReduceRecord.java index c569918b..0fe67e19 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementReduceRecord.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementReduceRecord.java @@ -32,6 +32,10 @@ public class SltAgreementReduceRecord { @ApiModelProperty(value = "创建人") private String creator; + @ApiModelProperty(value = "分公司") + @Excel(name = "分公司") + private String impUnitName; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "创建时间") @Excel(name = "申请时间", sort = 1, dateFormat = "yyyy-MM-dd HH:mm:ss", width = 30) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/PeriodCostResultVo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/PeriodCostResultVo.java index 19d1e08e..1aea7501 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/PeriodCostResultVo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/PeriodCostResultVo.java @@ -20,6 +20,9 @@ public class PeriodCostResultVo { @ApiModelProperty(value = "协议ID") private Long agreementId; + @ApiModelProperty(value = "分公司") + private String impUnitName; + @ApiModelProperty(value = "协议编号") private String agreementCode; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/PeriodCostSummaryVo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/PeriodCostSummaryVo.java index 243b0ec0..4b32ddee 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/PeriodCostSummaryVo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/PeriodCostSummaryVo.java @@ -22,6 +22,10 @@ public class PeriodCostSummaryVo { @ApiModelProperty(value = "协议ID") private Long agreementId; + @ApiModelProperty(value = "分公司") + @Excel(name = "分公司") + private String impUnitName; + @ApiModelProperty(value = "协议编号") @Excel(name = "协议编号") private String agreementCode; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltInfoVo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltInfoVo.java index 07336559..d80cf113 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltInfoVo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltInfoVo.java @@ -22,6 +22,10 @@ import java.util.List; @Accessors(chain = true) public class SltInfoVo { + @ApiModelProperty(value = "分公司") + @Excel(name = "分公司") + private String impUnitName; + /** * 结算单位 */ 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 79478ebc..fe4bf0f4 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 @@ -263,6 +263,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { @Override public SltInfoVo getSltInfoReportBatch(SltAgreementInfo info) { SltInfoVo sltInfoVo = new SltInfoVo(); + sltInfoVo.setImpUnitName(info.getImpUnitName()); sltInfoVo.setUnitName(info.getUnitName()); sltInfoVo.setProjectName(info.getProjectName()); BigDecimal leaseCost = BigDecimal.ZERO, repairCost= BigDecimal.ZERO ; @@ -1753,6 +1754,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { PeriodCostSummaryVo summary = new PeriodCostSummaryVo(); summary.setAgreementId(agreementId); summary.setAgreementCode(firstDetail.getAgreementCode()); + summary.setImpUnitName(firstDetail.getImpUnitName()); summary.setUnitId(firstDetail.getUnitId()); summary.setUnitName(firstDetail.getUnitName()); summary.setProjectId(firstDetail.getProjectId()); diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialLeaseInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialLeaseInfoMapper.xml index 5ca960de..ca098aa1 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialLeaseInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialLeaseInfoMapper.xml @@ -529,7 +529,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and ( lai.create_by like concat('%',#{keyWord},'%') or bp.pro_name like concat('%',#{keyWord},'%') or - lai.lease_person like concat('%',#{keyWord},'%') + lai.lease_person like concat('%',#{keyWord},'%') or + lai.code like concat('%',#{keyWord},'%') ) and tt.task_status = #{taskStatus} diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/push/IwsCostPushMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/push/IwsCostPushMapper.xml index e4f4df8a..93ca3e19 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/push/IwsCostPushMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/push/IwsCostPushMapper.xml @@ -10,10 +10,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bu.unit_name AS unitName, bma.agreement_id AS agreementId,bma.`agreement_code` AS agreementCode, bma.sign_time AS signTime, bma.is_push AS isPush, IF(saa.audit_time IS NULL,0,1) AS isSettlement, saa.audit_time AS settlementTime, - IF(saas.audit_time IS NULL,0,1) AS safetyIsSettlement, saas.audit_time AS safetySettlementTime + IF(saas.audit_time IS NULL,0,1) AS safetyIsSettlement, saas.audit_time AS safetySettlementTime, + sd.dept_name AS impUnitName FROM bm_agreement_info bma LEFT JOIN bm_project bp ON bp.pro_id = bma.project_id + LEFT JOIN sys_dept sd on sd.dept_id = bp.imp_unit LEFT JOIN bm_unit bu ON bu.unit_id = bma.unit_id LEFT JOIN slt_agreement_apply saa ON saa.agreement_id = bma.agreement_id AND saa.`status` = '2' AND saa.settlement_type = 1 LEFT JOIN slt_agreement_apply saas ON saas.agreement_id = bma.agreement_id AND saas.`status` = '2' AND saas.settlement_type = 2 @@ -52,12 +54,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ifnull( pmc.LEASE_MONEY, 0 )+ ifnull( pmc.LOST_MONEY, 0 )+ ifnull( pmc.REPAIR_MONEY, 0 )+ ifnull( pmc.SCRAP_MONEY, 0 ), 2 ) AS money, a.pushStatus AS pushStatus, - a.pushRemark AS pushRemark + a.pushRemark AS pushRemark, + sd.dept_name AS impUnitName FROM project_month_costs pmc LEFT JOIN calc_project_month cpm on pmc.task_id = cpm.id LEFT JOIN bm_agreement_info bma ON pmc.AGREEMENT_ID = bma.agreement_id LEFT JOIN bm_project bp ON bp.pro_id = bma.project_id + LEFT JOIN sys_dept sd on sd.dept_id = bp.imp_unit LEFT JOIN bm_unit bu ON bu.unit_id = bma.unit_id LEFT JOIN ( @@ -130,6 +134,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND pmc.TYPE = #{settlementType} + + AND sd.dept_name = #{impUnitName} + GROUP BY pmc.AGREEMENT_ID, pmc.TYPE diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/push/MybatisGenerator.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/push/MybatisGenerator.xml index 617877b2..ea2a59c1 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/push/MybatisGenerator.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/push/MybatisGenerator.xml @@ -24,13 +24,15 @@ a.pushStatus as pushStatus, a.pushRemark as pushRemark, ROUND(ifnull(pmc.LEASE_MONEY,0)+ifnull(pmc.LOST_MONEY,0)+ifnull(pmc.SCRAP_MONEY,0),2) as money, - pmc.CHECK_STATUS as checkStatus + pmc.CHECK_STATUS as checkStatus, + sd.dept_name AS impUnitName from project_month_costs pmc LEFT JOIN bm_agreement_info bai ON bai.agreement_id = pmc.AGREEMENT_ID LEFT JOIN calc_project_month cpm on pmc.task_id=cpm.id LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id + LEFT JOIN sys_dept sd on sd.dept_id = bp.imp_unit LEFT JOIN ( SELECT pmi.agreementId,pmi.id,pmi.push_status as pushStatus, @@ -102,13 +104,15 @@ pmia.push_status AS pushStatus, pmia.push_remark AS pushRemark, ifnull( pmc.CONSUME_MONEY, 0 ) AS leaseMoney, - pmc.CHECK_STATUS AS checkStatus + pmc.CHECK_STATUS AS checkStatus, + sd.dept_name AS impUnitName FROM project_month_costs pmc LEFT JOIN bm_agreement_info bai ON bai.agreement_id = pmc.AGREEMENT_ID LEFT JOIN calc_project_month cpm ON pmc.task_id = cpm.id LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id + LEFT JOIN sys_dept sd on sd.dept_id = bp.imp_unit LEFT JOIN ( SELECT pmi.type, diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/record/DerateRecordQueryMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/record/DerateRecordQueryMapper.xml index e9103be1..35cc82f7 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/record/DerateRecordQueryMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/record/DerateRecordQueryMapper.xml @@ -14,13 +14,15 @@ SUM(srd.lease_price * srd.num) as leasePrice, SUM(srd.lease_money) as leaseMoney, swr.workflow_status as status, - a.leaseMoneyAll as leaseMoneyAll + a.leaseMoneyAll as leaseMoneyAll, + sd.dept_name AS impUnitName FROM slt_reduce_apply sra LEFT JOIN slt_reduce_details srd on sra.id=srd.apply_id LEFT JOIN sys_user su on su.user_id=sra.creator LEFT JOIN bm_agreement_info bai on bai.agreement_id=sra.agreement_id LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id + LEFT JOIN sys_dept sd on sd.dept_id = bp.imp_unit LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id LEFT JOIN sys_workflow_record swr ON swr.task_id = sra.id LEFT JOIN @@ -129,13 +131,15 @@ swrs.node_id AS nodeId, swrs.next_node_id AS nextNodeId, swrs.record_id AS recordId, - swn.node_sign_type as nodeSignType + swn.node_sign_type as nodeSignType, + sd.dept_name as impUnitName FROM slt_reduce_apply sra LEFT JOIN slt_reduce_details srd on sra.id=srd.apply_id LEFT JOIN sys_user su on su.user_id=sra.creator LEFT JOIN bm_agreement_info bai on bai.agreement_id=sra.agreement_id LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id + LEFT JOIN sys_dept sd on sd.dept_id = bp.imp_unit LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id LEFT JOIN sys_workflow_record swr on sra.id = swr.task_id LEFT JOIN sys_workflow_type swt on swr.workflow_id = swt.id diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/record/SltRecordQueryMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/record/SltRecordQueryMapper.xml index 5434aee2..712f9256 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/record/SltRecordQueryMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/record/SltRecordQueryMapper.xml @@ -15,12 +15,14 @@ bai.agreement_code AS agreementCode, saa.cost AS costs, saa.`status`, - saa.remark + saa.remark, + sd.dept_name AS impUnitName FROM slt_agreement_apply saa LEFT JOIN sys_user su on su.user_id = saa.creator and su.del_flag = 0 LEFT JOIN bm_agreement_info bai on bai.agreement_id = saa.agreement_id LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id + LEFT JOIN sys_dept sd on sd.dept_id = bp.imp_unit WHERE saa.status in ('1', '2', '3') @@ -31,7 +33,8 @@ bui.unit_name LIKE concat('%', #{keyWord}, '%') or bp.pro_name LIKE concat('%', #{keyWord}, '%') or bai.agreement_code LIKE concat('%', #{keyWord}, '%') or - saa.remark LIKE concat('%', #{keyWord}, '%') + saa.remark LIKE concat('%', #{keyWord}, '%') or + sd.dept_name LIKE concat('%', #{keyWord}, '%') ) diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairMapper.xml index 77bedef0..728b595e 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/repair/RepairMapper.xml @@ -1200,7 +1200,8 @@ mt2.type_name AS typeName, mt1.type_name AS typeModelName, rad.create_time AS repairTime , - mm.ma_code AS maCode + mm.ma_code AS maCode, + sd.dept_name AS impUnitName FROM repair_apply_details rad LEFT JOIN repair_audit_details rd ON rad.id = rd.repair_id @@ -1210,6 +1211,7 @@ AND bagi.`status` = '1' LEFT JOIN bm_project bp ON bp.pro_id = bagi.project_id AND bp.del_flag = '0' + left join sys_dept sd on sd.dept_id = bp.imp_unit LEFT JOIN bm_unit bu ON bu.unit_id = bagi.unit_id AND bu.del_flag = '0' LEFT JOIN ma_type mt1 ON mt1.type_id = rad.type_id @@ -1229,6 +1231,9 @@ and bp.pro_id = #{proId} + + AND sd.dept_name = #{impUnitName} + and mt2.type_name like CONCAT('%', #{typeName}, '%') @@ -1473,7 +1478,8 @@ subquery2.taskCode AS repairCode, subquery2.unitName AS backUnitName, subquery2.proName AS backProjectName, - subquery2.createTime AS repairTime + subquery2.createTime AS repairTime, + subquery2.impUnitName AS impUnitName FROM ma_type mt LEFT JOIN ( SELECT @@ -1486,7 +1492,8 @@ tt.code AS taskCode, bu.unit_name AS unitName, bp.pro_name AS proName, - tt.create_time AS createTime + tt.create_time AS createTime, + sd.dept_name AS impUnitName FROM repair_apply_details rad LEFT JOIN ma_type mt ON mt.type_id = rad.type_id LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id @@ -1496,6 +1503,7 @@ LEFT JOIN tm_task_agreement tta ON tt.task_id = tta.task_id LEFT JOIN bm_agreement_info bai ON tta.agreement_id = bai.agreement_id LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id + LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id WHERE tt.task_status IN (0, 4) and tt.code is not null @@ -1516,11 +1524,15 @@ OR subquery2.proName like concat('%', #{keyWord}, '%') OR mt2.type_name like concat('%', #{keyWord}, '%') OR mt.type_name like concat('%', #{keyWord}, '%') + OR subquery2.impUnitName like concat('%', #{keyWord}, '%') ) + + and subquery2.impUnitName LIKE CONCAT('%', #{impUnitName}, '%') + GROUP BY mt.type_id, subquery2.taskCode @@ -1612,7 +1624,8 @@ rpd.part_num as partNum, COALESCE(IFNULL(rpd.part_num,0) * IFNULL(mpt1.buy_price,0),0) as partCost, IFNULL(rpd.part_type,0) as partType, - COALESCE(su.nick_name, rpd.create_by) as createBy + COALESCE(su.nick_name, rpd.create_by) as createBy, + sd.dept_name as impUnitName from repair_part_details rpd left join tm_task tt on rpd.task_id = tt.task_id @@ -1620,6 +1633,7 @@ left join bm_agreement_info bai on tta.agreement_id = bai.agreement_id left join bm_unit bu on bu.unit_id = bai.unit_id left join bm_project bp on bp.pro_id = bai.project_id + left join sys_dept sd on sd.dept_id = bp.imp_unit left join ma_type mt1 on mt1.type_id = rpd.type_id left join ma_type mt2 on mt2.type_id = mt1.parent_id left join ma_machine mm on mm.ma_id = rpd.ma_id and mt1.manage_type = 0 @@ -1653,6 +1667,9 @@ AND bp.pro_id = #{projectId} + + and sd.dept_name LIKE CONCAT('%', #{impUnitName}, '%') + order by rpd.create_time desc @@ -933,10 +943,12 @@ CASE WHEN bp.actual_end_date is not null THEN '1' ELSE '0' - END as isFinish + END as isFinish, + sd.dept_name AS impUnitName FROM bm_agreement_info bai INNER JOIN bm_unit bui ON bui.unit_id = bai.unit_id AND bui.type_id != '1731' LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id + LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit LEFT JOIN slt_agreement_apply saa ON saa.agreement_id = bai.agreement_id AND (saa.status IS NULL OR saa.status != '2') WHERE bai.status = '1' AND (bai.is_slt = '0' OR bai.is_slt IS NULL) @@ -1083,12 +1095,14 @@ case rc.part_type when '0' then '不收费' when '1' then '收费' else '' end as partType, case rc.repair_type when '1' then '内部维修' when '2' then '返厂维修' else '' end as repairType, rc.company_id as companyId, - case rc.status when '0' then '未审核' when '1' then '已审核' when '2' then '已驳回' else '' end as repairStatus + case rc.status when '0' then '未审核' when '1' then '已审核' when '2' then '已驳回' else '' end as repairStatus, + sd.dept_name AS impUnitName from repair_cost rc left join tm_task_agreement tta on rc.task_id = tta.task_id left join tm_task tt on rc.task_id = tt.task_id left join bm_agreement_info bai on tta.agreement_id = bai.agreement_id left join bm_project bp ON bp.pro_id = bai.project_id + LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit 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 @@ -1111,6 +1125,9 @@ and bai.agreement_code like concat('%',#{info.agreementCode},'%') + + AND sd.dept_name = #{info.impUnitName} +