SysWechatCustomerMapper.xml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ydtech.modules.admin.dao.SysWechatCustomerMapper">
  6. <resultMap id="BaseResultMap" type="com.ydtech.modules.admin.model.po.SysWechatCustomer">
  7. <id property="id" column="id" jdbcType="INTEGER"/>
  8. <result property="nickname" column="nickname" jdbcType="VARCHAR"/>
  9. <result property="avatar" column="avatar" jdbcType="VARCHAR"/>
  10. <result property="userId" column="user_id" jdbcType="VARCHAR"/>
  11. <result property="receptionist" column="receptionist" jdbcType="VARCHAR"/>
  12. <result property="receptionistId" column="receptionist_id" jdbcType="VARCHAR"/>
  13. <result property="openKfId" column="open_kf_id" jdbcType="VARCHAR"/>
  14. <result property="dutyCustomerId" column="duty_customer_id" jdbcType="INTEGER"/>
  15. </resultMap>
  16. <sql id="Base_Column_List">
  17. id,nickname,avatar,
  18. user_id,receptionist,duty_customer_id
  19. </sql>
  20. <select id="getByNickname" resultType="com.ydtech.modules.admin.model.vo.wechat.SysWechatCustomerVo">
  21. select c.id as id,
  22. f.id as avatar,
  23. f.url as avatarUrl,
  24. c.nickname as nickname,
  25. u.name as username,
  26. u.id as userId,
  27. c.department_id as departmentId,
  28. c.receptionist as receptionist,
  29. c.receptionist_id as receptionistId,
  30. swc.nickname as dutyCustomer
  31. from sys_wechat_customer c
  32. left join sys_user u on u.id = c.user_id
  33. left join ins_upload_files f on f.id = c.avatar
  34. left join sys_wechat_customer swc on swc.id = c.duty_customer_id
  35. <if test="nickname != null and nickname != ''">
  36. where c.nickname = #{nickname}
  37. </if>
  38. order by c.id
  39. </select>
  40. </mapper>