RepairSettingServiceDaoImplMapper.xml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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="repairSettingServiceDaoImpl">
  6. <!-- 保存报修设置信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessRepairSettingInfo" parameterType="Map">
  8. insert into business_repair_setting(
  9. operate,repair_type_name,repair_type,remark,b_id,community_id,repair_way,setting_id,public_area,pay_fee_flag,price_scope,return_visit_flag
  10. ) values (
  11. #{operate},#{repairTypeName},#{repairType},#{remark},#{bId},#{communityId},#{repairWay},#{settingId},#{publicArea},#{payFeeFlag},#{priceScope},#{returnVisitFlag}
  12. )
  13. </insert>
  14. <!-- 查询报修设置信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessRepairSettingInfo" parameterType="Map" resultType="Map">
  16. select t.operate,t.repair_type_name,t.repair_type_name repairTypeName,t.repair_type,t.repair_type
  17. repairType,t.remark,t.b_id,t.b_id bId,t.community_id,t.community_id communityId,t.repair_way,t.repair_way
  18. repairWay,t.setting_id,t.setting_id settingId,t.public_area,t.public_area publicArea,t.pay_fee_flag,t.pay_fee_flag payFeeFlag
  19. ,t.price_scope,t.price_scope priceScope,t.return_visit_flag,t.return_visit_flag returnVisitFlag
  20. from business_repair_setting t
  21. where 1 =1
  22. <if test="operate !=null and operate != ''">
  23. and t.operate= #{operate}
  24. </if>
  25. <if test="repairTypeName !=null and repairTypeName != ''">
  26. and t.repair_type_name= #{repairTypeName}
  27. </if>
  28. <if test="repairType !=null and repairType != ''">
  29. and t.repair_type= #{repairType}
  30. </if>
  31. <if test="remark !=null and remark != ''">
  32. and t.remark= #{remark}
  33. </if>
  34. <if test="bId !=null and bId != ''">
  35. and t.b_id= #{bId}
  36. </if>
  37. <if test="communityId !=null and communityId != ''">
  38. and t.community_id= #{communityId}
  39. </if>
  40. <if test="repairWay !=null and repairWay != ''">
  41. and t.repair_way= #{repairWay}
  42. </if>
  43. <if test="settingId !=null and settingId != ''">
  44. and t.setting_id= #{settingId}
  45. </if>
  46. </select>
  47. <!-- 保存报修设置信息至 instance表中 add by wuxw 2018-07-03 -->
  48. <insert id="saveRepairSettingInfoInstance" parameterType="Map">
  49. insert into r_repair_setting(
  50. repair_type_name,repair_type,remark,status_cd,b_id,community_id,repair_way,setting_id,public_area,pay_fee_flag,price_scope,return_visit_flag
  51. ) select t.repair_type_name,t.repair_type,t.remark,'0',t.b_id,t.community_id,t.repair_way,t.setting_id ,t.public_area,t.pay_fee_flag,t.price_scope,t.return_visit_flag
  52. from
  53. business_repair_setting t where 1=1
  54. and t.operate= 'ADD'
  55. <if test="repairTypeName !=null and repairTypeName != ''">
  56. and t.repair_type_name= #{repairTypeName}
  57. </if>
  58. <if test="repairType !=null and repairType != ''">
  59. and t.repair_type= #{repairType}
  60. </if>
  61. <if test="remark !=null and remark != ''">
  62. and t.remark= #{remark}
  63. </if>
  64. <if test="bId !=null and bId != ''">
  65. and t.b_id= #{bId}
  66. </if>
  67. <if test="communityId !=null and communityId != ''">
  68. and t.community_id= #{communityId}
  69. </if>
  70. <if test="repairWay !=null and repairWay != ''">
  71. and t.repair_way= #{repairWay}
  72. </if>
  73. <if test="settingId !=null and settingId != ''">
  74. and t.setting_id= #{settingId}
  75. </if>
  76. </insert>
  77. <!-- 查询报修设置信息 add by wuxw 2018-07-03 -->
  78. <select id="getRepairSettingInfo" parameterType="Map" resultType="Map">
  79. select t.repair_type_name,t.repair_type_name repairTypeName,t.repair_type,t.repair_type
  80. repairType,t.remark,t.status_cd,t.status_cd statusCd,t.b_id,t.b_id bId,t.community_id,t.community_id
  81. communityId,t.repair_way,t.repair_way repairWay,t.setting_id,t.setting_id settingId,t.create_time createTime,d.name repairWayName,
  82. t.public_area,t.public_area publicArea,t.pay_fee_flag,t.pay_fee_flag payFeeFlag
  83. ,t.price_scope,t.price_scope priceScope,t.return_visit_flag,t.return_visit_flag returnVisitFlag,d1.name returnVisitFlagName
  84. from r_repair_setting t
  85. left join t_dict d on t.repair_way = d.status_cd and d.table_name = 'r_repair_setting' and d.table_columns = 'repair_way'
  86. left join t_dict d1 on t.return_visit_flag = d1.status_cd and d1.table_name = 'r_repair_setting' and d1.table_columns = 'return_visit_flag'
  87. where 1 =1
  88. <if test="repairTypeName !=null and repairTypeName != ''">
  89. and t.repair_type_name= #{repairTypeName}
  90. </if>
  91. <if test="repairType !=null and repairType != ''">
  92. and t.repair_type= #{repairType}
  93. </if>
  94. <if test="remark !=null and remark != ''">
  95. and t.remark= #{remark}
  96. </if>
  97. <if test="statusCd !=null and statusCd != ''">
  98. and t.status_cd= #{statusCd}
  99. </if>
  100. <if test="bId !=null and bId != ''">
  101. and t.b_id= #{bId}
  102. </if>
  103. <if test="communityId !=null and communityId != ''">
  104. and t.community_id= #{communityId}
  105. </if>
  106. <if test="repairWay !=null and repairWay != ''">
  107. and t.repair_way= #{repairWay}
  108. </if>
  109. <if test="settingId !=null and settingId != ''">
  110. and t.setting_id= #{settingId}
  111. </if>
  112. <if test="publicArea !=null and publicArea != ''">
  113. and t.public_area= #{publicArea}
  114. </if>
  115. <if test="payFeeFlag !=null and payFeeFlag != ''">
  116. and t.pay_fee_flag= #{payFeeFlag}
  117. </if>
  118. <if test="returnVisitFlag !=null and returnVisitFlag != ''">
  119. and t.return_visit_flag= #{returnVisitFlag}
  120. </if>
  121. order by t.create_time desc
  122. <if test="page != -1 and page != null ">
  123. limit #{page}, #{row}
  124. </if>
  125. </select>
  126. <!-- 修改报修设置信息 add by wuxw 2018-07-03 -->
  127. <update id="updateRepairSettingInfoInstance" parameterType="Map">
  128. update r_repair_setting t set t.status_cd = #{statusCd}
  129. <if test="newBId != null and newBId != ''">
  130. ,t.b_id = #{newBId}
  131. </if>
  132. <if test="repairTypeName !=null and repairTypeName != ''">
  133. , t.repair_type_name= #{repairTypeName}
  134. </if>
  135. <if test="repairType !=null and repairType != ''">
  136. , t.repair_type= #{repairType}
  137. </if>
  138. <if test="remark !=null and remark != ''">
  139. , t.remark= #{remark}
  140. </if>
  141. <if test="communityId !=null and communityId != ''">
  142. , t.community_id= #{communityId}
  143. </if>
  144. <if test="repairWay !=null and repairWay != ''">
  145. , t.repair_way= #{repairWay}
  146. </if>
  147. <if test="publicArea !=null and publicArea != ''">
  148. , t.public_area= #{publicArea}
  149. </if>
  150. <if test="payFeeFlag !=null and payFeeFlag != ''">
  151. , t.pay_fee_flag= #{payFeeFlag}
  152. </if>
  153. <if test="returnVisitFlag !=null and returnVisitFlag != ''">
  154. , t.return_visit_flag= #{returnVisitFlag}
  155. </if>
  156. <if test="priceScope !=null and priceScope != ''">
  157. , t.price_scope= #{priceScope}
  158. </if>
  159. where 1=1
  160. <if test="bId !=null and bId != ''">
  161. and t.b_id= #{bId}
  162. </if>
  163. <if test="settingId !=null and settingId != ''">
  164. and t.setting_id= #{settingId}
  165. </if>
  166. </update>
  167. <!-- 查询报修设置数量 add by wuxw 2018-07-03 -->
  168. <select id="queryRepairSettingsCount" parameterType="Map" resultType="Map">
  169. select count(1) count
  170. from r_repair_setting t
  171. left join t_dict d on t.repair_way = d.status_cd and d.table_name = 'r_repair_setting' and d.table_columns = 'repair_way'
  172. where 1 =1
  173. <if test="repairTypeName !=null and repairTypeName != ''">
  174. and t.repair_type_name= #{repairTypeName}
  175. </if>
  176. <if test="repairType !=null and repairType != ''">
  177. and t.repair_type= #{repairType}
  178. </if>
  179. <if test="remark !=null and remark != ''">
  180. and t.remark= #{remark}
  181. </if>
  182. <if test="statusCd !=null and statusCd != ''">
  183. and t.status_cd= #{statusCd}
  184. </if>
  185. <if test="bId !=null and bId != ''">
  186. and t.b_id= #{bId}
  187. </if>
  188. <if test="communityId !=null and communityId != ''">
  189. and t.community_id= #{communityId}
  190. </if>
  191. <if test="repairWay !=null and repairWay != ''">
  192. and t.repair_way= #{repairWay}
  193. </if>
  194. <if test="settingId !=null and settingId != ''">
  195. and t.setting_id= #{settingId}
  196. </if>
  197. <if test="publicArea !=null and publicArea != ''">
  198. and t.public_area= #{publicArea}
  199. </if>
  200. <if test="payFeeFlag !=null and payFeeFlag != ''">
  201. and t.pay_fee_flag= #{payFeeFlag}
  202. </if>
  203. <if test="returnVisitFlag !=null and returnVisitFlag != ''">
  204. and t.return_visit_flag= #{returnVisitFlag}
  205. </if>
  206. </select>
  207. </mapper>