日照智慧社区接口服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
2.2 KiB

<?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'
6 years ago
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>
<!-- 根据staffid查询用户基本信息 -->
<select id="selectByUserId" parameterType="java.lang.String" resultType="com.epmet.entity.CustomerStaffEntity">
SELECT
*
FROM
customer_staff CS
WHERE
cs.DEL_FLAG = '0'
AND CS.USER_ID =#{userId}
</select>
</mapper>