<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.panzhihua.westcommittee.dao.SystemUserMapper">
|
|
|
<select id="list" resultType="com.panzhihua.westcommittee.warpper.SystemUserListVo">
|
select distinct
|
a.id,
|
a.name,
|
a.phone,
|
f.`name` as systemPostName,
|
g.`name` as systemRoleName,
|
a.`status`,
|
h.name departmentName
|
from west_system_user a
|
left join west_system_post f on (a.system_post_id = f.id)
|
left join west_system_role g on (a.system_role_id = g.id)
|
left join west_department h on (a.one_department_id = h.id)
|
where a.`status` != 3
|
<if test="null != query.name and '' != query.name">
|
and a.name like CONCAT('%', #{query.name}, '%')
|
</if>
|
<if test="null != query.phone and '' != query.phone">
|
and a.phone like CONCAT('%', #{query.phone}, '%')
|
</if>
|
<if test="null != query.systemRoleId">
|
and a.system_role_id = #{query.systemRoleId}
|
</if>
|
<if test="null != query.deptId">
|
and a.one_department_id = #{query.deptId}
|
</if>
|
|
order by a.create_time desc
|
</select>
|
|
|
|
<select id="getRegion" resultType="com.panzhihua.westcommittee.model.vo.RegionVO">
|
select region_code as id, region_name as name from bc_region where parent_id = #{pcode}
|
</select>
|
|
|
<select id="getStreet" resultType="com.panzhihua.westcommittee.model.vo.RegionVO">
|
select CAST(street_id AS CHAR) as id, name as name from com_street where app_id ='wx0cef797390444b75'
|
</select>
|
|
|
<select id="getCommunity" resultType="com.panzhihua.westcommittee.model.vo.RegionVO">
|
select CAST(community_id AS CHAR) as id, name as name from com_act where street_id = #{streetId}
|
</select>
|
|
<select id="getCreateByIdPhone" resultType="java.lang.String">
|
select phone from sys_user where user_id = #{createBy}
|
</select>
|
<select id="list1" resultType="com.panzhihua.westcommittee.warpper.SystemUserListVo">
|
select distinct
|
a.id,
|
a.name,
|
a.phone,
|
f.`name` as systemPostName,
|
g.`name` as systemRoleName,
|
a.`status`,
|
h.name departmentName
|
from west_system_user a
|
left join west_system_post f on (a.system_post_id = f.id)
|
left join west_system_role g on (a.system_role_id = g.id)
|
left join west_department h on (a.one_department_id = h.id)
|
where a.`status` != 3
|
<if test="null != query.name and '' != query.name">
|
and a.name like CONCAT('%', #{query.name}, '%')
|
</if>
|
<if test="null != query.phone and '' != query.phone">
|
and a.phone like CONCAT('%', #{query.phone}, '%')
|
</if>
|
<if test="null != query.systemRoleId">
|
and a.system_role_id = #{query.systemRoleId}
|
</if>
|
and a.one_department_id in <foreach collection="deptIds" open="(" separator="," item="id" close=")">#{id}</foreach>
|
order by a.create_time desc
|
</select>
|
|
</mapper>
|