Преглед изворни кода

危险源、安全准入白名单权限添加

liujh пре 3 година
родитељ
комит
650baaad2d

+ 1 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabHazardServiceImpl.java

@@ -164,7 +164,7 @@ public class LabHazardServiceImpl implements ILabHazardService {
      * 查询危险源
      */
     @Override
-//    @DataScope(deptAlias = "lh", userAlias = "lh", permi = PerPrefix.LABORATORY_HAZARD)
+    @DataScope(deptAlias = "d", userAlias = "u", permi = PerPrefix.LABORATORY_HAZARD)
     public List<LabHazardDTO> selectLabHazardAndContainerList(LabHazardDTO labHazard) {
         List<LabHazardDTO> list = labHazardMapper.selectLabHazardAndContainerList(labHazard);
         return list;

+ 1 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabWhitelistServiceImpl.java

@@ -54,7 +54,7 @@ public class LabWhitelistServiceImpl implements ILabWhitelistService
      * @return 白名单
      */
     @Override
-    @DataScope(deptAlias = "t" , userAlias = "t" , permi = PerPrefix.LABORATORY_WHITELIST)
+    @DataScope(deptAlias = "d" , userAlias = "u" , permi = PerPrefix.LABORATORY_WHITELIST)
     public List<LabWhitelist> selectLabWhitelistList(LabWhitelist labWhitelist)
     {
         return labWhitelistMapper.selectLabWhitelistList(labWhitelist);

+ 3 - 3
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabHazardMapper.xml

@@ -216,13 +216,13 @@
         floor((select (select count(1) from lab_risk_plan where hazard_id = lh.id )/(select count(1) from lab_risk_plan) * 100)) as planScale,
         floor((select (select count(1) from lab_risk_plan_abnormal_log where risk_status = 1 and risk_plan_id in (select id from lab_risk_plan where hazard_id = lh.id ))/(select count(1) from lab_risk_plan_abnormal_log where risk_status = 1) * 100)) as faultScale,
         lh.user_id
-        from lab_hazard lh
+        from lab_hazard lh LEFT JOIN   sys_dept d on   lh.dept_id=d.dept_id LEFT JOIN sys_user u on  lh.user_id=u.user_id
         <where>
             <if test="name != null and name != ''">
                 and lh.ch_name like concat("%", #{name}, "%")
             </if>
-            <!-- 数据范围过滤
-            ${params.dataScope}-->
+            <!-- 数据范围过滤-->
+            ${params.dataScope}
             <!--            <if test="type != null and type != '' and type == '2' ">-->
             <!--                and false-->
             <!--            </if>-->

+ 7 - 3
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabWhitelistMapper.xml

@@ -22,12 +22,16 @@
         select id, user_id, user_name, user_number, user_telephone, user_type, dept_id, dept_name, create_user, create_id, create_time from lab_whitelist t
     </sql>
     <sql id="selectLabWhitelistListVo">
-        select t.id, t.user_id, t.user_name, t.user_number, t.user_telephone, t.user_type, t.dept_id, t.dept_name, t.create_user, t.create_id, t.create_time from lab_whitelist as t
+        select t.id, t.user_id, t.user_name, t.user_number, t.user_telephone, t.user_type,
+               t.dept_id, t.dept_name, t.create_user, t.create_id, t.create_time
+        from lab_whitelist t
+            LEFT JOIN   sys_dept d on   t.dept_id=d.dept_id
+            LEFT JOIN sys_user u on  t.user_id=u.user_id
     </sql>
     <select id="selectLabWhitelistList" parameterType="com.zd.laboratory.domain.LabWhitelist" resultMap="LabWhitelistResult">
-        <include refid="selectLabWhitelistVo"/>
+        <include refid="selectLabWhitelistListVo"/>
         <where>
-            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="userId != null "> and t.user_id = #{userId}</if>
             <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
             <if test="userNumber != null  and userNumber != ''"> and user_number = #{userNumber}</if>
             <if test="userTelephone != null  and userTelephone != ''"> and user_telephone = #{userTelephone}</if>