| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?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.RoomSelectionInfoExtendMapper">
- <select id="selectHouseList" resultType="com.idea.customerManagement.dto.RoomSelectionInfoDto">
- select room_selection_info.*,
- mnp_building.build_num buildName,
- park_room.room_no,
- park_room.actual_internal_area,
- park_room.actual_build_area,
- park_room.decoration_situation,
- frame_user.truename createdName,
- customer_management.buyer_name,
- (select id from intentional_deposit
- where customer_management_id = room_selection_info.customer_management_id and `status` != 3) as intentional_deposit_id
- from room_selection_info
- left join mnp_building on mnp_building.id = room_selection_info.build_id
- left join park_room on park_room.id = room_selection_info.house_id
- left join frame_user on frame_user.id = room_selection_info.created_id
- left join customer_management on customer_management.id = room_selection_info.customer_management_id
- <where>
- <if test="customerManagementId !=null and customerManagementId != ''">
- and room_selection_info.customer_management_id = #{customerManagementId}
- </if>
- <if test="id !=null and id != ''">
- and room_selection_info.id = #{id}
- </if>
- </where>
- </select>
- <select id="listByModel" resultType="com.idea.customerManagement.dto.RoomSelectionInfoDto">
- select room_selection_info.*,
- mnp_building.build_num buildName,
- park_room.room_no,
- frame_user.truename createdName,
- cm.buyer_name,
- date_format(cm.room_selection_date,'%Y-%m-%d') as room_selection_date,
- concat(park_info.group_name,'-',park_floor_disc.name) groupDiscName
- from room_selection_info
- left join park_room on park_room.id = room_selection_info.house_id
- left join mnp_building on mnp_building.id = room_selection_info.build_id
- left join park_info on park_info.id = room_selection_info.group_id
- left join park_floor_disc on park_floor_disc.id = room_selection_info.disc_id
- left join frame_user on frame_user.id = room_selection_info.created_id
- left join customer_management cm on cm.id = room_selection_info.customer_management_id
- <where>
- <if test="buyerName != null and buyerName != ''">
- and room_selection_info.customer_management_id in (select customer_management_id from buyer where name like concat('%',#{buyerName},'%'))
- </if>
- <if test="statusStr != null and statusStr != ''">
- and room_selection_info.status in (${statusStr})
- </if>
- <if test="discIdList != null">
- and room_selection_info.disc_id in
- <foreach collection="discIdList" item="discId" separator="," open="(" close=")">
- #{discId}
- </foreach>
- </if>
- <if test="customerManagementId !=null and customerManagementId != ''">
- and room_selection_info.customer_management_id = #{customerManagementId}
- </if>
- <if test="roomNo !=null and roomNo != ''">
- and park_room.room_no like concat('%',#{roomNo},'%')
- </if>
- <if test="status !=null and status != ''">
- and room_selection_info.status = #{status}
- </if>
- <if test="houseId !=null and houseId != ''">
- and room_selection_info.house_id = #{houseId}
- </if>
- <if test="buyerIdentityCard != null and buyerIdentityCard != ''">
- and cm.buyer_identity_card like concat('%',#{buyerIdentityCard},'%')
- </if>
- <if test="batchNumber != null and batchNumber != ''">
- and cm.batch_number like concat('%',#{batchNumber},'%')
- </if>
- </where>
- order by park_room.group_name , park_room.disc_name , park_room.build_name , park_room.room_no + 0
- </select>
- </mapper>
|