12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.idea.customerManagement.mapper.CustomerManagementExtendMapper">
- <select id="listByModel" resultType="com.idea.customerManagement.dto.CustomerManagementDto">
- select customer_management.*,
- concat(park_info.group_name,park_floor_disc.name) groupDiscName
- from customer_management
- left join park_info on park_info.id = customer_management.group_id
- left join park_floor_disc on park_floor_disc.id = customer_management.disc_id
- <where>
- <if test="buyerName != null and buyerName != ''">
- and buyer_name like concat ('%',#{buyerName},'%')
- </if>
- <if test="status != null and status != ''">
- and status = #{status}
- </if>
- <if test="groupIdList != null">
- and customer_management.group_id in
- <foreach collection="groupIdList" item="groupId" open="(" close=")" separator="," >
- #{groupId}
- </foreach>
- </if>
- <if test="discIdList != null">
- and disc_id in
- <foreach collection="discIdList" item="groupId" open="(" close=")" separator="," >
- #{groupId}
- </foreach>
- </if>
- </where>
- order by batch_number + 0 desc,room_selection_number + 0 asc
- </select>
- <select id="selectNeedSendList" resultType="com.idea.customerManagement.dto.CustomerManagementDto">
- select c.*,b.name buyerName,b.identity_card from customer_management c
- left join buyer b on c.id = b.customer_management_id and b.order_num = 1
- where c.ncid is null or c.ncid = ''
- </select>
- </mapper>
|