diff --git a/src/main/java/com/zhgd/mybatis/DataScopeHandler.java b/src/main/java/com/zhgd/mybatis/DataScopeHandler.java index 16dc5fab2..cfd039fb5 100644 --- a/src/main/java/com/zhgd/mybatis/DataScopeHandler.java +++ b/src/main/java/com/zhgd/mybatis/DataScopeHandler.java @@ -85,6 +85,7 @@ public class DataScopeHandler implements DataPermissionHandler { private HashMap getFieldEnterpriseTables() { HashMap tables = new HashMap<>(); tables.put("worker_info", "enterprise_id"); + tables.put("team_info", "enterprise_id"); tables.put("department_info", "enterprise_id"); tables.put("xz_task_progress_content", "enterprise_id"); tables.put("xz_task_progress_alarm", "enterprise_id"); @@ -95,7 +96,6 @@ public class DataScopeHandler implements DataPermissionHandler { tables.put("inspect_task_record", "enterprise_id"); tables.put("xz_security_inspect_task_record", "enterprise_id"); tables.put("xz_security_quality_inspection_record", "enterprise_id"); - tables.put("team_info", "enterprise_id"); if (!environmentUtil.isBaise()) { tables.put("car_info", "enterprise_id"); tables.put("enterprise_info", "id"); diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/entity/WorkerInfo.java b/src/main/java/com/zhgd/xmgl/modules/worker/entity/WorkerInfo.java index ffb11455c..5b80a59ba 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/entity/WorkerInfo.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/entity/WorkerInfo.java @@ -269,6 +269,7 @@ public class WorkerInfo implements Serializable { */ @Excel(name = "职务类型", width = 15) @ApiModelProperty(value = "职务类型") + @Deprecated private java.lang.String jobType; /** * 职务 diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/WorkerAttendanceMapper.java b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/WorkerAttendanceMapper.java index ef07c96b8..854f9ae39 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/WorkerAttendanceMapper.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/WorkerAttendanceMapper.java @@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.worker.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zhgd.annotation.DataScope; import com.zhgd.jeecg.common.mybatis.EntityMap; import com.zhgd.xmgl.base.entity.vo.TrendOneVo; import com.zhgd.xmgl.entity.vo.NumberTimeTableVo; @@ -24,6 +25,7 @@ import java.util.Map; */ @Mapper @Repository +@DataScope(includeTable = {"worker_info", "enterprise_info"}) public interface WorkerAttendanceMapper extends BaseMapper { List viewDayAttendanceList(Map map); diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/WorkerInfoMapper.java b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/WorkerInfoMapper.java index 760498889..043441356 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/WorkerInfoMapper.java +++ b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/WorkerInfoMapper.java @@ -73,6 +73,7 @@ public interface WorkerInfoMapper extends BaseMapper { List selectExportExcelWorkerInfo(Map map); + @DataScope(includeTable = "enterprise_info") List selectProjectEnterpriseList(Map map); List> selectEnterpriseAttendanceWorkerCount(Map map); diff --git a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerAttendanceMapper.xml b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerAttendanceMapper.xml index 088411c0a..9e4cfb1e3 100644 --- a/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerAttendanceMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/worker/mapper/xml/WorkerAttendanceMapper.xml @@ -830,20 +830,20 @@ t.enterprise_name, count(*) as inServiceNum, ifnull(sum(if(t1.person_sn is null,1,0)),0) as notPerformNum, - ifnull(sum(if(wi.job_type=50,1,0)),0) as xmjlInServiceNum, - ifnull(sum(if(wi.job_type=50 and t1.person_sn is null,1,0)),0) as xmjlNotPerformNum, - ifnull(sum(if(wi.job_type=44,1,0)),0) as aqyInServiceNum, - ifnull(sum(if(wi.job_type=44 and t1.person_sn is null,1,0)),0) as aqyNotPerformNum, - ifnull(sum(if(wi.job_type=46,1,0)),0) as zlyInServiceNum, - ifnull(sum(if(wi.job_type=46 and t1.person_sn is null,1,0)),0) as zlyNotPerformNum, - ifnull(sum(if(wi.job_type=37,1,0)),0) as jlInServiceNum, - ifnull(sum(if(wi.job_type=37 and t1.person_sn is null,1,0)),0) as jlNotPerformNum + ifnull(sum(if(wi.job_name=50,1,0)),0) as xmjlInServiceNum, + ifnull(sum(if(wi.job_name=50 and t1.person_sn is null,1,0)),0) as xmjlNotPerformNum, + ifnull(sum(if(wi.job_name=44,1,0)),0) as aqyInServiceNum, + ifnull(sum(if(wi.job_name=44 and t1.person_sn is null,1,0)),0) as aqyNotPerformNum, + ifnull(sum(if(wi.job_name=46,1,0)),0) as zlyInServiceNum, + ifnull(sum(if(wi.job_name=46 and t1.person_sn is null,1,0)),0) as zlyNotPerformNum, + ifnull(sum(if(wi.job_name=37,1,0)),0) as jlInServiceNum, + ifnull(sum(if(wi.job_name=37 and t1.person_sn is null,1,0)),0) as jlNotPerformNum from enterprise_info t join worker_info wi on wi.enterprise_id=t.id left join (select person_sn from worker_attendance where project_sn=#{param.projectSn} and create_time >= CURRENT_DATE group by person_sn) t1 on t1.person_sn=wi.person_sn - where wi.project_sn=#{param.projectSn} AND wi.inService_type = 1 + where wi.project_sn=#{param.projectSn} AND wi.inService_type = 1 group by t.id