OwnerCarAttrServiceDaoImplMapper.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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="ownerCarAttrServiceDaoImpl">
  6. <!-- 保存业主车辆属性信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessOwnerCarAttrInfo" parameterType="Map">
  8. insert into business_owner_car_attr(
  9. attr_id,operate,create_time,spec_cd,community_id,b_id,value,car_id
  10. ) values (
  11. #{attrId},#{operate},#{createTime},#{specCd},#{communityId},#{bId},#{value},#{carId}
  12. )
  13. </insert>
  14. <!-- 查询业主车辆属性信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessOwnerCarAttrInfo" parameterType="Map" resultType="Map">
  16. select t.attr_id,t.attr_id attrId,t.operate,t.create_time,t.create_time createTime,t.spec_cd,t.spec_cd specCd,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.value,t.car_id,t.car_id carId
  17. from business_owner_car_attr t
  18. where 1 =1
  19. <if test="attrId !=null and attrId != ''">
  20. and t.attr_id= #{attrId}
  21. </if>
  22. <if test="operate !=null and operate != ''">
  23. and t.operate= #{operate}
  24. </if>
  25. <if test="createTime !=null and createTime != ''">
  26. and t.create_time= #{createTime}
  27. </if>
  28. <if test="specCd !=null and specCd != ''">
  29. and t.spec_cd= #{specCd}
  30. </if>
  31. <if test="communityId !=null and communityId != ''">
  32. and t.community_id= #{communityId}
  33. </if>
  34. <if test="bId !=null and bId != ''">
  35. and t.b_id= #{bId}
  36. </if>
  37. <if test="value !=null and value != ''">
  38. and t.value= #{value}
  39. </if>
  40. <if test="carId !=null and carId != ''">
  41. and t.car_id= #{carId}
  42. </if>
  43. </select>
  44. <!-- 保存业主车辆属性信息至 instance表中 add by wuxw 2018-07-03 -->
  45. <insert id="saveOwnerCarAttrInfoInstance" parameterType="Map">
  46. insert into owner_car_attr(
  47. attr_id,create_time,spec_cd,status_cd,community_id,b_id,value,car_id
  48. ) select t.attr_id,t.create_time,t.spec_cd,'0',t.community_id,t.b_id,t.value,t.car_id from business_owner_car_attr t where 1=1
  49. <if test="attrId !=null and attrId != ''">
  50. and t.attr_id= #{attrId}
  51. </if>
  52. and t.operate= 'ADD'
  53. <if test="createTime !=null and createTime != ''">
  54. and t.create_time= #{createTime}
  55. </if>
  56. <if test="specCd !=null and specCd != ''">
  57. and t.spec_cd= #{specCd}
  58. </if>
  59. <if test="communityId !=null and communityId != ''">
  60. and t.community_id= #{communityId}
  61. </if>
  62. <if test="bId !=null and bId != ''">
  63. and t.b_id= #{bId}
  64. </if>
  65. <if test="value !=null and value != ''">
  66. and t.value= #{value}
  67. </if>
  68. <if test="carId !=null and carId != ''">
  69. and t.car_id= #{carId}
  70. </if>
  71. </insert>
  72. <!-- 查询业主车辆属性信息 add by wuxw 2018-07-03 -->
  73. <select id="getOwnerCarAttrInfo" parameterType="Map" resultType="Map">
  74. select t.attr_id,t.attr_id attrId,t.create_time,t.create_time createTime,t.spec_cd,t.spec_cd specCd,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.value,t.car_id,t.car_id carId
  75. from owner_car_attr t
  76. where 1 =1
  77. <if test="attrId !=null and attrId != ''">
  78. and t.attr_id= #{attrId}
  79. </if>
  80. <if test="createTime !=null and createTime != ''">
  81. and t.create_time= #{createTime}
  82. </if>
  83. <if test="specCd !=null and specCd != ''">
  84. and t.spec_cd= #{specCd}
  85. </if>
  86. <if test="statusCd !=null and statusCd != ''">
  87. and t.status_cd= #{statusCd}
  88. </if>
  89. <if test="communityId !=null and communityId != ''">
  90. and t.community_id= #{communityId}
  91. </if>
  92. <if test="bId !=null and bId != ''">
  93. and t.b_id= #{bId}
  94. </if>
  95. <if test="value !=null and value != ''">
  96. and t.value= #{value}
  97. </if>
  98. <if test="carId !=null and carId != ''">
  99. and t.car_id= #{carId}
  100. </if>
  101. order by t.create_time desc
  102. <if test="page != -1 and page != null ">
  103. limit #{page}, #{row}
  104. </if>
  105. </select>
  106. <!-- 修改业主车辆属性信息 add by wuxw 2018-07-03 -->
  107. <update id="updateOwnerCarAttrInfoInstance" parameterType="Map">
  108. update owner_car_attr t set t.status_cd = #{statusCd}
  109. <if test="newBId != null and newBId != ''">
  110. ,t.b_id = #{newBId}
  111. </if>
  112. <if test="createTime !=null and createTime != ''">
  113. , t.create_time= #{createTime}
  114. </if>
  115. <if test="specCd !=null and specCd != ''">
  116. , t.spec_cd= #{specCd}
  117. </if>
  118. <if test="communityId !=null and communityId != ''">
  119. , t.community_id= #{communityId}
  120. </if>
  121. <if test="value !=null and value != ''">
  122. , t.value= #{value}
  123. </if>
  124. <if test="carId !=null and carId != ''">
  125. , t.car_id= #{carId}
  126. </if>
  127. where 1=1 <if test="attrId !=null and attrId != ''">
  128. and t.attr_id= #{attrId}
  129. </if>
  130. <if test="bId !=null and bId != ''">
  131. and t.b_id= #{bId}
  132. </if>
  133. </update>
  134. <!-- 查询业主车辆属性数量 add by wuxw 2018-07-03 -->
  135. <select id="queryOwnerCarAttrsCount" parameterType="Map" resultType="Map">
  136. select count(1) count
  137. from owner_car_attr t
  138. where 1 =1
  139. <if test="attrId !=null and attrId != ''">
  140. and t.attr_id= #{attrId}
  141. </if>
  142. <if test="createTime !=null and createTime != ''">
  143. and t.create_time= #{createTime}
  144. </if>
  145. <if test="specCd !=null and specCd != ''">
  146. and t.spec_cd= #{specCd}
  147. </if>
  148. <if test="statusCd !=null and statusCd != ''">
  149. and t.status_cd= #{statusCd}
  150. </if>
  151. <if test="communityId !=null and communityId != ''">
  152. and t.community_id= #{communityId}
  153. </if>
  154. <if test="bId !=null and bId != ''">
  155. and t.b_id= #{bId}
  156. </if>
  157. <if test="value !=null and value != ''">
  158. and t.value= #{value}
  159. </if>
  160. <if test="carId !=null and carId != ''">
  161. and t.car_id= #{carId}
  162. </if>
  163. </select>
  164. </mapper>