RoomSelectionInfoExtendMapper.xml 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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.RoomSelectionInfoExtendMapper">
  4. <select id="selectHouseList" resultType="com.idea.customerManagement.dto.RoomSelectionInfoDto">
  5. select room_selection_info.*,
  6. mnp_building.build_num buildName,
  7. park_room.room_no,
  8. park_room.actual_internal_area,
  9. park_room.actual_build_area,
  10. park_room.decoration_situation,
  11. frame_user.truename createdName,
  12. customer_management.buyer_name,
  13. (select id from intentional_deposit
  14. where customer_management_id = room_selection_info.customer_management_id and `status` != 3) as intentional_deposit_id
  15. from room_selection_info
  16. left join mnp_building on mnp_building.id = room_selection_info.build_id
  17. left join park_room on park_room.id = room_selection_info.house_id
  18. left join frame_user on frame_user.id = room_selection_info.created_id
  19. left join customer_management on customer_management.id = room_selection_info.customer_management_id
  20. <where>
  21. <if test="customerManagementId !=null and customerManagementId != ''">
  22. and room_selection_info.customer_management_id = #{customerManagementId}
  23. </if>
  24. <if test="id !=null and id != ''">
  25. and room_selection_info.id = #{id}
  26. </if>
  27. </where>
  28. </select>
  29. <select id="listByModel" resultType="com.idea.customerManagement.dto.RoomSelectionInfoDto">
  30. select room_selection_info.*,
  31. mnp_building.build_num buildName,
  32. park_room.room_no,
  33. frame_user.truename createdName,
  34. cm.buyer_name,
  35. date_format(cm.room_selection_date,'%Y-%m-%d') as room_selection_date,
  36. concat(park_info.group_name,'-',park_floor_disc.name) groupDiscName
  37. from room_selection_info
  38. left join park_room on park_room.id = room_selection_info.house_id
  39. left join mnp_building on mnp_building.id = room_selection_info.build_id
  40. left join park_info on park_info.id = room_selection_info.group_id
  41. left join park_floor_disc on park_floor_disc.id = room_selection_info.disc_id
  42. left join frame_user on frame_user.id = room_selection_info.created_id
  43. left join customer_management cm on cm.id = room_selection_info.customer_management_id
  44. <where>
  45. <if test="buyerName != null and buyerName != ''">
  46. and room_selection_info.customer_management_id in (select customer_management_id from buyer where name like concat('%',#{buyerName},'%'))
  47. </if>
  48. <if test="statusStr != null and statusStr != ''">
  49. and room_selection_info.status in (${statusStr})
  50. </if>
  51. <if test="discIdList != null">
  52. and room_selection_info.disc_id in
  53. <foreach collection="discIdList" item="discId" separator="," open="(" close=")">
  54. #{discId}
  55. </foreach>
  56. </if>
  57. <if test="customerManagementId !=null and customerManagementId != ''">
  58. and room_selection_info.customer_management_id = #{customerManagementId}
  59. </if>
  60. <if test="roomNo !=null and roomNo != ''">
  61. and park_room.room_no like concat('%',#{roomNo},'%')
  62. </if>
  63. <if test="status !=null and status != ''">
  64. and room_selection_info.status = #{status}
  65. </if>
  66. <if test="houseId !=null and houseId != ''">
  67. and room_selection_info.house_id = #{houseId}
  68. </if>
  69. <if test="buyerIdentityCard != null and buyerIdentityCard != ''">
  70. and cm.buyer_identity_card like concat('%',#{buyerIdentityCard},'%')
  71. </if>
  72. <if test="batchNumber != null and batchNumber != ''">
  73. and cm.batch_number like concat('%',#{batchNumber},'%')
  74. </if>
  75. </where>
  76. order by park_room.group_name , park_room.disc_name , park_room.build_name , park_room.room_no + 0
  77. </select>
  78. </mapper>