ContractChangePlanRoomServiceDaoImplMapper.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="contractChangePlanRoomServiceDaoImpl">
  6. <!-- 保存合同房屋变更信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveContractChangePlanRoomInfo" parameterType="Map">
  8. insert into contract_change_plan_room(
  9. operate,owner_name,contract_id,pr_id,plan_id,owner_id,store_id,room_id,room_name
  10. ) values (
  11. #{operate},#{ownerName},#{contractId},#{prId},#{planId},#{ownerId},#{storeId},#{roomId},#{roomName}
  12. )
  13. </insert>
  14. <!-- 查询合同房屋变更信息 add by wuxw 2018-07-03 -->
  15. <select id="getContractChangePlanRoomInfo" parameterType="Map" resultType="Map">
  16. select t.owner_name,t.owner_name ownerName,t.contract_id,t.contract_id contractId,t.pr_id,t.pr_id prId,t.plan_id,
  17. t.plan_id planId,t.status_cd,t.status_cd statusCd,t.owner_id,t.owner_id
  18. ownerId,t.store_id,t.store_id storeId,t.room_id,t.room_id roomId,t.room_name,t.room_name roomName,t.operate
  19. from contract_change_plan_room t
  20. where 1 =1
  21. <if test="ownerName !=null and ownerName != ''">
  22. and t.owner_name= #{ownerName}
  23. </if>
  24. <if test="contractId !=null and contractId != ''">
  25. and t.contract_id= #{contractId}
  26. </if>
  27. <if test="prId !=null and prId != ''">
  28. and t.pr_id= #{prId}
  29. </if>
  30. <if test="planId !=null and planId != ''">
  31. and t.plan_id= #{planId}
  32. </if>
  33. <if test="statusCd !=null and statusCd != ''">
  34. and t.status_cd= #{statusCd}
  35. </if>
  36. <if test="ownerId !=null and ownerId != ''">
  37. and t.owner_id= #{ownerId}
  38. </if>
  39. <if test="storeId !=null and storeId != ''">
  40. and t.store_id= #{storeId}
  41. </if>
  42. <if test="roomId !=null and roomId != ''">
  43. and t.room_id= #{roomId}
  44. </if>
  45. <if test="roomName !=null and roomName != ''">
  46. and t.room_name= #{roomName}
  47. </if>
  48. <if test="operate !=null and operate != ''">
  49. and t.operate= #{operate}
  50. </if>
  51. order by t.create_time desc
  52. <if test="page != -1 and page != null ">
  53. limit #{page}, #{row}
  54. </if>
  55. </select>
  56. <!-- 修改合同房屋变更信息 add by wuxw 2018-07-03 -->
  57. <update id="updateContractChangePlanRoomInfo" parameterType="Map">
  58. update contract_change_plan_room t set t.status_cd = #{statusCd}
  59. <if test="newBId != null and newBId != ''">
  60. ,t.b_id = #{newBId}
  61. </if>
  62. <if test="ownerName !=null and ownerName != ''">
  63. , t.owner_name= #{ownerName}
  64. </if>
  65. <if test="contractId !=null and contractId != ''">
  66. , t.contract_id= #{contractId}
  67. </if>
  68. <if test="planId !=null and planId != ''">
  69. , t.plan_id= #{planId}
  70. </if>
  71. <if test="ownerId !=null and ownerId != ''">
  72. , t.owner_id= #{ownerId}
  73. </if>
  74. <if test="storeId !=null and storeId != ''">
  75. , t.store_id= #{storeId}
  76. </if>
  77. <if test="roomId !=null and roomId != ''">
  78. , t.room_id= #{roomId}
  79. </if>
  80. <if test="roomName !=null and roomName != ''">
  81. , t.room_name= #{roomName}
  82. </if>
  83. where 1=1
  84. <if test="prId !=null and prId != ''">
  85. and t.pr_id= #{prId}
  86. </if>
  87. </update>
  88. <!-- 查询合同房屋变更数量 add by wuxw 2018-07-03 -->
  89. <select id="queryContractChangePlanRoomsCount" parameterType="Map" resultType="Map">
  90. select count(1) count
  91. from contract_change_plan_room t
  92. where 1 =1
  93. <if test="ownerName !=null and ownerName != ''">
  94. and t.owner_name= #{ownerName}
  95. </if>
  96. <if test="contractId !=null and contractId != ''">
  97. and t.contract_id= #{contractId}
  98. </if>
  99. <if test="prId !=null and prId != ''">
  100. and t.pr_id= #{prId}
  101. </if>
  102. <if test="planId !=null and planId != ''">
  103. and t.plan_id= #{planId}
  104. </if>
  105. <if test="statusCd !=null and statusCd != ''">
  106. and t.status_cd= #{statusCd}
  107. </if>
  108. <if test="ownerId !=null and ownerId != ''">
  109. and t.owner_id= #{ownerId}
  110. </if>
  111. <if test="storeId !=null and storeId != ''">
  112. and t.store_id= #{storeId}
  113. </if>
  114. <if test="roomId !=null and roomId != ''">
  115. and t.room_id= #{roomId}
  116. </if>
  117. <if test="roomName !=null and roomName != ''">
  118. and t.room_name= #{roomName}
  119. </if>
  120. </select>
  121. </mapper>