wenhongquan 3 năm trước cách đây
mục cha
commit
6568e29aa7

+ 6 - 0
ruoyi-system/src/main/resources/mapper/system/TableDetectionMapper.xml

@@ -41,6 +41,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="facilitiesId != null "> and facilities_id = #{facilitiesId}</if>
             <if test="ext1 != null  and ext1 != ''"> and ext1 = #{ext1}</if>
             <if test="ext2 != null  and ext2 != ''"> and ext2 = #{ext2}</if>
+            <if test="params.userId != null and params.userId != ''"><!-- 派发用户自己的或自己填报的或自己处理的 -->
+                <![CDATA[
+                and (
+                 (id IN (SELECT c.detection_id FROM (SELECT * FROM tbl_detection_log where id in (SELECT MAX(id) AS id  FROM tbl_detection_log where  detection_status=2  GROUP BY detection_id )) c WHERE c.log_des->'$.fzr'= CAST(#{params.userId} AS SIGNED) )))
+                ]]>
+            </if>
         </where>
     </select>
     

+ 6 - 0
ruoyi-system/src/main/resources/mapper/system/TblMaintainMapper.xml

@@ -43,6 +43,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="ext2 != null  and ext2 != ''"> and ext2 = #{ext2}</if>
             <if test="status != null "> and status = #{status}</if>
             <if test="facilitiesId != null "> and facilities_id = #{facilitiesId}</if>
+            <if test="params.userId != null and params.userId != ''"><!-- 派发用户自己的或自己填报的或自己处理的 -->
+                <![CDATA[
+                and (
+                 (id IN (SELECT c.maintain_id FROM (SELECT * FROM tbl_maintain_log where id in (SELECT MAX(id) AS id  FROM tbl_maintain_log where  maintain_status=2  GROUP BY maintain_id )) c WHERE c.log_des->'$.fzr'= CAST(#{params.userId} AS SIGNED) )))
+                ]]>
+            </if>
         </where>
     </select>
     

+ 7 - 0
ruoyi-system/src/main/resources/mapper/system/TblTaskMapper.xml

@@ -71,6 +71,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
                 and date_format(task_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
             </if>
+            <if test="params.userId != null and params.userId != ''"><!-- 派发用户自己的或自己填报的或自己处理的 -->
+                <![CDATA[
+                and ( task_reporter = #{params.userId}
+                OR (task_id in (select c.task_id from  (SELECT * FROM tbl_task_log where id in (SELECT MAX(id) AS id  FROM tbl_task_log where  task_status=-1  GROUP BY task_id )) c where c.log_des->'$.zyfzr'= CAST(#{params.userId} AS SIGNED)))
+                OR (task_id IN (SELECT c.task_id FROM (SELECT * FROM tbl_task_log where id in (SELECT MAX(id) AS id  FROM tbl_task_log where  task_status=2  GROUP BY task_id )) c WHERE json_contains(c.log_des-> '$.fzr',#{params.userId}))))
+                ]]>
+            </if>
         </where>
         order by create_time desc
     </select>