CustomerManagementExtendMapper.xml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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.idea.customerManagement.mapper.CustomerManagementExtendMapper">
  4. <select id="listByModel" resultType="com.idea.customerManagement.dto.CustomerManagementDto">
  5. select customer_management.*,
  6. concat(park_info.group_name,park_floor_disc.name) groupDiscName
  7. from customer_management
  8. left join park_info on park_info.id = customer_management.group_id
  9. left join park_floor_disc on park_floor_disc.id = customer_management.disc_id
  10. <where>
  11. <if test="buyerName != null and buyerName != ''">
  12. and buyer_name like concat ('%',#{buyerName},'%')
  13. </if>
  14. <if test="status != null and status != ''">
  15. and status = #{status}
  16. </if>
  17. <if test="groupIdList != null">
  18. and customer_management.group_id in
  19. <foreach collection="groupIdList" item="groupId" open="(" close=")" separator="," >
  20. #{groupId}
  21. </foreach>
  22. </if>
  23. <if test="discIdList != null">
  24. and disc_id in
  25. <foreach collection="discIdList" item="groupId" open="(" close=")" separator="," >
  26. #{groupId}
  27. </foreach>
  28. </if>
  29. </where>
  30. order by batch_number + 0 desc,room_selection_number + 0 asc
  31. </select>
  32. <select id="selectNeedSendList" resultType="com.idea.customerManagement.dto.CustomerManagementDto">
  33. select c.*,b.name buyerName,b.identity_card from customer_management c
  34. left join buyer b on c.id = b.customer_management_id and b.order_num = 1
  35. where c.ncid is null or c.ncid = ''
  36. </select>
  37. </mapper>