46 lines
1.3 KiB
XML
46 lines
1.3 KiB
XML
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||
|
|
<mapper namespace="com.bonus.aqgqj.basis.dao.ToolsManageDao">
|
||
|
|
|
||
|
|
<select id="list" resultType="com.bonus.aqgqj.basis.entity.dto.ToolsManageDto">
|
||
|
|
SELECT
|
||
|
|
t.id,
|
||
|
|
t.login_name AS loginName,
|
||
|
|
t.user_name AS username,
|
||
|
|
t.user_code AS userCode,
|
||
|
|
t.sex,
|
||
|
|
t.org_id as orgId,
|
||
|
|
CONCAT(so.org_name,'/',t.team_name) as orgName,
|
||
|
|
sr.role_name roleName,
|
||
|
|
t.phone AS phone,
|
||
|
|
t.team_id as teamId,
|
||
|
|
t.team_name as teamName,
|
||
|
|
CASE
|
||
|
|
t.user_type
|
||
|
|
WHEN '0' THEN
|
||
|
|
'内部用户'
|
||
|
|
WHEN '1' THEN
|
||
|
|
'外部用户' ELSE ''
|
||
|
|
END userType,
|
||
|
|
t.state AS state,
|
||
|
|
t.del_flag AS delFlag
|
||
|
|
FROM
|
||
|
|
sys_user t
|
||
|
|
LEFT JOIN sys_role sr ON sr.role_id = t.role_id
|
||
|
|
LEFT JOIN sys_org so ON so.org_id = t.org_id
|
||
|
|
where t.del_flag = 0
|
||
|
|
<if test="username != null and username != ''">
|
||
|
|
and t.user_name like concat('%', #{username}, '%')
|
||
|
|
</if>
|
||
|
|
<if test="phone != null and phone != ''">
|
||
|
|
and t.phone like concat('%', #{phone}, '%')
|
||
|
|
</if>
|
||
|
|
<if test="orgId != null and orgId != ''">
|
||
|
|
and t.org_id = #{orgId}
|
||
|
|
</if>
|
||
|
|
<if test="userType != null and userType != ''">
|
||
|
|
and t.user_type = #{userType}
|
||
|
|
</if>
|
||
|
|
order by t.del_flag ASC , t.state,t.create_time DESC
|
||
|
|
</select>
|
||
|
|
</mapper>
|