diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/HandlingOrder.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/HandlingOrder.java index b345c3ca..c1f17de6 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/HandlingOrder.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/domain/HandlingOrder.java @@ -81,4 +81,6 @@ public class HandlingOrder implements Serializable { private String signUrl; + private Long companyId; + } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java index 74122b4d..e5e473b2 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/back/service/impl/BackApplyInfoServiceImpl.java @@ -34,6 +34,7 @@ import com.bonus.material.common.domain.vo.AgreementVo; import com.bonus.material.common.mapper.SelectMapper; import com.bonus.material.lease.mapper.LeaseApplyInfoMapper; import com.bonus.material.ma.mapper.MachineMapper; +import com.bonus.material.ma.service.ITypeService; import com.bonus.material.purchase.config.RemoteConfig; import com.bonus.material.settlement.domain.SltAgreementInfo; import com.bonus.material.settlement.mapper.SltAgreementInfoMapper; @@ -96,6 +97,9 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService { @Resource private BmUnitMapper bmUnitMapper; + @Resource + private ITypeService iTypeService; + /** * 查询退料任务 - 性能优化版 * @@ -2215,6 +2219,11 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService { try { Long userId = SecurityUtils.getLoginUser().getUserid(); bean.setCreateBy(userId.toString()); + /** + * jsk + */ + Long companyId=iTypeService.getUserDeptId(); + bean.setCompanyId(companyId); int re = backApplyInfoMapper.addHandlingOrder(bean); if (re>0){ return AjaxResult.success("添加成功"); @@ -2229,6 +2238,11 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService { @Override public List getHandlingOrderList(HandlingOrder bean) { + /** + * jsk + */ + Long companyId=iTypeService.getUserDeptId(); + bean.setCompanyId(companyId); List list = backApplyInfoMapper.getHandlingOrderList(bean); if (list.size()>0){ for (HandlingOrder handlingOrder : list){ diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/ComplexQueryController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/ComplexQueryController.java index 32155341..c6469649 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/ComplexQueryController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/ComplexQueryController.java @@ -18,6 +18,7 @@ import com.bonus.material.basic.domain.vo.MaTypeSelectInfo; import com.bonus.material.basic.service.ComplexQueryService; import com.bonus.material.common.annotation.PreventRepeatSubmit; import com.bonus.material.ma.domain.Type; +import com.bonus.material.ma.service.ITypeService; import com.bonus.material.part.domain.PartInventory; import com.bonus.material.push.domain.MachineInfoBean; import com.bonus.material.push.domain.MachineInfoExport; @@ -43,6 +44,9 @@ public class ComplexQueryController extends BaseController { @Resource private ComplexQueryService complexQueryService; + @Resource + private ITypeService typeService; + /** * 保有设备总量查询 * @param bean @@ -53,6 +57,8 @@ public class ComplexQueryController extends BaseController { public AjaxResult getRetainedEquipmentList(RetainedEquipmentInfo bean) { bean.setIsExport(1); bean.setUserId(SecurityUtils.getLoginUser().getUserid()); + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(Math.toIntExact(deptId)); if (bean.getIsApp() != null && bean.getIsApp() == 1) { List pageList = complexQueryService.getRetainedEquipmentList(bean); return AjaxResult.success(pageList); @@ -72,6 +78,8 @@ public class ComplexQueryController extends BaseController { public AjaxResult getRetainedEquipmentListNoPage(RetainedEquipmentInfo bean) { bean.setIsExport(0); bean.setUserId(SecurityUtils.getLoginUser().getUserid()); + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(Math.toIntExact(deptId)); List list = complexQueryService.getRetainedEquipmentList(bean); RetainedEquipmentInfo dto = new RetainedEquipmentInfo(); if (CollectionUtils.isNotEmpty(list)) { @@ -105,6 +113,8 @@ public class ComplexQueryController extends BaseController { { bean.setUserId(SecurityUtils.getLoginUser().getUserid()); bean.setIsExport(0); + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(Math.toIntExact(deptId)); List list = complexQueryService.getRetainedEquipmentList(bean); ExcelUtil util = new ExcelUtil<>(RetainedEquipmentInfo.class); util.exportExcel(response, list, "综合查询--保有设备总量查询"); @@ -147,6 +157,8 @@ public class ComplexQueryController extends BaseController { public AjaxResult getUserRecords(UseStorageInfo bean) { Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(deptId); List list = complexQueryService.getUserRecords(bean); return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); } @@ -159,6 +171,8 @@ public class ComplexQueryController extends BaseController { @ApiOperation(value = "综合查询--导出在用设备详情") @PostMapping("/exportUserRecordList") public void exportUserRecordList(HttpServletResponse response, UseStorageInfo bean) { + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(deptId); List list = complexQueryService.getUserRecords(bean); ExcelUtil util = new ExcelUtil<>(UseStorageInfo.class); util.exportExcel(response, list, "综合查询--导出在用设备详情"); @@ -174,6 +188,8 @@ public class ComplexQueryController extends BaseController { public AjaxResult getRepairRecordList(RepairStorageInfo bean) { Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(deptId); List list = complexQueryService.getRepairRecordList(bean); return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); } @@ -186,6 +202,8 @@ public class ComplexQueryController extends BaseController { @ApiOperation(value = "综合查询--导出在修设备详情") @PostMapping("/exportRepairRecordList") public void exportRepairRecordList(HttpServletResponse response, RepairStorageInfo bean) { + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(deptId); List list = complexQueryService.getRepairRecordList(bean); ExcelUtil util = new ExcelUtil<>(RepairStorageInfo.class); util.exportExcel(response, list, "综合查询--导出在修设备详情"); @@ -200,6 +218,8 @@ public class ComplexQueryController extends BaseController { @GetMapping("/getPurchaseRecordList") public AjaxResult getPurchaseRecordList(PurchaseInputInfo bean) { startPage(); + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(deptId); List list = complexQueryService.getPurchaseRecordList(bean); return AjaxResult.success(getDataTable(list)); } @@ -212,6 +232,8 @@ public class ComplexQueryController extends BaseController { @ApiOperation(value = "综合查询--导出新购待入库详情") @PostMapping("/exportPurchaseRecordList") public void exportPurchaseRecordList(HttpServletResponse response, PurchaseInputInfo bean) { + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(deptId); List list = complexQueryService.getPurchaseRecordList(bean); ExcelUtil util = new ExcelUtil<>(PurchaseInputInfo.class); util.exportExcel(response, list, "综合查询--导出新购待入库详情"); @@ -226,6 +248,8 @@ public class ComplexQueryController extends BaseController { @GetMapping("/getRepairInputList") public AjaxResult getRepairInputList(RepairInputRecord bean) { startPage(); + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(deptId); List list = complexQueryService.getRepairInputList(bean); return AjaxResult.success(getDataTable(list)); } @@ -238,6 +262,8 @@ public class ComplexQueryController extends BaseController { @ApiOperation(value = "综合查询--导出修饰待入库详情") @PostMapping("/exportRepairInputList") public void exportRepairInputList(HttpServletResponse response, RepairInputRecord bean) { + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(deptId); List list = complexQueryService.getRepairInputList(bean); ExcelUtil util = new ExcelUtil<>(RepairInputRecord.class); util.exportExcel(response, list, "综合查询--导出修饰待入库详情"); @@ -358,6 +384,8 @@ public class ComplexQueryController extends BaseController { public AjaxResult getMachineHistoryRecordList(MachineHistoryRecordBean bean) { bean.setUserId(SecurityUtils.getLoginUser().getUserid()); startPage(); + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(deptId); List list = complexQueryService.getMachineHistoryRecordList(bean); return AjaxResult.success(getDataTable(list)); } @@ -372,6 +400,8 @@ public class ComplexQueryController extends BaseController { public void exportMachineHistoryRecord(HttpServletResponse response, MachineHistoryRecordBean bean) { bean.setUserId(SecurityUtils.getLoginUser().getUserid()); + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(deptId); List list = complexQueryService.getMachineHistoryRecordList(bean); ExcelUtil util = new ExcelUtil<>(MachineHistoryRecordBean.class); util.exportExcel(response, list, "综合查询--设备使用追溯查询"); @@ -385,6 +415,8 @@ public class ComplexQueryController extends BaseController { public AjaxResult getInputRecordList(InputRecordInfo bean) { Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(deptId); List list = complexQueryService.getInputRecordList(bean); return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); } @@ -398,6 +430,8 @@ public class ComplexQueryController extends BaseController { @PostMapping("/exportInputRecord") public void exportInputRecord(HttpServletResponse response, InputRecordInfo bean) { + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(deptId); List list = complexQueryService.getInputRecordList(bean); ExcelUtil util = new ExcelUtil<>(InputRecordInfo.class); util.exportExcel(response, list, "综合查询--机具入库查询"); @@ -413,6 +447,8 @@ public class ComplexQueryController extends BaseController { public AjaxResult getOutRecordList(OutRecordInfo bean) { Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(deptId); List list = complexQueryService.getOutRecordList(bean); return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); } @@ -421,6 +457,8 @@ public class ComplexQueryController extends BaseController { @PostMapping("/exportOutRecord") public void exportOutRecord(HttpServletResponse response, OutRecordInfo bean) { + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(deptId); List list = complexQueryService.getOutRecordList(bean); ExcelUtil util = new ExcelUtil<>(OutRecordInfo.class); util.exportExcel(response, list, "综合查询--机具出库查询"); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/InputRecordInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/InputRecordInfo.java index 1159b0b5..5a11ed97 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/InputRecordInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/InputRecordInfo.java @@ -82,4 +82,7 @@ public class InputRecordInfo { @ApiModelProperty(value = "装备管理方式") private String manageType; + @ApiModelProperty(value = "组织id") + private Long companyId; + } \ No newline at end of file diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/MachineHistoryRecordBean.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/MachineHistoryRecordBean.java index e2240d68..72821e16 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/MachineHistoryRecordBean.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/MachineHistoryRecordBean.java @@ -109,4 +109,7 @@ public class MachineHistoryRecordBean { private String keyWord; private Long userId; + + @ApiModelProperty(value = "组织id") + private Long companyId; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/OutRecordInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/OutRecordInfo.java index bd3973ea..9db7c170 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/OutRecordInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/OutRecordInfo.java @@ -109,4 +109,7 @@ public class OutRecordInfo { @ApiModelProperty(value = "一级ID集合") private List firstTypeIdList; + + @ApiModelProperty(value = "组织id") + private Long companyId; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/PurchaseInputInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/PurchaseInputInfo.java index b4706d89..b532e0c3 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/PurchaseInputInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/PurchaseInputInfo.java @@ -65,4 +65,7 @@ public class PurchaseInputInfo { private String keyWord; private String manageType; + + @ApiModelProperty(value = "组织id") + private Long companyId; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/RepairInputRecord.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/RepairInputRecord.java index 9e4adece..f74abe47 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/RepairInputRecord.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/RepairInputRecord.java @@ -64,4 +64,7 @@ public class RepairInputRecord { @ApiModelProperty(value = "关键字") private String keyWord; + + @ApiModelProperty(value = "组织id") + private Long companyId; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/RepairStorageInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/RepairStorageInfo.java index bfc21a60..638a41b4 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/RepairStorageInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/RepairStorageInfo.java @@ -70,4 +70,7 @@ public class RepairStorageInfo { @ApiModelProperty(value = "维修类型 1 定损 2 在修 3 修试待审核") private Integer type; + + @ApiModelProperty(value = "组织id") + private Long companyId; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/UseStorageInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/UseStorageInfo.java index 9b37ade0..c688d1a8 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/UseStorageInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/UseStorageInfo.java @@ -70,4 +70,7 @@ public class UseStorageInfo { @ApiModelProperty(value = "关键字") private String keyWord; + + @ApiModelProperty(value = "组织id") + private Long companyId; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/ComplexQueryServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/ComplexQueryServiceImpl.java index d63050d6..524a5bb2 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/ComplexQueryServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/ComplexQueryServiceImpl.java @@ -656,6 +656,11 @@ public class ComplexQueryServiceImpl implements ComplexQueryService { @Override public List getStatisticsList(ProjUsingRecord bean) { try { + /** + * jsk + */ + Long companyId=iTypeService.getUserDeptId(); + bean.setCompanyId(companyId.intValue()); // 1、查询工程对应的物资名称、型号、需求数量、已供数量 List list = complexQueryMapper.getStatisticsList(bean); @@ -876,6 +881,11 @@ public class ComplexQueryServiceImpl implements ComplexQueryService { */ @Override public List getFinishNoReturnList(MachineInfoBean bean) { + /** + * jsk + */ + Long companyId=iTypeService.getUserDeptId(); + bean.setCompanyId(companyId); return complexQueryMapper.getFinishNoReturnList(bean); } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java index 509f01e0..ba28a879 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java @@ -608,6 +608,8 @@ public class SelectServiceImpl implements SelectService { */ @Override public List getImpUnitNameList(MaterialRetainedEquipmentInfo bean) { + Long companyId=typeService.getUserDeptId(); + bean.setCompanyId(companyId.intValue()); return mapper.getImpUnitNameList(bean); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/service/impl/ExpectationsServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/service/impl/ExpectationsServiceImpl.java index 8d321c95..540913ac 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/service/impl/ExpectationsServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/service/impl/ExpectationsServiceImpl.java @@ -10,10 +10,7 @@ import org.apache.commons.lang3.ObjectUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; @Slf4j @Service @@ -59,12 +56,22 @@ public class ExpectationsServiceImpl implements ExpectationsService { @Override public AjaxResult getCountExpectations(ExpectationsEntity entity) { try { + /** + * jsk + */ + Long companyId=iTypeService.getUserDeptId(); + entity.setCompanyId(companyId); Map countExpectations = mapper.getCountExpectations(entity); if (entity != null && "2".equals(entity.getUseStatus())) { //在用设备量 countExpectations = mapper.getUseCountExpectations(entity); } - return ObjectUtils.isNotEmpty(countExpectations) ? AjaxResult.success(countExpectations) : AjaxResult.error(); + Map map=new HashMap<>(); + if(!ObjectUtils.isNotEmpty(countExpectations)){ + map.put("expired","0"); + map.put("aboutToExpire","0"); + } + return ObjectUtils.isNotEmpty(countExpectations) ? AjaxResult.success(countExpectations) : AjaxResult.success(map); }catch (Exception e) { log.error(e.getMessage()); return AjaxResult.error(); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/MachineInfoBean.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/MachineInfoBean.java index 7924d7a8..76589021 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/MachineInfoBean.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/MachineInfoBean.java @@ -69,4 +69,5 @@ public class MachineInfoBean { //租赁价格 private String leasePrice; + private Long companyId; } diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml index afc00bcd..0a78952f 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml @@ -1129,6 +1129,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN bm_project bp on bp.pro_id = bho.pro_id LEFT JOIN sys_user su on su.user_id=bho.update_by WHERE bho.is_active = '1' + + and bp.company_id=#{companyId} + and bho.reserve_date BETWEEN #{startTime} AND #{endTime} 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 2ec3bf2d..78a836c8 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 @@ -206,6 +206,9 @@ END = #{statusName} ) + + and sai.company_id = #{companyId} + ORDER BY sai.end_time @@ -260,6 +263,9 @@ AND bs.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') + + and bs.company_id = #{companyId} + order by bs.create_time desc @@ -335,6 +341,9 @@ AND bs.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') + + and bs.company_id = #{companyId} + order by bs.create_time desc @@ -405,6 +414,9 @@ LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id WHERE mm.ma_code is not null and mm.ma_status in (1) + + AND mm.company_id = #{companyId} + GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id LEFT JOIN ( SELECT @@ -428,6 +440,9 @@ AND (sai.source = 1 OR sai.source is NULL) AND sai.end_time IS NULL AND sai.back_id IS NULL + + AND sai.company_id = #{companyId} + GROUP BY mt.type_id ) AS subquery1 ON mt.type_id = subquery1.type_id @@ -452,6 +467,9 @@ WHERE tt.task_status IN (0, 4) and tt.code is not null + + AND rad.company_id = #{companyId} + GROUP BY mt.type_id) AS subquery2 ON subquery2.type_id = mt.type_id LEFT JOIN ( @@ -474,6 +492,9 @@ WHERE tt.code is not null and rad.`status` = '0' + + AND rad.company_id = #{companyId} + GROUP BY mt.type_id) AS subquery12 ON subquery12.type_id = mt.type_id LEFT JOIN ( @@ -496,6 +517,9 @@ LEFT JOIN tm_task tt ON rid.task_id = tt.task_id 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} + GROUP BY mt.type_id) AS subquery3 ON subquery3.type_id = mt.type_id LEFT JOIN ( @@ -517,6 +541,9 @@ LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id 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} + GROUP BY mt.type_id) AS subquery4 ON subquery4.type_id = mt.type_id /*LEFT JOIN ( @@ -600,6 +627,9 @@ AND mt.jiju_type = #{jiJuType} + + and mt.company_id = #{companyId} + HAVING allNum > 0 order by mt4.type_name, mt3.type_name, mt2.type_name, mt.type_name @@ -641,6 +671,9 @@ sai.is_slt = '0' and bp.pro_name is not null and mt.del_flag='0' + + and mt.company_id=#{companyId} + AND DATE_FORMAT( sai.start_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} @@ -696,6 +729,9 @@ and mt.del_flag=0 and tt.task_type = '2' and tt.task_status in (3, 4) + + and mt.company_id=#{companyId} + AND DATE_FORMAT( lad.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} @@ -747,6 +783,9 @@ bp.pro_name is not null and mt.del_flag='0' and tt.task_type = '19' + + and mt.company_id=#{companyId} + AND DATE_FORMAT( lpd.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} @@ -1022,6 +1061,9 @@ AND type_id = #{typeId} + + AND company_id = #{companyId} + GROUP BY type_id, ma_id, @@ -1088,6 +1130,9 @@ su.nick_name like concat('%',#{keyWord},'%') ) + + AND rad.company_id = #{companyId} + GROUP BY mm.ma_id,tt.`code`,mt.type_id @@ -1120,6 +1165,9 @@ AND pcd.type_id = #{typeId} + + AND pcd.company_id = #{companyId} + GROUP BY tt.`code`, mt.type_id @@ -1171,6 +1219,9 @@ mm.ma_code like concat('%',#{keyWord},'%') ) + + AND rid.company_id = #{companyId} + GROUP BY mm.ma_id, tt.`code`, mt.type_id @@ -1688,6 +1739,9 @@ #{item} + + and lod.company_id= #{companyId} + GROUP BY lod.parent_id @@ -1958,6 +2012,9 @@ su.nick_name like concat('%',#{keyWord},'%') ) + + AND rad.company_id = #{companyId} + GROUP BY mm.ma_id,tt.`code`,mt.type_id