刘帅
7 天以前 d41e0da5df20d559b0b9b8c180d1bf70ba7c1845
cloud-server-management/src/main/resources/mapper/UserMapper.xml
@@ -84,7 +84,28 @@
                               select objectId as storeId from sys_user where id = #{userId} and objectType = 3 and objectId is not null
                               union all
                               select id as storeId from t_store where storeStaffId = #{userId}
                            ) relation_store
                         ) relation_store
   </select>
   <select id="getUserIdsByStoreIds" resultType="java.lang.Integer">
      select distinct userId from (
         select userId from sys_user_store
         where isDeleted = 0 and storeId in
         <foreach collection="storeIds" separator="," item="storeId" open="(" close=")">
            #{storeId}
         </foreach>
         union all
         select id as userId from sys_user
         where objectType = 3 and objectId in
         <foreach collection="storeIds" separator="," item="storeId" open="(" close=")">
            #{storeId}
         </foreach>
         union all
         select storeStaffId as userId from t_store
         where storeStaffId is not null and id in
         <foreach collection="storeIds" separator="," item="storeId" open="(" close=")">
            #{storeId}
         </foreach>
      ) relation_user
   </select>
   <select id="getByAccount" resultType="com.dsh.guns.modular.system.model.User">
@@ -134,7 +155,8 @@
   </select>
   <select id="searchUsers" resultType="com.dsh.guns.modular.system.model.UserListVO">
      select t1.id,t1.name ,t1.phone ,t1.avatar,t1.birthday,t1.sex,t1.idCard,t1.status,t1.version
      ,t2.simplename as deptName from sys_user t1
      ,t2.simplename as deptName,
      (select group_concat(r.name separator ',') from sys_role r where find_in_set(r.id, t1.roleid)) as roleName from sys_user t1
      left join sys_dept t2 on t1.deptid = t2.id
      <where>
         <if test="query.name != null and query.name != ''">