TempCarFeeConfigServiceDaoImplMapper.xml 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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="tempCarFeeConfigServiceDaoImpl">
  6. <!-- 保存临时车收费标准信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessTempCarFeeConfigInfo" parameterType="Map">
  8. insert into business_temp_car_fee_config(
  9. car_type,operate,config_id,fee_name,pa_id,area_num,start_time,end_time,b_id,rule_id,community_id
  10. ) values (
  11. #{carType},#{operate},#{configId},#{feeName},#{paId},#{areaNum},#{startTime},#{endTime},#{bId},#{ruleId},#{communityId}
  12. )
  13. </insert>
  14. <!-- 查询临时车收费标准信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessTempCarFeeConfigInfo" parameterType="Map" resultType="Map">
  16. select t.car_type,t.car_type carType,t.operate,t.config_id,t.config_id configId,t.fee_name,t.fee_name
  17. feeName,t.pa_id,t.pa_id paId,t.area_num,t.area_num areaNum,t.start_time,t.start_time
  18. startTime,t.end_time,t.end_time endTime,t.b_id,t.b_id bId,t.rule_id,t.rule_id
  19. ruleId,t.community_id,t.community_id communityId
  20. from business_temp_car_fee_config t
  21. where 1 =1
  22. <if test="carType !=null and carType != ''">
  23. and t.car_type= #{carType}
  24. </if>
  25. <if test="operate !=null and operate != ''">
  26. and t.operate= #{operate}
  27. </if>
  28. <if test="configId !=null and configId != ''">
  29. and t.config_id= #{configId}
  30. </if>
  31. <if test="feeName !=null and feeName != ''">
  32. and t.fee_name= #{feeName}
  33. </if>
  34. <if test="paId !=null and paId != ''">
  35. and t.pa_id= #{paId}
  36. </if>
  37. <if test="areaNum !=null and areaNum != ''">
  38. and t.area_num= #{areaNum}
  39. </if>
  40. <if test="startTime !=null and startTime != ''">
  41. and t.start_time= #{startTime}
  42. </if>
  43. <if test="endTime !=null and endTime != ''">
  44. and t.end_time= #{endTime}
  45. </if>
  46. <if test="bId !=null and bId != ''">
  47. and t.b_id= #{bId}
  48. </if>
  49. <if test="ruleId !=null and ruleId != ''">
  50. and t.rule_id= #{ruleId}
  51. </if>
  52. <if test="communityId !=null and communityId != ''">
  53. and t.community_id= #{communityId}
  54. </if>
  55. </select>
  56. <!-- 保存临时车收费标准信息至 instance表中 add by wuxw 2018-07-03 -->
  57. <insert id="saveTempCarFeeConfigInfoInstance" parameterType="Map">
  58. insert into temp_car_fee_config(
  59. car_type,config_id,fee_name,pa_id,area_num,status_cd,start_time,end_time,b_id,rule_id,community_id
  60. ) select
  61. t.car_type,t.config_id,t.fee_name,t.pa_id,t.area_num,'0',t.start_time,t.end_time,t.b_id,t.rule_id,t.community_id
  62. from business_temp_car_fee_config t where 1=1
  63. <if test="carType !=null and carType != ''">
  64. and t.car_type= #{carType}
  65. </if>
  66. and t.operate= 'ADD'
  67. <if test="configId !=null and configId != ''">
  68. and t.config_id= #{configId}
  69. </if>
  70. <if test="feeName !=null and feeName != ''">
  71. and t.fee_name= #{feeName}
  72. </if>
  73. <if test="paId !=null and paId != ''">
  74. and t.pa_id= #{paId}
  75. </if>
  76. <if test="areaNum !=null and areaNum != ''">
  77. and t.area_num= #{areaNum}
  78. </if>
  79. <if test="startTime !=null and startTime != ''">
  80. and t.start_time= #{startTime}
  81. </if>
  82. <if test="endTime !=null and endTime != ''">
  83. and t.end_time= #{endTime}
  84. </if>
  85. <if test="bId !=null and bId != ''">
  86. and t.b_id= #{bId}
  87. </if>
  88. <if test="ruleId !=null and ruleId != ''">
  89. and t.rule_id= #{ruleId}
  90. </if>
  91. <if test="communityId !=null and communityId != ''">
  92. and t.community_id= #{communityId}
  93. </if>
  94. </insert>
  95. <!-- 查询临时车收费标准信息 add by wuxw 2018-07-03 -->
  96. <select id="getTempCarFeeConfigInfo" parameterType="Map" resultType="Map">
  97. select t.car_type,t.car_type carType,t.config_id,t.config_id configId,t.fee_name,t.fee_name
  98. feeName,t.pa_id,t.pa_id paId,t.area_num,t.area_num areaNum,t.status_cd,t.status_cd
  99. statusCd,t.start_time,t.start_time startTime,t.end_time,t.end_time endTime,t.b_id,t.b_id bId,t.rule_id,t.rule_id
  100. ruleId,t.community_id,t.community_id communityId
  101. from temp_car_fee_config t
  102. where 1 =1
  103. <if test="carType !=null and carType != ''">
  104. and t.car_type= #{carType}
  105. </if>
  106. <if test="configId !=null and configId != ''">
  107. and t.config_id= #{configId}
  108. </if>
  109. <if test="feeName !=null and feeName != ''">
  110. and t.fee_name= #{feeName}
  111. </if>
  112. <if test="paId !=null and paId != ''">
  113. and t.pa_id= #{paId}
  114. </if>
  115. <if test="areaNum !=null and areaNum != ''">
  116. and t.area_num= #{areaNum}
  117. </if>
  118. <if test="statusCd !=null and statusCd != ''">
  119. and t.status_cd= #{statusCd}
  120. </if>
  121. <if test="startTime !=null and startTime != ''">
  122. and t.start_time= #{startTime}
  123. </if>
  124. <if test="endTime !=null and endTime != ''">
  125. and t.end_time= #{endTime}
  126. </if>
  127. <if test="bId !=null and bId != ''">
  128. and t.b_id= #{bId}
  129. </if>
  130. <if test="ruleId !=null and ruleId != ''">
  131. and t.rule_id= #{ruleId}
  132. </if>
  133. <if test="communityId !=null and communityId != ''">
  134. and t.community_id= #{communityId}
  135. </if>
  136. order by t.create_time desc
  137. <if test="page != -1 and page != null ">
  138. limit #{page}, #{row}
  139. </if>
  140. </select>
  141. <!-- 修改临时车收费标准信息 add by wuxw 2018-07-03 -->
  142. <update id="updateTempCarFeeConfigInfoInstance" parameterType="Map">
  143. update temp_car_fee_config t set t.status_cd = #{statusCd}
  144. <if test="newBId != null and newBId != ''">
  145. ,t.b_id = #{newBId}
  146. </if>
  147. <if test="carType !=null and carType != ''">
  148. , t.car_type= #{carType}
  149. </if>
  150. <if test="feeName !=null and feeName != ''">
  151. , t.fee_name= #{feeName}
  152. </if>
  153. <if test="paId !=null and paId != ''">
  154. , t.pa_id= #{paId}
  155. </if>
  156. <if test="areaNum !=null and areaNum != ''">
  157. , t.area_num= #{areaNum}
  158. </if>
  159. <if test="startTime !=null and startTime != ''">
  160. , t.start_time= #{startTime}
  161. </if>
  162. <if test="endTime !=null and endTime != ''">
  163. , t.end_time= #{endTime}
  164. </if>
  165. <if test="ruleId !=null and ruleId != ''">
  166. , t.rule_id= #{ruleId}
  167. </if>
  168. <if test="communityId !=null and communityId != ''">
  169. , t.community_id= #{communityId}
  170. </if>
  171. where 1=1
  172. <if test="configId !=null and configId != ''">
  173. and t.config_id= #{configId}
  174. </if>
  175. <if test="bId !=null and bId != ''">
  176. and t.b_id= #{bId}
  177. </if>
  178. </update>
  179. <!-- 查询临时车收费标准数量 add by wuxw 2018-07-03 -->
  180. <select id="queryTempCarFeeConfigsCount" parameterType="Map" resultType="Map">
  181. select count(1) count
  182. from temp_car_fee_config t
  183. where 1 =1
  184. <if test="carType !=null and carType != ''">
  185. and t.car_type= #{carType}
  186. </if>
  187. <if test="configId !=null and configId != ''">
  188. and t.config_id= #{configId}
  189. </if>
  190. <if test="feeName !=null and feeName != ''">
  191. and t.fee_name= #{feeName}
  192. </if>
  193. <if test="paId !=null and paId != ''">
  194. and t.pa_id= #{paId}
  195. </if>
  196. <if test="areaNum !=null and areaNum != ''">
  197. and t.area_num= #{areaNum}
  198. </if>
  199. <if test="statusCd !=null and statusCd != ''">
  200. and t.status_cd= #{statusCd}
  201. </if>
  202. <if test="startTime !=null and startTime != ''">
  203. and t.start_time= #{startTime}
  204. </if>
  205. <if test="endTime !=null and endTime != ''">
  206. and t.end_time= #{endTime}
  207. </if>
  208. <if test="bId !=null and bId != ''">
  209. and t.b_id= #{bId}
  210. </if>
  211. <if test="ruleId !=null and ruleId != ''">
  212. and t.rule_id= #{ruleId}
  213. </if>
  214. <if test="communityId !=null and communityId != ''">
  215. and t.community_id= #{communityId}
  216. </if>
  217. </select>
  218. <!-- 查询临时车 收费规则 -->
  219. <select id="queryTempCarFeeRules" parameterType="Map" resultType="Map">
  220. select
  221. t.rule_id ruleId,t.rule_name ruleName,t.remark,t.bean_name beanName
  222. from temp_car_fee_rule t
  223. where 1=1
  224. and t.status_cd = '0'
  225. <if test="ruleId !=null and ruleId != ''">
  226. and t.rule_id= #{ruleId}
  227. </if>
  228. </select>
  229. <!-- 查询临时车 收费规则 -->
  230. <select id="queryTempCarFeeRuleSpecs" parameterType="Map" resultType="Map">
  231. select t.rule_id ruleId,t.spec_id specId,t.spec_name specName,t.seq from
  232. temp_car_fee_rule_spec t
  233. where t.status_cd = '0'
  234. <if test="ruleId !=null and ruleId != ''">
  235. and t.rule_id= #{ruleId}
  236. </if>
  237. <if test="specId !=null and specId != ''">
  238. and t.spec_id = #{specId}
  239. </if>
  240. <if test="ruleIds !=null">
  241. and t.rule_id in
  242. <foreach collection="ruleIds" item="item" open="(" close=")" separator=",">
  243. #{item}
  244. </foreach>
  245. </if>
  246. order by t.seq
  247. </select>
  248. </mapper>