Merge remote-tracking branch 'origin/ah-simple-test' into ah-simple-test

This commit is contained in:
jiang 2026-01-05 13:42:42 +08:00
commit 46b1e2a86d
24 changed files with 265 additions and 75 deletions

View File

@ -426,11 +426,17 @@ public class BackChangeServiceImpl implements BackChangeService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid(); Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据 // 管理员和省公司可查看所有数据
if (userId != null && deptId != null // if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID) // && !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { // && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// dto.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
dto.setCompanyId(1L);
}else{
dto.setCompanyId(deptId); dto.setCompanyId(deptId);
} }
return mapper.getList(dto); return mapper.getList(dto);
} }

View File

@ -126,4 +126,6 @@ public class CsDeviceChangeVo {
private String endTime; private String endTime;
private String useTime; private String useTime;
private Long companyId;
} }

View File

@ -502,9 +502,14 @@ public class DevChangeServiceImpl implements DevChangeService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid(); Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据 // 管理员和省公司可查看所有数据
if (userId != null && deptId != null // if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID) // && !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { // && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// dto.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
dto.setCompanyId(1L);
}else{
dto.setCompanyId(deptId); dto.setCompanyId(deptId);
} }
return mapper.getList(dto); return mapper.getList(dto);
@ -857,9 +862,14 @@ public class DevChangeServiceImpl implements DevChangeService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid(); Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据 // 管理员和省公司可查看所有数据
if (userId != null && deptId != null // if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID) // && !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { // && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// dto.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
dto.setCompanyId(1L);
}else{
dto.setCompanyId(deptId); dto.setCompanyId(deptId);
} }
return mapper.getOutboundList(dto); return mapper.getOutboundList(dto);
@ -1137,7 +1147,13 @@ public class DevChangeServiceImpl implements DevChangeService {
vo.setEndTime(endTimeAfterAddOneDay.format(dateFormatter)); vo.setEndTime(endTimeAfterAddOneDay.format(dateFormatter));
} }
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid();
if(ADMIN_ID.equals(userId)){
vo.setCompanyId(1L);
}else{
vo.setCompanyId(deptId);
}
return mapper.getDevChangeList(vo); return mapper.getDevChangeList(vo);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error(e.getMessage());

View File

@ -33,9 +33,14 @@ public class MaDevInfoServiceImpl implements MaDevInfoService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid(); Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据 // 管理员和省公司可查看所有数据
if (userId != null && deptId != null // if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID) // && !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { // && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// o.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
o.setCompanyId(1L);
}else{
o.setCompanyId(deptId); o.setCompanyId(deptId);
} }
List<MaDevInfo> list = mapper.list(o); List<MaDevInfo> list = mapper.list(o);
@ -248,12 +253,15 @@ public class MaDevInfoServiceImpl implements MaDevInfoService {
Long companyId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long companyId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid(); Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据 // 管理员和省公司可查看所有数据
if (userId != null && companyId != null // if (userId != null && companyId != null
&& !userId.equals(ADMIN_ID) // && !userId.equals(ADMIN_ID)
&& !companyId.equals(PROVINCE_COMPANY_DEPT_ID)) { // && !companyId.equals(PROVINCE_COMPANY_DEPT_ID)) {
companyId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); // companyId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
} else { // } else {
companyId = null; // companyId = null;
// }
if(ADMIN_ID.equals(userId)){
companyId = 1L;
} }
Integer totalCount = mapper.selectTotalDeviceCount(companyId); Integer totalCount = mapper.selectTotalDeviceCount(companyId);

View File

@ -29,9 +29,14 @@ public class MaDevRetireWarningServiceImpl implements MaDevRetireWarningService{
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid(); Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据 // 管理员和省公司可查看所有数据
if (userId != null && deptId != null // if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID) // && !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { // && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// o.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
o.setCompanyId(1L);
}else{
o.setCompanyId(deptId); o.setCompanyId(deptId);
} }
return mapper.list(o); return mapper.list(o);

View File

@ -100,5 +100,7 @@ public class MaDevQc extends BaseEntity implements Serializable {
private String phonenumber; private String phonenumber;
private String alert; private String alert;
private Long companyId;
} }

View File

