CustomMemberMapper.xml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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.CustomMemberMapper">
  4. <select id="queryUser" resultType="com.gree.mall.manager.bean.member.MemberBean">
  5. select ur.*
  6. from user ur
  7. left join enterprise_wechat_worker eww on eww.wechat_user_id = ur.work_user_id
  8. left join admin_websit aw on aw.id = eww.main_department
  9. where
  10. ur.status =1
  11. <if test=' companyWechatIds != null and companyWechatIds.size > 0' >
  12. and ur.company_wechat_id in
  13. <foreach collection="companyWechatIds" open="(" close=")" item="companyWechatId" separator=",">
  14. #{companyWechatId}
  15. </foreach>
  16. </if>
  17. <if test="type != null and type !=''">
  18. and ur.type = #{type}
  19. </if>
  20. <if test="startTime != null and endTime != null">
  21. and ur.create_time between #{startTime} and #{endTime}
  22. </if>
  23. <if test="keyword != null and keyword !=''">
  24. and (ur.nick_name like concat('%',#{keyword,jdbcType=VARCHAR},'%') or ur.mobile like
  25. concat('%',#{keyword,jdbcType=VARCHAR},'%'))
  26. </if>
  27. <if test="null != websitNos and websitNos.size > 0">
  28. and aw.websit_number in
  29. <foreach item="item" index="index" collection="websitNos" open="(" separator=","
  30. close=")">
  31. #{item}
  32. </foreach>
  33. </if>
  34. order by ur.create_time
  35. </select>
  36. </mapper>