TempCarFeeConfigAttrServiceDaoImplMapper.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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="tempCarFeeConfigAttrServiceDaoImpl">
  6. <!-- 保存临时车收费标准属性信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessTempCarFeeConfigAttrInfo" parameterType="Map">
  8. insert into business_temp_car_fee_config_attr(
  9. attr_id,operate,config_id,spec_cd,b_id,value,community_id
  10. ) values (
  11. #{attrId},#{operate},#{configId},#{specCd},#{bId},#{value},#{communityId}
  12. )
  13. </insert>
  14. <!-- 查询临时车收费标准属性信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessTempCarFeeConfigAttrInfo" parameterType="Map" resultType="Map">
  16. select t.attr_id,t.attr_id attrId,t.operate,t.create_time,t.create_time createTime,t.config_id,t.config_id
  17. configId,t.spec_cd,t.spec_cd specCd,t.b_id,t.b_id bId,t.value,t.community_id
  18. from business_temp_car_fee_config_attr t
  19. where 1 =1
  20. <if test="attrId !=null and attrId != ''">
  21. and t.attr_id= #{attrId}
  22. </if>
  23. <if test="operate !=null and operate != ''">
  24. and t.operate= #{operate}
  25. </if>
  26. <if test="createTime !=null">
  27. and t.create_time= #{createTime}
  28. </if>
  29. <if test="configId !=null and configId != ''">
  30. and t.config_id= #{configId}
  31. </if>
  32. <if test="specCd !=null and specCd != ''">
  33. and t.spec_cd= #{specCd}
  34. </if>
  35. <if test="bId !=null and bId != ''">
  36. and t.b_id= #{bId}
  37. </if>
  38. <if test="value !=null and value != ''">
  39. and t.value= #{value}
  40. </if>
  41. </select>
  42. <!-- 保存临时车收费标准属性信息至 instance表中 add by wuxw 2018-07-03 -->
  43. <insert id="saveTempCarFeeConfigAttrInfoInstance" parameterType="Map">
  44. insert into temp_car_fee_config_attr(
  45. attr_id,config_id,spec_cd,status_cd,b_id,value,community_id
  46. ) select t.attr_id,t.config_id,t.spec_cd,'0',t.b_id,t.value,t.community_id
  47. from business_temp_car_fee_config_attr
  48. 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 ">
  54. and t.create_time= #{createTime}
  55. </if>
  56. <if test="configId !=null and configId != ''">
  57. and t.config_id= #{configId}
  58. </if>
  59. <if test="specCd !=null and specCd != ''">
  60. and t.spec_cd= #{specCd}
  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. </insert>
  69. <!-- 查询临时车收费标准属性信息 add by wuxw 2018-07-03 -->
  70. <select id="getTempCarFeeConfigAttrInfo" parameterType="Map" resultType="Map">
  71. select t.attr_id,t.attr_id attrId,t.create_time,t.create_time createTime,t.config_id,t.config_id
  72. configId,t.spec_cd,t.spec_cd specCd,t.status_cd,t.status_cd statusCd,t.b_id,t.b_id bId,t.value,
  73. t.community_id,t.community_id communityId,tcfrs.spec_name specName
  74. from temp_car_fee_config_attr t
  75. left join temp_car_fee_config tcfc on t.config_id = tcfc.config_id and tcfc.status_cd = '0'
  76. LEFT JOIN temp_car_fee_rule_spec tcfrs on tcfc.rule_id = tcfrs.rule_id and t.spec_cd = tcfrs.spec_id
  77. where 1 =1
  78. <if test="attrId !=null and attrId != ''">
  79. and t.attr_id= #{attrId}
  80. </if>
  81. <if test="createTime !=null and createTime != ''">
  82. and t.create_time= #{createTime}
  83. </if>
  84. <if test="configId !=null and configId != ''">
  85. and t.config_id= #{configId}
  86. </if>
  87. <if test="specCd !=null and specCd != ''">
  88. and t.spec_cd= #{specCd}
  89. </if>
  90. <if test="statusCd !=null and statusCd != ''">
  91. and t.status_cd= #{statusCd}
  92. </if>
  93. <if test="bId !=null and bId != ''">
  94. and t.b_id= #{bId}
  95. </if>
  96. <if test="value !=null and value != ''">
  97. and t.value= #{value}
  98. </if>
  99. <if test="communityId !=null and communityId != ''">
  100. and t.community_id= #{communityId}
  101. </if>
  102. order by tcfrs.seq
  103. <if test="page != -1 and page != null ">
  104. limit #{page}, #{row}
  105. </if>
  106. </select>
  107. <!-- 修改临时车收费标准属性信息 add by wuxw 2018-07-03 -->
  108. <update id="updateTempCarFeeConfigAttrInfoInstance" parameterType="Map">
  109. update temp_car_fee_config_attr t set t.status_cd = #{statusCd}
  110. <if test="newBId != null and newBId != ''">
  111. ,t.b_id = #{newBId}
  112. </if>
  113. <if test="configId !=null and configId != ''">
  114. , t.config_id= #{configId}
  115. </if>
  116. <if test="specCd !=null and specCd != ''">
  117. , t.spec_cd= #{specCd}
  118. </if>
  119. <if test="value !=null and value != ''">
  120. , t.value= #{value}
  121. </if>
  122. where 1=1
  123. <if test="attrId !=null and attrId != ''">
  124. and t.attr_id= #{attrId}
  125. </if>
  126. <if test="bId !=null and bId != ''">
  127. and t.b_id= #{bId}
  128. </if>
  129. <if test="communityId !=null and communityId != ''">
  130. and t.community_id= #{communityId}
  131. </if>
  132. </update>
  133. <!-- 查询临时车收费标准属性数量 add by wuxw 2018-07-03 -->
  134. <select id="queryTempCarFeeConfigAttrsCount" parameterType="Map" resultType="Map">
  135. select count(1) count
  136. from temp_car_fee_config_attr t
  137. where 1 =1
  138. <if test="attrId !=null and attrId != ''">
  139. and t.attr_id= #{attrId}
  140. </if>
  141. <if test="createTime !=null ">
  142. and t.create_time= #{createTime}
  143. </if>
  144. <if test="configId !=null and configId != ''">
  145. and t.config_id= #{configId}
  146. </if>
  147. <if test="specCd !=null and specCd != ''">
  148. and t.spec_cd= #{specCd}
  149. </if>
  150. <if test="statusCd !=null and statusCd != ''">
  151. and t.status_cd= #{statusCd}
  152. </if>
  153. <if test="bId !=null and bId != ''">
  154. and t.b_id= #{bId}
  155. </if>
  156. <if test="value !=null and value != ''">
  157. and t.value= #{value}
  158. </if>
  159. <if test="communityId !=null and communityId != ''">
  160. and t.community_id= #{communityId}
  161. </if>
  162. </select>
  163. </mapper>