|
@@ -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
|
|
@@ -64,4 +65,17 @@
|
|
|
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>
|