|
|
|
<?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.epmet.dao.CustomerStaffDao">
|
|
|
|
|
|
|
|
<!-- 根据手机号查询工作人员信息 -->
|
|
|
|
<select id="selectListCustomerStaffDTO" parameterType="java.lang.String" resultType="com.epmet.dto.CustomerStaffDTO">
|
|
|
|
select * from customer_staff cs
|
|
|
|
where cs.MOBILE=#{mobile}
|
|
|
|
and cs.DEL_FLAG='0'
|
|
|
|
order by cs.ACTIVE_TIME desc,cs.CREATED_TIME asc
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 根据手机号+客户id获取工作人员基本信息 -->
|
|
|
|
<select id="selectListCustomerStaffInfo" parameterType="com.epmet.dto.form.CustomerStaffFormDTO" resultType="com.epmet.dto.CustomerStaffDTO">
|
|
|
|
select * from customer_staff cs
|
|
|
|
where cs.MOBILE=#{mobile}
|
|
|
|
and cs.CUSTOMER_ID=#{customerId}
|
|
|
|
and cs.DEL_FLAG='0'
|
|
|
|
</select>
|
|
|
|
<select id="selectStaffInfoByUserId" parameterType="com.epmet.dto.CustomerStaffDTO" resultType="com.epmet.dto.CustomerStaffDTO">
|
|
|
|
select * from customer_staff cs
|
|
|
|
where cs.USER_ID=#{userId}
|
|
|
|
and cs.DEL_FLAG='0'
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 根据userId查询网格下的用户信息 -->
|
|
|
|
<select id="selectStaffGridListByUserId" parameterType="com.epmet.dto.CustomerStaffGridDTO" resultType="com.epmet.dto.StaffGridListDTO">
|
|
|
|
SELECT
|
|
|
|
cs.id AS staffId,
|
|
|
|
cs.real_name AS staffName,
|
|
|
|
cs.head_photo AS staffHeadPhoto,
|
|
|
|
gsr.role_name AS roleName
|
|
|
|
FROM
|
|
|
|
customer_staff cs
|
|
|
|
LEFT JOIN gov_staff_role gsr ON cs.user_id = gsr.id
|
|
|
|
WHERE
|
|
|
|
cs.user_id in
|
|
|
|
<foreach collection="list" item="staff" open="(" separator="," close=")">
|
|
|
|
#{staff.userId}
|
|
|
|
</foreach>
|
|
|
|
AND cs.del_flag = 0
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 根据UserId列表查询用户Id、头像、昵称,过滤掉被禁用的,包含未激活的-->
|
|
|
|
<select id="selectEnableStaffMsg" resultType="com.epmet.dto.result.CommonStaffInfoResultDTO">
|
|
|
|
SELECT
|
|
|
|
USER_ID AS staffId,
|
|
|
|
REAL_NAME AS staffName,
|
|
|
|
HEAD_PHOTO AS staffHeadPhoto ,
|
|
|
|
GENDER
|
|
|
|
FROM
|
|
|
|
CUSTOMER_STAFF
|
|
|
|
WHERE
|
|
|
|
DEL_FLAG = '0'
|
|
|
|
AND
|
|
|
|
ENABLE_FLAG = 'enable'
|
|
|
|
<foreach collection="userIds" item="userId" open="AND USER_ID IN (" separator="," close=")">
|
|
|
|
#{userId}
|
|
|
|
</foreach>
|
|
|
|
</select>
|
|
|
|
</mapper>
|