浏览代码

仓库报表

3254194295 3 年之前
父节点
当前提交
449ba3154d
共有 1 个文件被更改,包括 46 次插入0 次删除
  1. 46 0
      platform-dao/src/main/resources/mapper/upms/SysUserMapper.xml

+ 46 - 0
platform-dao/src/main/resources/mapper/upms/SysUserMapper.xml

@@ -48,6 +48,52 @@
         order by u.update_time desc
     </select>
 
+    <select id="selectVOByKeyword" resultType="com.platform.dao.vo.SysUserVO"
+            parameterType="com.platform.dao.dto.upms.SysUserDTO">
+        select distinct u.* from t_sys_user u
+        join t_sys_user_role role
+        on u.user_id=role.user_id
+        where 1=1
+        <if test="keyword !=null and keyword !=''">
+            and (u.username like CONCAT('%',#{keyword},'%')
+            or u.real_name like CONCAT('%',#{keyword},'%'))
+        </if>
+        <if test="deptId !=null and deptId !=''">
+            and exists (select 1 from t_sys_user_dept t where t.user_id = u.user_id and t.dept_id = #{deptId}
+            union select 1 from t_sys_dept t where t.dept_id = #{deptId} and t.parent_id = '0')
+        </if>
+        <if test="phone !=null and phone !=''">
+            and u.phone = #{phone}
+        </if>
+        <if test="username !=null and username !=''">
+            and u.username = #{username}
+        </if>
+        <if test="teamId !=null and teamId !=''">
+            and exists (select 1 from t_sys_user_team t where t.user_id = u.user_id and t.team_id = #{teamId})
+        </if>
+        <if test="identityType !=null">
+            and u.identity_type = #{identityType}
+        </if>
+        <if test="roleId!=null and roleId!=''">
+            and role.role_id=#{roleId}
+        </if>
+        order by u.update_time desc
+    </select>
+
+<!--    <select id="selectByDept" resultType="com.platform.dao.vo.SysUserVO"-->
+<!--            parameterType="com.platform.dao.dto.upms.SysUserDTO">-->
+<!--        select u.* from t_sys_user u-->
+<!--        left join t_sys_user_dept ud on u.user_id = ud.user_id-->
+<!--        where 1=1-->
+<!--        <if test="deptIds != null  and deptIds.size >0">-->
+<!--            AND ud.dept_id in-->
+<!--            <foreach item="item" index="index" collection="deptIds" open="(" close=")" separator=",">-->
+<!--                #{item}-->
+<!--            </foreach>-->
+<!--        </if>-->
+<!--        order by u.update_time desc-->
+<!--    </select>-->
+
     <select id="selectDeptRoleUser" resultType="com.platform.dao.vo.SysUserVO"
             parameterType="com.platform.dao.dto.upms.SysUserDTO">
         select distinct u.* from t_sys_user u, t_sys_user_dept ud, t_sys_user_role ur, t_sys_role r