diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseTaskController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseTaskController.java index 2d26ab91..3865b64f 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseTaskController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseTaskController.java @@ -85,8 +85,8 @@ public class LeaseTaskController extends BaseController { @ApiOperation(value = "领用记录列表查询") @GetMapping("/list") public AjaxResult list(LeaseApplyInfo leaseApplyInfo) { - Long deptId = typeService.getUserDeptId(); - leaseApplyInfo.setCompanyId(deptId); +// Long deptId = typeService.getUserDeptId(); +// leaseApplyInfo.setCompanyId(deptId); Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); try { @@ -371,8 +371,8 @@ public class LeaseTaskController extends BaseController { Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); try { - Long deptId = typeService.getUserDeptId(); - leaseApplyInfo.setCompanyId(deptId); +// Long deptId = typeService.getUserDeptId(); +// leaseApplyInfo.setCompanyId(deptId); List list = service.selectAuditLeaseApplyInfoList(leaseApplyInfo); if (leaseApplyInfo.getIsApp()==null){ return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmReportMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmReportMapper.xml index 44046490..8ab3f7f8 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmReportMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmReportMapper.xml @@ -41,14 +41,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) a ON pcd.task_id = a.task_id AND pcd.type_id = a.type_id LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id - LEFT JOIN ma_type_manage mtm ON mt4.type_id = mtm.type_id + WHERE tt.task_type = 0 - - and mtm.user_id = #{userId} - + - and pcd.company_id=#{companyId} + and mt1.company_id=#{companyId} AND ( diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml index 886b0d08..f9b25a8a 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/ComplexQueryMapper.xml @@ -456,7 +456,7 @@ AND sai.end_time IS NULL AND sai.back_id IS NULL - AND sai.company_id = #{companyId} + AND mt.company_id = #{companyId} GROUP BY mt.type_id ) AS subquery1 @@ -483,7 +483,7 @@ tt.task_status IN (0, 4) and tt.code is not null - AND rad.company_id = #{companyId} + AND mt.company_id = #{companyId} GROUP BY mt.type_id) AS subquery2 ON subquery2.type_id = mt.type_id @@ -508,7 +508,7 @@ tt.code is not null and rad.`status` = '0' - AND rad.company_id = #{companyId} + AND mt.company_id = #{companyId} GROUP BY mt.type_id) AS subquery12 ON subquery12.type_id = mt.type_id @@ -533,7 +533,7 @@ WHERE IFNULL(rid.repair_num, 0) - IFNULL(rid.input_num, 0) - IFNULL(rid.reject_num, 0) > 0 and tt.task_status = 0 - AND rid.company_id = #{companyId} + AND mt.company_id = #{companyId} GROUP BY mt.type_id) AS subquery3 ON subquery3.type_id = mt.type_id @@ -557,7 +557,7 @@ WHERE IFNULL(pcd.check_num, 0) - IFNULL(pcd.input_num, 0) > 0 and pcd.status in (3,4, 13,14) - AND pcd.company_id = #{companyId} + AND mt.company_id = #{companyId} GROUP BY mt.type_id) AS subquery4 ON subquery4.type_id = mt.type_id @@ -1060,30 +1060,31 @@ FROM ( SELECT - type_id, - ma_id, - lease_id, - agreement_id, - SUM( num ) AS usNum + sa.type_id, + sa.ma_id, + sa.lease_id, + sa. agreement_id, + SUM( sa.num ) AS usNum FROM - slt_agreement_info + slt_agreement_info sa + LEFT JOIN ma_type mt ON mt.type_id = sa.type_id WHERE - `status` = '0' - AND end_time IS NULL - AND back_id IS NULL - AND `is_slt` = '0' and source =1 + sa.`status` = '0' + AND sa.end_time IS NULL + AND sa.back_id IS NULL + AND sa.`is_slt` = '0' and sa.source =1 - AND type_id = #{typeId} + AND sa.type_id = #{typeId} - AND company_id = #{companyId} + AND mt.company_id = #{companyId} GROUP BY - type_id, - ma_id, - lease_id, - agreement_id + sa.type_id, + sa.ma_id, + sa.lease_id, + sa.agreement_id ) AS sai_agg LEFT JOIN ma_type mt ON mt.type_id = sai_agg.type_id LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id @@ -1760,9 +1761,7 @@ #{item} - - and lod.company_id= #{companyId} - + GROUP BY lod.parent_id diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml index 50738fdb..ed8b8783 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml @@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND bu.type_id = #{typeId} - AND bu.dept_id = #{companyId} + AND bu.company_id = #{companyId} @@ -79,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND bu.type_id = #{typeId} - AND bu.dept_id = #{companyId} + AND bu.company_id = #{companyId} UNION @@ -114,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND bu.type_id = #{typeId} - AND bu.dept_id = #{companyId} + AND bu.company_id = #{companyId} ) ff ORDER BY diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml index dddb6ecc..94349329 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml @@ -166,7 +166,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND mt.jiju_type = #{jiJuTypeStr} - and ma.company_id = #{companyId} + and mt.company_id = #{companyId} ) a where diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/warningAnalysis/UseMaintenanceWarningMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/warningAnalysis/UseMaintenanceWarningMapper.xml index 61759c9f..f6aa9b96 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/warningAnalysis/UseMaintenanceWarningMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/warningAnalysis/UseMaintenanceWarningMapper.xml @@ -251,7 +251,7 @@ and sai.`status`='0' AND mt2.type_id not in (6032,6008,6270) - AND sd.dept_id=#{companyId} + AND mt.company_id=#{companyId} /*AND DATEDIFF(mm.next_check_time, CURDATE()) <= 30*/