Browse Source

天线负责人修改

master
shenzhouyu 7 days ago
parent
commit
315fc4fed7
  1. 76
      src/main/resources/mapper/pms/QcMapper.xml

76
src/main/resources/mapper/pms/QcMapper.xml

@ -4090,35 +4090,55 @@
</where> </where>
</select> </select>
<!-- 04-MHM 责任人:role(7,8) + user_role + users -->
<!-- 04-MHM 责任人:operator 表 + users(排除 admin、仓管角色43) -->
<select id="getMhmResponsibleOperatorList" resultType="com.xujie.sys.modules.pms.data.EamAdminData" parameterType="com.xujie.sys.modules.pms.data.EamAdminData"> <select id="getMhmResponsibleOperatorList" resultType="com.xujie.sys.modules.pms.data.EamAdminData" parameterType="com.xujie.sys.modules.pms.data.EamAdminData">
SELECT DISTINCT
u.id as userId,
u.username as adminID,
u.display as adminName,
u.department as departmentName,
ur.role_id as roleId,
r.name as roleName
FROM users u
INNER JOIN user_role ur ON u.id = ur.user_id
INNER JOIN role r ON ur.role_id = r.id
<where>
ur.role_id IN (7, 8)
AND (u.active = 'Y' OR u.active IS NULL)
<if test="site != null and site != ''">
AND u.site = #{site}
</if>
<if test="adminID != null and adminID != ''">
AND u.username LIKE '%' + #{adminID} + '%'
</if>
<if test="adminName != null and adminName != ''">
AND u.display LIKE '%' + #{adminName} + '%'
</if>
<if test="roleId != null and roleId != ''">
AND ur.role_id = #{roleId}
</if>
</where>
ORDER BY u.username
SELECT DISTINCT userId, adminID, adminName, departmentName, roleId, roleName FROM (
SELECT
NULL as userId,
o.operator_id as adminID,
o.operator_name as adminName,
NULL as departmentName,
NULL as roleId,
N'操作员' as roleName
FROM operator o
<where>
(o.active = 'Y' OR o.active IS NULL)
AND LOWER(o.operator_id) &lt;&gt; 'admin'
<if test="site != null and site != ''">
AND o.site = #{site}
</if>
<if test="adminID != null and adminID != ''">
AND o.operator_id LIKE '%' + #{adminID} + '%'
</if>
<if test="adminName != null and adminName != ''">
AND o.operator_name LIKE '%' + #{adminName} + '%'
</if>
</where>
UNION ALL
SELECT
u.id as userId,
u.username as adminID,
u.display as adminName,
u.department as departmentName,
NULL as roleId,
NULL as roleName
FROM users u
<where>
(u.active = 'Y' OR u.active IS NULL)
AND LOWER(u.username) &lt;&gt; 'admin'
AND NOT EXISTS (SELECT 1 FROM user_role ur2 WHERE ur2.user_id = u.id AND ur2.role_id = 43)
<if test="site != null and site != ''">
AND u.site = #{site}
</if>
<if test="adminID != null and adminID != ''">
AND u.username LIKE '%' + #{adminID} + '%'
</if>
<if test="adminName != null and adminName != ''">
AND u.display LIKE '%' + #{adminName} + '%'
</if>
</where>
) t
ORDER BY adminID
</select> </select>
<select id="getMhmResponsibleRoleList" resultType="com.xujie.sys.modules.pms.data.EamAdminData"> <select id="getMhmResponsibleRoleList" resultType="com.xujie.sys.modules.pms.data.EamAdminData">

Loading…
Cancel
Save