EnterpriseWechatWorkerLogicMapper.xml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  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.gree.mall.manager.commonmapper.EnterpriseWechatWorkerLogicMapper">
  4. <select id="list" resultType="com.gree.mall.manager.bean.admin.EnterpriseWechatWorkerImportList">
  5. SELECT aw.websit_number as websitNum, eww.*
  6. FROM `enterprise_wechat_worker` eww
  7. left join admin_websit aw on eww.main_department = aw.websit_id and aw.corp_id = eww.corp_id
  8. <where>
  9. <if test="mainDepartmentIds != null and mainDepartmentIds.size > 0">
  10. and eww.main_department in
  11. <foreach collection="mainDepartmentIds" separator="," item="mdId" open="(" close=")">
  12. #{mdId}
  13. </foreach>
  14. </if>
  15. <if test="keyword != null and keyword != ''">
  16. and (
  17. eww.name like concat('%',#{keyword},'%')
  18. or eww.wechat_user_id like concat('%',#{keyword},'%')
  19. or eww.mobile like concat('%',#{keyword},'%')
  20. )
  21. </if>
  22. <if test="corpIds != null and corpIds.size > 0">
  23. and eww.corp_id in
  24. <foreach collection="corpIds" open="(" close=")" item="corpId" separator=",">
  25. #{corpId}
  26. </foreach>
  27. </if>
  28. <if test="corpId != null and corpId != ''">
  29. and eww.corp_id = #{corpId}
  30. </if>
  31. </where>
  32. GROUP BY eww.id
  33. order by eww.create_time desc
  34. </select>
  35. </mapper>