ThirdPartWeComStaffMapperExt.xml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ext.ThirdPartWeComStaffMapperExt">
  4. <select id="getAccountCount" resultType="java.lang.Integer">
  5. select count(1)
  6. from third_part_we_com_staff staff
  7. join third_part_we_com_corp corp on staff.corp_id = corp.id
  8. <where>
  9. <trim prefixOverrides="and">
  10. <if test="param.corpName != null">
  11. and corp.name like concat('%', #{param.corpName}, '%')
  12. </if>
  13. <if test="param.accountName != null">
  14. and staff.name like concat('%', #{param.accountName}, '%')
  15. </if>
  16. <if test="param.mobile != null">
  17. and staff.mobile = #{param.mobile}
  18. </if>
  19. </trim>
  20. </where>
  21. </select>
  22. <select id="getAccountList"
  23. resultType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComStaff">
  24. select staff.*
  25. from third_part_we_com_staff staff
  26. join third_part_we_com_corp corp on staff.corp_id = corp.id
  27. <where>
  28. <trim prefixOverrides="and">
  29. <if test="param.corpName != null">
  30. and corp.name like concat('%', #{param.corpName}, '%')
  31. </if>
  32. <if test="param.accountName != null">
  33. and staff.name like concat('%', #{param.accountName}, '%')
  34. </if>
  35. <if test="param.mobile != null">
  36. and staff.mobile = #{param.mobile}
  37. </if>
  38. </trim>
  39. </where>
  40. order by staff.id desc
  41. limit #{offset}, #{pageSize}
  42. </select>
  43. <select id="getPushStaffList"
  44. resultType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComStaff">
  45. select staff.*
  46. from third_part_we_com_staff staff
  47. join (
  48. select distinct staff.name, staff.third_staff_id, staff.id
  49. from third_part_we_com_room room
  50. join third_part_we_com_room_user room_user on room.third_room_id = room_user.third_room_id
  51. join third_part_we_com_staff staff on staff.third_staff_id = room_user.uin
  52. where room.staff_id = #{accountId}
  53. <if test="roomId != null and roomId != ''">
  54. and room.id = #{roomId}
  55. </if>
  56. ) t2 on staff.id = t2.id
  57. where staff.status = 0
  58. <if test="name != null and name != ''">
  59. and staff.name like concat('%', #{name}, '%')
  60. </if>
  61. </select>
  62. <select id="getStaffIdByName" resultType="java.lang.Long">
  63. select third_staff_id
  64. from third_part_we_com_staff
  65. where name like concat('%', #{name}, '%')
  66. </select>
  67. </mapper>