ContractChangePlanDetailServiceDaoImplMapper.xml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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="contractChangePlanDetailServiceDaoImpl">
  6. <!-- 保存合同变更明细信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveContractChangePlanDetailInfo" parameterType="Map">
  8. insert into contract_change_plan_detail(
  9. a_link,a_contacts,amount,contract_type,detail_id,store_id,operator,signing_time,b_contacts,party_a,b_link,
  10. party_b,contract_id,obj_id,plan_id,contract_name,start_time,end_time,contract_code,obj_type,operator_link,operate
  11. ) values (
  12. #{aLink},#{aContacts},#{amount},#{contractType},#{detailId},#{storeId},#{operator},#{signingTime},#{bContacts},
  13. #{partyA},#{bLink},#{partyB},#{contractId},#{objId},#{planId},#{contractName},#{startTime},#{endTime},
  14. #{contractCode},#{objType},#{operatorLink},#{operate}
  15. )
  16. </insert>
  17. <!-- 查询合同变更明细信息 add by wuxw 2018-07-03 -->
  18. <select id="getContractChangePlanDetailInfo" parameterType="Map" resultType="Map">
  19. select t.a_link,t.a_link aLink,t.a_contacts,t.a_contacts aContacts,t.amount,t.contract_type,t.contract_type
  20. contractType,t.detail_id,t.detail_id detailId,t.store_id,t.store_id
  21. storeId,t.operator,t.signing_time,t.signing_time signingTime,t.b_contacts,t.b_contacts
  22. bContacts,t.party_a,t.party_a partyA,t.b_link,t.b_link bLink,t.party_b,t.party_b
  23. partyB,t.contract_id,t.contract_id contractId,t.obj_id,t.obj_id objId,t.plan_id,t.plan_id
  24. planId,t.contract_name,t.contract_name contractName,t.start_time,t.start_time startTime,t.end_time,t.end_time
  25. endTime,t.contract_code,t.contract_code contractCode,t.obj_type,t.obj_type
  26. objType,t.operator_link,t.operator_link operatorLink,t.operate,td.`name` planTypeName,ccp.plan_type planType
  27. from contract_change_plan_detail t
  28. inner join contract_change_plan ccp on t.plan_id = ccp.plan_id and ccp.status_cd = '0' and ccp.store_id = t.store_id
  29. left join t_dict td on ccp.plan_type = td.status_cd and td.table_name = 'contract_change_plan' and td.table_columns = 'plan_type'
  30. where 1 =1
  31. <if test="aLink !=null and aLink != ''">
  32. and t.a_link= #{aLink}
  33. </if>
  34. <if test="aContacts !=null and aContacts != ''">
  35. and t.a_contacts= #{aContacts}
  36. </if>
  37. <if test="amount !=null and amount != ''">
  38. and t.amount= #{amount}
  39. </if>
  40. <if test="contractType !=null and contractType != ''">
  41. and t.contract_type= #{contractType}
  42. </if>
  43. <if test="detailId !=null and detailId != ''">
  44. and t.detail_id= #{detailId}
  45. </if>
  46. <if test="storeId !=null and storeId != ''">
  47. and t.store_id= #{storeId}
  48. </if>
  49. <if test="operator !=null and operator != ''">
  50. and t.operator= #{operator}
  51. </if>
  52. <if test="signingTime !=null and signingTime != ''">
  53. and t.signing_time= #{signingTime}
  54. </if>
  55. <if test="bContacts !=null and bContacts != ''">
  56. and t.b_contacts= #{bContacts}
  57. </if>
  58. <if test="partyA !=null and partyA != ''">
  59. and t.party_a= #{partyA}
  60. </if>
  61. <if test="bLink !=null and bLink != ''">
  62. and t.b_link= #{bLink}
  63. </if>
  64. <if test="partyB !=null and partyB != ''">
  65. and t.party_b= #{partyB}
  66. </if>
  67. <if test="contractId !=null and contractId != ''">
  68. and t.contract_id= #{contractId}
  69. </if>
  70. <if test="objId !=null and objId != ''">
  71. and t.obj_id= #{objId}
  72. </if>
  73. <if test="planId !=null and planId != ''">
  74. and t.plan_id= #{planId}
  75. </if>
  76. <if test="contractName !=null and contractName != ''">
  77. and t.contract_name= #{contractName}
  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="contractCode !=null and contractCode != ''">
  86. and t.contract_code= #{contractCode}
  87. </if>
  88. <if test="objType !=null and objType != ''">
  89. and t.obj_type= #{objType}
  90. </if>
  91. <if test="operatorLink !=null and operatorLink != ''">
  92. and t.operator_link= #{operatorLink}
  93. </if>
  94. <if test="operate !=null and operate != ''">
  95. and t.operate= #{operate}
  96. </if>
  97. order by t.create_time desc
  98. <if test="page != -1 and page != null ">
  99. limit #{page}, #{row}
  100. </if>
  101. </select>
  102. <!-- 修改合同变更明细信息 add by wuxw 2018-07-03 -->
  103. <update id="updateContractChangePlanDetailInfo" parameterType="Map">
  104. update contract_change_plan_detail t set t.status_cd = #{statusCd}
  105. <if test="newBId != null and newBId != ''">
  106. ,t.b_id = #{newBId}
  107. </if>
  108. <if test="aLink !=null and aLink != ''">
  109. , t.a_link= #{aLink}
  110. </if>
  111. <if test="aContacts !=null and aContacts != ''">
  112. , t.a_contacts= #{aContacts}
  113. </if>
  114. <if test="amount !=null and amount != ''">
  115. , t.amount= #{amount}
  116. </if>
  117. <if test="contractType !=null and contractType != ''">
  118. , t.contract_type= #{contractType}
  119. </if>
  120. <if test="storeId !=null and storeId != ''">
  121. , t.store_id= #{storeId}
  122. </if>
  123. <if test="operator !=null and operator != ''">
  124. , t.operator= #{operator}
  125. </if>
  126. <if test="signingTime !=null and signingTime != ''">
  127. , t.signing_time= #{signingTime}
  128. </if>
  129. <if test="bContacts !=null and bContacts != ''">
  130. , t.b_contacts= #{bContacts}
  131. </if>
  132. <if test="partyA !=null and partyA != ''">
  133. , t.party_a= #{partyA}
  134. </if>
  135. <if test="bLink !=null and bLink != ''">
  136. , t.b_link= #{bLink}
  137. </if>
  138. <if test="partyB !=null and partyB != ''">
  139. , t.party_b= #{partyB}
  140. </if>
  141. <if test="contractId !=null and contractId != ''">
  142. , t.contract_id= #{contractId}
  143. </if>
  144. <if test="objId !=null and objId != ''">
  145. , t.obj_id= #{objId}
  146. </if>
  147. <if test="planId !=null and planId != ''">
  148. , t.plan_id= #{planId}
  149. </if>
  150. <if test="contractName !=null and contractName != ''">
  151. , t.contract_name= #{contractName}
  152. </if>
  153. <if test="startTime !=null and startTime != ''">
  154. , t.start_time= #{startTime}
  155. </if>
  156. <if test="endTime !=null and endTime != ''">
  157. , t.end_time= #{endTime}
  158. </if>
  159. <if test="contractCode !=null and contractCode != ''">
  160. , t.contract_code= #{contractCode}
  161. </if>
  162. <if test="objType !=null and objType != ''">
  163. , t.obj_type= #{objType}
  164. </if>
  165. <if test="operatorLink !=null and operatorLink != ''">
  166. , t.operator_link= #{operatorLink}
  167. </if>
  168. where 1=1
  169. <if test="detailId !=null and detailId != ''">
  170. and t.detail_id= #{detailId}
  171. </if>
  172. </update>
  173. <!-- 查询合同变更明细数量 add by wuxw 2018-07-03 -->
  174. <select id="queryContractChangePlanDetailsCount" parameterType="Map" resultType="Map">
  175. select count(1) count
  176. from contract_change_plan_detail t
  177. where 1 =1
  178. <if test="aLink !=null and aLink != ''">
  179. and t.a_link= #{aLink}
  180. </if>
  181. <if test="aContacts !=null and aContacts != ''">
  182. and t.a_contacts= #{aContacts}
  183. </if>
  184. <if test="amount !=null and amount != ''">
  185. and t.amount= #{amount}
  186. </if>
  187. <if test="contractType !=null and contractType != ''">
  188. and t.contract_type= #{contractType}
  189. </if>
  190. <if test="detailId !=null and detailId != ''">
  191. and t.detail_id= #{detailId}
  192. </if>
  193. <if test="storeId !=null and storeId != ''">
  194. and t.store_id= #{storeId}
  195. </if>
  196. <if test="operator !=null and operator != ''">
  197. and t.operator= #{operator}
  198. </if>
  199. <if test="signingTime !=null and signingTime != ''">
  200. and t.signing_time= #{signingTime}
  201. </if>
  202. <if test="bContacts !=null and bContacts != ''">
  203. and t.b_contacts= #{bContacts}
  204. </if>
  205. <if test="partyA !=null and partyA != ''">
  206. and t.party_a= #{partyA}
  207. </if>
  208. <if test="bLink !=null and bLink != ''">
  209. and t.b_link= #{bLink}
  210. </if>
  211. <if test="partyB !=null and partyB != ''">
  212. and t.party_b= #{partyB}
  213. </if>
  214. <if test="contractId !=null and contractId != ''">
  215. and t.contract_id= #{contractId}
  216. </if>
  217. <if test="objId !=null and objId != ''">
  218. and t.obj_id= #{objId}
  219. </if>
  220. <if test="planId !=null and planId != ''">
  221. and t.plan_id= #{planId}
  222. </if>
  223. <if test="contractName !=null and contractName != ''">
  224. and t.contract_name= #{contractName}
  225. </if>
  226. <if test="startTime !=null and startTime != ''">
  227. and t.start_time= #{startTime}
  228. </if>
  229. <if test="endTime !=null and endTime != ''">
  230. and t.end_time= #{endTime}
  231. </if>
  232. <if test="contractCode !=null and contractCode != ''">
  233. and t.contract_code= #{contractCode}
  234. </if>
  235. <if test="objType !=null and objType != ''">
  236. and t.obj_type= #{objType}
  237. </if>
  238. <if test="operatorLink !=null and operatorLink != ''">
  239. and t.operator_link= #{operatorLink}
  240. </if>
  241. <if test="operate !=null and operate != ''">
  242. and t.operate= #{operate}
  243. </if>
  244. </select>
  245. </mapper>