@ -22,6 +22,8 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import static com.bonus.common.biz.constant.MaterialConstants.ADMIN_ID;
/** /**
* @Author ma_sh * @Author ma_sh
* @create 2024/12/5 15:53 * @create 2024/12/5 15:53
@ -47,6 +49,13 @@ public class MaDevQcServiceImpl implements MaDevQcService {
@Override @Override
public List<MaDevQc> selectDevQcList(MaDevQc maDevQc) { public List<MaDevQc> selectDevQcList(MaDevQc maDevQc) {
maDevQc.setQcCom(SecurityUtils.getLoginUser().getSysUser().getDeptId().toString()); maDevQc.setQcCom(SecurityUtils.getLoginUser().getSysUser().getDeptId().toString());
Long userId = SecurityUtils.getLoginUser().getSysUser().getUserId();
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
if(ADMIN_ID.equals(userId)){
maDevQc.setCompanyId(1L);
}else{
maDevQc.setCompanyId(deptId);
}
return maDevQcMapper.selectDevQcList(maDevQc); return maDevQcMapper.selectDevQcList(maDevQc);
} }

View File

@ -208,9 +208,14 @@ public class RepairServiceImpl implements RepairService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid(); Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据 // 管理员和省公司可查看所有数据
if (userId != null && deptId != null // if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID) // && !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { // && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// bean.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
bean.setCompanyId(1L);
}else{
bean.setCompanyId(deptId); bean.setCompanyId(deptId);
} }
List<ToBeRepair> list = mapper.getRepairList(bean); List<ToBeRepair> list = mapper.getRepairList(bean);

View File

@ -276,9 +276,14 @@ public class ToBeScrapServiceImpl implements ToBeScrapService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid(); Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据 // 管理员和省公司可查看所有数据
if (userId != null && deptId != null // if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID) // && !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { // && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// bean.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
bean.setCompanyId(1L);
}else{
bean.setCompanyId(deptId); bean.setCompanyId(deptId);
} }
return scrapMapper.getScrapApplyList(bean); return scrapMapper.getScrapApplyList(bean);

View File

@ -41,9 +41,14 @@ public class ToolLedgerServiceImpl implements ToolLedgerService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid(); Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据 // 管理员和省公司可查看所有数据
if (userId != null && deptId != null // if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID) // && !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { // && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// entity.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
entity.setCompanyId(1L);
}else{
entity.setCompanyId(deptId); entity.setCompanyId(deptId);
} }
return mapper.list(entity); return mapper.list(entity);
@ -60,9 +65,14 @@ public class ToolLedgerServiceImpl implements ToolLedgerService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid(); Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据 // 管理员和省公司可查看所有数据
if (userId != null && deptId != null // if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID) // && !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { // && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// entity.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
entity.setCompanyId(1L);
}else{
entity.setCompanyId(deptId); entity.setCompanyId(deptId);
} }
List<ToolLedgerEntity> toolLedgerEntities = mapper.listCode(entity); List<ToolLedgerEntity> toolLedgerEntities = mapper.listCode(entity);

View File

@ -33,9 +33,9 @@ public class UpOrDownEquipmentServiceImpl implements UpOrDownEquipmentService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid(); Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据 // 管理员和省公司可查看所有数据
if (userId != null && deptId != null if(ADMIN_ID.equals(userId)){
&& !userId.equals(ADMIN_ID) entity.setCompanyId(1L);
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { }else{
entity.setCompanyId(deptId); entity.setCompanyId(deptId);
} }

View File

@ -38,9 +38,14 @@ public class UpOrDownToolServiceImpl implements UpOrDownToolService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid(); Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据 // 管理员和省公司可查看所有数据
if (userId != null && deptId != null // if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID) // && !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { // && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// entity.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
entity.setCompanyId(1L);
}else{
entity.setCompanyId(deptId); entity.setCompanyId(deptId);
} }
return upOrDownToolMapper.list(entity); return upOrDownToolMapper.list(entity);

View File

@ -114,9 +114,14 @@ public class WarehousingServiceImpl implements WarehousingService {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
Long userId = SecurityUtils.getLoginUser().getUserid(); Long userId = SecurityUtils.getLoginUser().getUserid();
// 管理员和省公司可查看所有数据 // 管理员和省公司可查看所有数据
if (userId != null && deptId != null // if (userId != null && deptId != null
&& !userId.equals(ADMIN_ID) // && !userId.equals(ADMIN_ID)
&& !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) { // && !deptId.equals(PROVINCE_COMPANY_DEPT_ID)) {
// warehousing.setCompanyId(deptId);
// }
if(ADMIN_ID.equals(userId)){
warehousing.setCompanyId(1L);
}else{
warehousing.setCompanyId(deptId); warehousing.setCompanyId(deptId);
} }
List<WarehousingEntity> warehousingEntities = mapper.selectList(warehousing); List<WarehousingEntity> warehousingEntities = mapper.selectList(warehousing);

View File

@ -547,8 +547,15 @@
<if test="useUnit != null and useUnit != ''"> <if test="useUnit != null and useUnit != ''">
and cd.use_unit = #{useUnit} and cd.use_unit = #{useUnit}
</if> </if>
<if test="companyId != null"> <if test="companyId != null and companyId != 1 ">
and cd.company_id = #{companyId} and cd.company_id
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if> </if>
GROUP BY GROUP BY
cd.id cd.id
@ -578,4 +585,4 @@
</select> </select>
</mapper> </mapper>

View File

@ -183,6 +183,16 @@
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!='' "> <if test="startTime!=null and startTime!='' and endTime!=null and endTime!='' ">
and cds.create_time between #{startTime} and #{endTime} and cds.create_time between #{startTime} and #{endTime}
</if> </if>
<if test="companyId !=null and companyId !=1" >
and cds.company_id
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if>
GROUP BY GROUP BY
cds.id, cds.id,
cds.change_status, cds.change_status,
@ -567,8 +577,15 @@
<if test="proCode != null and proCode != ''"> <if test="proCode != null and proCode != ''">
and cd.pro_code = #{proCode} and cd.pro_code = #{proCode}
</if> </if>
<if test="companyId != null"> <if test="companyId != null and companyId != 1 ">
and cd.company_id = #{companyId} and cd.company_id
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if> </if>
GROUP BY GROUP BY
cd.id cd.id
@ -719,8 +736,18 @@
<if test="taskStatus != null and taskStatus != ''"> <if test="taskStatus != null and taskStatus != ''">
AND temp.taskStatus = #{taskStatus} AND temp.taskStatus = #{taskStatus}
</if> </if>
<if test="companyId != null and taskStatus != ''"> <!-- <if test="companyId != null and taskStatus != ''">-->
AND temp.companyId = #{companyId} <!-- AND temp.companyId = #{companyId}-->
<!-- </if>-->
<if test="companyId != null and companyId != 1 ">
AND temp.companyId
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if> </if>
</where> </where>
@ -1281,4 +1308,4 @@
<delete id="deleteChangeInfo"> <delete id="deleteChangeInfo">
update cs_device_change set del_flag = '1' where id = #{id} update cs_device_change set del_flag = '1' where id = #{id}
</delete> </delete>
</mapper> </mapper>

View File

@ -360,8 +360,15 @@
LEFT JOIN sys_cnarea sc ON sc.area_code = mdi.province_id LEFT JOIN sys_cnarea sc ON sc.area_code = mdi.province_id
<where> <where>
mdi.is_active = '1' and mdi.entry_status = '1' mdi.is_active = '1' and mdi.entry_status = '1'
<if test="companyId != null"> <if test="companyId !=null and companyId != 1">
AND mdi.on_company = #{companyId} AND mdi.on_company
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if> </if>
<if test="typeId != null and typeId != 0 "> <if test="typeId != null and typeId != 0 ">
and ( and (
@ -527,8 +534,15 @@
LEFT JOIN sys_cnarea sc ON sc.area_code = mdi.province_id LEFT JOIN sys_cnarea sc ON sc.area_code = mdi.province_id
<where> <where>
mdi.is_active = '1' and mdi.entry_status = '1' mdi.is_active = '1' and mdi.entry_status = '1'
<if test="companyId != null"> <if test="companyId != nul and companyId != 1">
AND mdi.on_company = #{companyId} AND mdi.on_company
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if> </if>
</where> </where>
</select> </select>

View File

@ -63,8 +63,15 @@
<if test="manufacturerId != null and manufacturerId != ''"> <if test="manufacturerId != null and manufacturerId != ''">
AND mdi.supplier_id like concat('%',#{manufacturerId},'%') AND mdi.supplier_id like concat('%',#{manufacturerId},'%')
</if> </if>
<if test="companyId != null"> <if test="companyId !=1 and companyId != null">
AND mdi.on_company = #{companyId} AND mdi.on_company
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if> </if>
) a ) a
<where> <where>

View File

@ -109,8 +109,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createStartTime != null and createStartTime != '' and createEndTime != null and createEndTime != ''"> <if test="createStartTime != null and createStartTime != '' and createEndTime != null and createEndTime != ''">
and DATE_FORMAT(m1.create_time,'%Y-%m-%d') between #{createStartTime} and #{createEndTime} and DATE_FORMAT(m1.create_time,'%Y-%m-%d') between #{createStartTime} and #{createEndTime}
</if> </if>
<if test="qcCom != null and qcCom != ''"> <if test="companyId != null and companyId != 1 ">
and m2.on_company = #{qcCom} and m2.on_company
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if> </if>
<if test="alert != null and alert != ''"> <if test="alert != null and alert != ''">
<choose> <choose>

View File

@ -287,8 +287,16 @@
<if test="status != null and status!=''"> <if test="status != null and status!=''">
AND cdc.review_status = #{status} AND cdc.review_status = #{status}
</if> </if>
<if test="companyId != null"> <if test="companyId != null and changeId != 1">
and cdc.company_id = #{companyId} and cdc.company_id
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if> </if>
<if test="isAudit==1"> <if test="isAudit==1">
and cdc.review_status !='5' and cdc.review_status !='5'
@ -448,4 +456,4 @@
id = #{id} id = #{id}
LIMIT 1 LIMIT 1
</select> </select>
</mapper> </mapper>

View File

@ -144,8 +144,15 @@
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!='' "> <if test="startTime!=null and startTime!='' and endTime!=null and endTime!='' ">
AND cdc.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') AND cdc.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if> </if>
<if test="companyId != null"> <if test="companyId != null and changeId != 1">
and cdc.company_id = #{companyId} and cdc.company_id
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if> </if>
GROUP BY cdc.id GROUP BY cdc.id
ORDER BY ORDER BY
@ -449,4 +456,4 @@
<delete id="deleteChangeInfo"> <delete id="deleteChangeInfo">
update cs_device_change set del_flag = '1' where id = #{id} update cs_device_change set del_flag = '1' where id = #{id}
</delete> </delete>
</mapper> </mapper>

View File

@ -104,8 +104,14 @@
AND tt.manage_type = #{manageMode} AND tt.manage_type = #{manageMode}
</if> </if>
<if test="companyId != null"> <if test="companyId != null and companyId != 1 ">
AND tl.company_id = #{companyId} AND tl.company_id in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if> </if>
<if test="typeName != null and typeName != ''"> <if test="typeName != null and typeName != ''">
AND tt.type_name LIKE CONCAT('%', #{typeName}, '%') AND tt.type_name LIKE CONCAT('%', #{typeName}, '%')
@ -228,8 +234,15 @@
<if test="toolCode != null and toolCode != ''"> <if test="toolCode != null and toolCode != ''">
AND tl.tool_code LIKE CONCAT('%', #{toolCode}, '%') AND tl.tool_code LIKE CONCAT('%', #{toolCode}, '%')
</if> </if>
<if test="companyId != null"> <if test="companyId != null and companyId != 1">
AND (tl.company_id = #{companyId} OR tl.company_id IS NULL) <!-- AND (tl.company_id = #{companyId} OR tl.company_id IS NULL)-->
and tl.company_id in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if> </if>
ORDER BY ORDER BY
tl.create_time DESC tl.create_time DESC

View File

@ -198,8 +198,16 @@
<if test="subProcess != null and subProcess != ''"> <if test="subProcess != null and subProcess != ''">
and mtv.childGx like concat('%', #{subProcess}, '%') and mtv.childGx like concat('%', #{subProcess}, '%')
</if> </if>
<if test="companyId != null and companyId != ''"> <if test="companyId != null and companyId != 1">
and mdi.on_company = #{companyId} and mdi.on_company
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if> </if>

View File

@ -89,7 +89,14 @@
AND tt.type_name LIKE CONCAT('%', #{typeName}, '%') AND tt.type_name LIKE CONCAT('%', #{typeName}, '%')
</if> </if>
<if test="companyId != null and companyId != ''"> <if test="companyId != null and companyId != ''">
AND tl.company_id = #{companyId} AND tl.company_id
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if> </if>
GROUP BY tl.id GROUP BY tl.id

View File

@ -153,8 +153,15 @@
<if test="isStatus != null and isStatus != ''"> <if test="isStatus != null and isStatus != ''">
AND bw.status != #{isStatus} AND bw.status != #{isStatus}
</if> </if>
<if test="companyId != null and companyId != ''"> <if test="companyId !=null and companyId != 1">
AND su.dept_id = #{companyId} AND su.dept_id
in (
select dept_id from sys_dept where dept_id= #{companyId}
union
select dept_id from sys_dept where parent_id= #{companyId}
union
select dept_id from sys_dept where parent_id in (select dept_id from sys_dept where parent_id= #{companyId})
)
</if> </if>
<if test="startTime != null and endTime != null "> <if test="startTime != null and endTime != null ">
and bw.create_time &gt;= #{startTime} and bw.create_time &gt;= #{startTime}
@ -221,4 +228,4 @@
</select> </select>
</mapper> </mapper>