|
@@ -19,7 +19,8 @@
|
|
|
LEFT JOIN sys_user f ON a.CREATEUSERID = f.id AND f.DELETED = '0'
|
|
|
LEFT JOIN sys_user g ON a.MODIFYUSERID = g.id AND g.DELETED = '0'
|
|
|
WHERE
|
|
|
- a.DELETED = '0' and c.ID =#{fitstDeptId}
|
|
|
+ a.DELETED = '0' and c.LEVEL in ('2','3')
|
|
|
+ AND (c.ID = #{fitstDeptId} OR c.FULLPID LIKE '%${fitstDeptId}%')
|
|
|
AND e.CODE =#{code0}
|
|
|
GROUP BY
|
|
|
e.code
|
|
@@ -53,15 +54,31 @@
|
|
|
LISTAGG(a.NAME, ',') WITHIN GROUP (ORDER BY a.NAME) AS names
|
|
|
FROM
|
|
|
sys_user a
|
|
|
+ LEFT JOIN sys_user_role d ON a.ID = d.USERID AND d.DELETED = '0'
|
|
|
+ INNER JOIN (
|
|
|
+ SELECT ID, #{code2} AS CODE
|
|
|
+ FROM sys_role
|
|
|
+ WHERE CODE IN (#{code2},#{code3}) AND DELETED = '0'
|
|
|
+ ) e ON d.ROLEID = e.id
|
|
|
|
|
|
- LEFT JOIN sys_user_role d ON a.ID = d.USERID AND d.DELETED = '0'
|
|
|
- LEFT JOIN sys_role e ON d.ROLEID = e.id AND e.DELETED = '0'
|
|
|
LEFT JOIN sys_user f ON a.CREATEUSERID = f.id AND f.DELETED = '0'
|
|
|
LEFT JOIN sys_user g ON a.MODIFYUSERID = g.id AND g.DELETED = '0'
|
|
|
- WHERE
|
|
|
- e.CODE =#{code2}
|
|
|
+
|
|
|
GROUP BY
|
|
|
e.code
|
|
|
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="getRecordByPhone" resultType="com.rongwei.bsentity.vo.QhseVisitorManagementVo">
|
|
|
+ SELECT
|
|
|
+ a.*,
|
|
|
+ b.NAME "APPROVALSTATUSNAME",
|
|
|
+ c.NAME "REASONSFORTHEVISITNAME"
|
|
|
+ FROM qhse_visitor_management a
|
|
|
+ LEFT JOIN sys_dict b ON a.APPROVALSTATUS = b.VALUE AND b.DELETED = '0' AND b.DICTTYPE = 'fk_audit_status'
|
|
|
+ LEFT JOIN sys_dict c ON a.REASONSFORTHEVISIT = c.VALUE AND c.DELETED = '0' AND c.DICTTYPE = 'visit-reason'
|
|
|
+ WHERE a.DELETED = '0' AND a.MOBILEPHONENUMBER = #{phone}
|
|
|
+ AND TRUNC(a.CREATEDATE) = TRUNC(CURRENT_DATE)
|
|
|
+ ORDER BY a.MODIFYDATE DESC
|
|
|
+ </select>
|
|
|
</mapper>
|