PaymentNodeMapper.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.goafanti.common.dao.PaymentNodeMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.PaymentNode">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Tue Jul 07 13:58:53 CST 2020.
  9. -->
  10. <id column="id" jdbcType="INTEGER" property="id" />
  11. <result column="tid" jdbcType="INTEGER" property="tid" />
  12. <result column="cid" jdbcType="INTEGER" property="cid" />
  13. <result column="company_name" jdbcType="VARCHAR" property="companyName" />
  14. <result column="project_type" jdbcType="INTEGER" property="projectType" />
  15. <result column="dun_type" jdbcType="INTEGER" property="dunType" />
  16. <result column="unit_price" jdbcType="DECIMAL" property="unitPrice" />
  17. <result column="quantity" jdbcType="INTEGER" property="quantity" />
  18. <result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
  19. <result column="party_amount" jdbcType="DECIMAL" property="partyAmount" />
  20. <result column="party_time" jdbcType="TIMESTAMP" property="partyTime" />
  21. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  22. <result column="dun_status" jdbcType="INTEGER" property="dunStatus" />
  23. <result column="effective_count" jdbcType="INTEGER" property="effectiveCount" />
  24. <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
  25. <result column="status" jdbcType="INTEGER" property="status" />
  26. </resultMap>
  27. <sql id="Example_Where_Clause">
  28. <!--
  29. WARNING - @mbg.generated
  30. This element is automatically generated by MyBatis Generator, do not modify.
  31. This element was generated on Tue Jul 07 13:58:53 CST 2020.
  32. -->
  33. <where>
  34. <foreach collection="oredCriteria" item="criteria" separator="or">
  35. <if test="criteria.valid">
  36. <trim prefix="(" prefixOverrides="and" suffix=")">
  37. <foreach collection="criteria.criteria" item="criterion">
  38. <choose>
  39. <when test="criterion.noValue">
  40. and ${criterion.condition}
  41. </when>
  42. <when test="criterion.singleValue">
  43. and ${criterion.condition} #{criterion.value}
  44. </when>
  45. <when test="criterion.betweenValue">
  46. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  47. </when>
  48. <when test="criterion.listValue">
  49. and ${criterion.condition}
  50. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  51. #{listItem}
  52. </foreach>
  53. </when>
  54. </choose>
  55. </foreach>
  56. </trim>
  57. </if>
  58. </foreach>
  59. </where>
  60. </sql>
  61. <sql id="Update_By_Example_Where_Clause">
  62. <!--
  63. WARNING - @mbg.generated
  64. This element is automatically generated by MyBatis Generator, do not modify.
  65. This element was generated on Tue Jul 07 13:58:53 CST 2020.
  66. -->
  67. <where>
  68. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  69. <if test="criteria.valid">
  70. <trim prefix="(" prefixOverrides="and" suffix=")">
  71. <foreach collection="criteria.criteria" item="criterion">
  72. <choose>
  73. <when test="criterion.noValue">
  74. and ${criterion.condition}
  75. </when>
  76. <when test="criterion.singleValue">
  77. and ${criterion.condition} #{criterion.value}
  78. </when>
  79. <when test="criterion.betweenValue">
  80. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  81. </when>
  82. <when test="criterion.listValue">
  83. and ${criterion.condition}
  84. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  85. #{listItem}
  86. </foreach>
  87. </when>
  88. </choose>
  89. </foreach>
  90. </trim>
  91. </if>
  92. </foreach>
  93. </where>
  94. </sql>
  95. <sql id="Base_Column_List">
  96. <!--
  97. WARNING - @mbg.generated
  98. This element is automatically generated by MyBatis Generator, do not modify.
  99. This element was generated on Tue Jul 07 13:58:53 CST 2020.
  100. -->
  101. id, tid, cid, company_name, project_type, dun_type, unit_price, quantity, total_amount,
  102. party_amount, party_time, create_time, dun_status, effective_count, start_time, status
  103. </sql>
  104. <select id="selectByExample" parameterType="com.goafanti.common.model.PaymentNodeExample" resultMap="BaseResultMap">
  105. <!--
  106. WARNING - @mbg.generated
  107. This element is automatically generated by MyBatis Generator, do not modify.
  108. This element was generated on Tue Jul 07 13:58:53 CST 2020.
  109. -->
  110. select
  111. <if test="distinct">
  112. distinct
  113. </if>
  114. <include refid="Base_Column_List" />
  115. from payment_node
  116. <if test="_parameter != null">
  117. <include refid="Example_Where_Clause" />
  118. </if>
  119. <if test="orderByClause != null">
  120. order by ${orderByClause}
  121. </if>
  122. </select>
  123. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  124. <!--
  125. WARNING - @mbg.generated
  126. This element is automatically generated by MyBatis Generator, do not modify.
  127. This element was generated on Tue Jul 07 13:58:53 CST 2020.
  128. -->
  129. select
  130. <include refid="Base_Column_List" />
  131. from payment_node
  132. where id = #{id,jdbcType=INTEGER}
  133. </select>
  134. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  135. <!--
  136. WARNING - @mbg.generated
  137. This element is automatically generated by MyBatis Generator, do not modify.
  138. This element was generated on Tue Jul 07 13:58:53 CST 2020.
  139. -->
  140. delete from payment_node
  141. where id = #{id,jdbcType=INTEGER}
  142. </delete>
  143. <delete id="deleteByExample" parameterType="com.goafanti.common.model.PaymentNodeExample">
  144. <!--
  145. WARNING - @mbg.generated
  146. This element is automatically generated by MyBatis Generator, do not modify.
  147. This element was generated on Tue Jul 07 13:58:53 CST 2020.
  148. -->
  149. delete from payment_node
  150. <if test="_parameter != null">
  151. <include refid="Example_Where_Clause" />
  152. </if>
  153. </delete>
  154. <insert id="insert" parameterType="com.goafanti.common.model.PaymentNode">
  155. <!--
  156. WARNING - @mbg.generated
  157. This element is automatically generated by MyBatis Generator, do not modify.
  158. This element was generated on Tue Jul 07 13:58:53 CST 2020.
  159. -->
  160. insert into payment_node (id, tid, cid,
  161. company_name, project_type, dun_type,
  162. unit_price, quantity, total_amount,
  163. party_amount, party_time, create_time,
  164. dun_status, effective_count, start_time,
  165. status)
  166. values (#{id,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{cid,jdbcType=INTEGER},
  167. #{companyName,jdbcType=VARCHAR}, #{projectType,jdbcType=INTEGER}, #{dunType,jdbcType=INTEGER},
  168. #{unitPrice,jdbcType=DECIMAL}, #{quantity,jdbcType=INTEGER}, #{totalAmount,jdbcType=DECIMAL},
  169. #{partyAmount,jdbcType=DECIMAL}, #{partyTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
  170. #{dunStatus,jdbcType=INTEGER}, #{effectiveCount,jdbcType=INTEGER}, #{startTime,jdbcType=TIMESTAMP},
  171. #{status,jdbcType=INTEGER})
  172. </insert>
  173. <insert id="insertSelective" parameterType="com.goafanti.common.model.PaymentNode">
  174. <!--
  175. WARNING - @mbg.generated
  176. This element is automatically generated by MyBatis Generator, do not modify.
  177. This element was generated on Tue Jul 07 13:58:53 CST 2020.
  178. -->
  179. insert into payment_node
  180. <trim prefix="(" suffix=")" suffixOverrides=",">
  181. <if test="id != null">
  182. id,
  183. </if>
  184. <if test="tid != null">
  185. tid,
  186. </if>
  187. <if test="cid != null">
  188. cid,
  189. </if>
  190. <if test="companyName != null">
  191. company_name,
  192. </if>
  193. <if test="projectType != null">
  194. project_type,
  195. </if>
  196. <if test="dunType != null">
  197. dun_type,
  198. </if>
  199. <if test="unitPrice != null">
  200. unit_price,
  201. </if>
  202. <if test="quantity != null">
  203. quantity,
  204. </if>
  205. <if test="totalAmount != null">
  206. total_amount,
  207. </if>
  208. <if test="partyAmount != null">
  209. party_amount,
  210. </if>
  211. <if test="partyTime != null">
  212. party_time,
  213. </if>
  214. <if test="createTime != null">
  215. create_time,
  216. </if>
  217. <if test="dunStatus != null">
  218. dun_status,
  219. </if>
  220. <if test="effectiveCount != null">
  221. effective_count,
  222. </if>
  223. <if test="startTime != null">
  224. start_time,
  225. </if>
  226. <if test="status != null">
  227. status,
  228. </if>
  229. </trim>
  230. <trim prefix="values (" suffix=")" suffixOverrides=",">
  231. <if test="id != null">
  232. #{id,jdbcType=INTEGER},
  233. </if>
  234. <if test="tid != null">
  235. #{tid,jdbcType=INTEGER},
  236. </if>
  237. <if test="cid != null">
  238. #{cid,jdbcType=INTEGER},
  239. </if>
  240. <if test="companyName != null">
  241. #{companyName,jdbcType=VARCHAR},
  242. </if>
  243. <if test="projectType != null">
  244. #{projectType,jdbcType=INTEGER},
  245. </if>
  246. <if test="dunType != null">
  247. #{dunType,jdbcType=INTEGER},
  248. </if>
  249. <if test="unitPrice != null">
  250. #{unitPrice,jdbcType=DECIMAL},
  251. </if>
  252. <if test="quantity != null">
  253. #{quantity,jdbcType=INTEGER},
  254. </if>
  255. <if test="totalAmount != null">
  256. #{totalAmount,jdbcType=DECIMAL},
  257. </if>
  258. <if test="partyAmount != null">
  259. #{partyAmount,jdbcType=DECIMAL},
  260. </if>
  261. <if test="partyTime != null">
  262. #{partyTime,jdbcType=TIMESTAMP},
  263. </if>
  264. <if test="createTime != null">
  265. #{createTime,jdbcType=TIMESTAMP},
  266. </if>
  267. <if test="dunStatus != null">
  268. #{dunStatus,jdbcType=INTEGER},
  269. </if>
  270. <if test="effectiveCount != null">
  271. #{effectiveCount,jdbcType=INTEGER},
  272. </if>
  273. <if test="startTime != null">
  274. #{startTime,jdbcType=TIMESTAMP},
  275. </if>
  276. <if test="status != null">
  277. #{status,jdbcType=INTEGER},
  278. </if>
  279. </trim>
  280. </insert>
  281. <select id="countByExample" parameterType="com.goafanti.common.model.PaymentNodeExample" resultType="java.lang.Long">
  282. <!--
  283. WARNING - @mbg.generated
  284. This element is automatically generated by MyBatis Generator, do not modify.
  285. This element was generated on Tue Jul 07 13:58:53 CST 2020.
  286. -->
  287. select count(*) from payment_node
  288. <if test="_parameter != null">
  289. <include refid="Example_Where_Clause" />
  290. </if>
  291. </select>
  292. <update id="updateByExampleSelective" parameterType="map">
  293. <!--
  294. WARNING - @mbg.generated
  295. This element is automatically generated by MyBatis Generator, do not modify.
  296. This element was generated on Tue Jul 07 13:58:53 CST 2020.
  297. -->
  298. update payment_node
  299. <set>
  300. <if test="record.id != null">
  301. id = #{record.id,jdbcType=INTEGER},
  302. </if>
  303. <if test="record.tid != null">
  304. tid = #{record.tid,jdbcType=INTEGER},
  305. </if>
  306. <if test="record.cid != null">
  307. cid = #{record.cid,jdbcType=INTEGER},
  308. </if>
  309. <if test="record.companyName != null">
  310. company_name = #{record.companyName,jdbcType=VARCHAR},
  311. </if>
  312. <if test="record.projectType != null">
  313. project_type = #{record.projectType,jdbcType=INTEGER},
  314. </if>
  315. <if test="record.dunType != null">
  316. dun_type = #{record.dunType,jdbcType=INTEGER},
  317. </if>
  318. <if test="record.unitPrice != null">
  319. unit_price = #{record.unitPrice,jdbcType=DECIMAL},
  320. </if>
  321. <if test="record.quantity != null">
  322. quantity = #{record.quantity,jdbcType=INTEGER},
  323. </if>
  324. <if test="record.totalAmount != null">
  325. total_amount = #{record.totalAmount,jdbcType=DECIMAL},
  326. </if>
  327. <if test="record.partyAmount != null">
  328. party_amount = #{record.partyAmount,jdbcType=DECIMAL},
  329. </if>
  330. <if test="record.partyTime != null">
  331. party_time = #{record.partyTime,jdbcType=TIMESTAMP},
  332. </if>
  333. <if test="record.createTime != null">
  334. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  335. </if>
  336. <if test="record.dunStatus != null">
  337. dun_status = #{record.dunStatus,jdbcType=INTEGER},
  338. </if>
  339. <if test="record.effectiveCount != null">
  340. effective_count = #{record.effectiveCount,jdbcType=INTEGER},
  341. </if>
  342. <if test="record.startTime != null">
  343. start_time = #{record.startTime,jdbcType=TIMESTAMP},
  344. </if>
  345. <if test="record.status != null">
  346. status = #{record.status,jdbcType=INTEGER},
  347. </if>
  348. </set>
  349. <if test="_parameter != null">
  350. <include refid="Update_By_Example_Where_Clause" />
  351. </if>
  352. </update>
  353. <update id="updateByExample" parameterType="map">
  354. <!--
  355. WARNING - @mbg.generated
  356. This element is automatically generated by MyBatis Generator, do not modify.
  357. This element was generated on Tue Jul 07 13:58:53 CST 2020.
  358. -->
  359. update payment_node
  360. set id = #{record.id,jdbcType=INTEGER},
  361. tid = #{record.tid,jdbcType=INTEGER},
  362. cid = #{record.cid,jdbcType=INTEGER},
  363. company_name = #{record.companyName,jdbcType=VARCHAR},
  364. project_type = #{record.projectType,jdbcType=INTEGER},
  365. dun_type = #{record.dunType,jdbcType=INTEGER},
  366. unit_price = #{record.unitPrice,jdbcType=DECIMAL},
  367. quantity = #{record.quantity,jdbcType=INTEGER},
  368. total_amount = #{record.totalAmount,jdbcType=DECIMAL},
  369. party_amount = #{record.partyAmount,jdbcType=DECIMAL},
  370. party_time = #{record.partyTime,jdbcType=TIMESTAMP},
  371. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  372. dun_status = #{record.dunStatus,jdbcType=INTEGER},
  373. effective_count = #{record.effectiveCount,jdbcType=INTEGER},
  374. start_time = #{record.startTime,jdbcType=TIMESTAMP},
  375. status = #{record.status,jdbcType=INTEGER}
  376. <if test="_parameter != null">
  377. <include refid="Update_By_Example_Where_Clause" />
  378. </if>
  379. </update>
  380. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PaymentNode">
  381. <!--
  382. WARNING - @mbg.generated
  383. This element is automatically generated by MyBatis Generator, do not modify.
  384. This element was generated on Tue Jul 07 13:58:53 CST 2020.
  385. -->
  386. update payment_node
  387. <set>
  388. <if test="tid != null">
  389. tid = #{tid,jdbcType=INTEGER},
  390. </if>
  391. <if test="cid != null">
  392. cid = #{cid,jdbcType=INTEGER},
  393. </if>
  394. <if test="companyName != null">
  395. company_name = #{companyName,jdbcType=VARCHAR},
  396. </if>
  397. <if test="projectType != null">
  398. project_type = #{projectType,jdbcType=INTEGER},
  399. </if>
  400. <if test="dunType != null">
  401. dun_type = #{dunType,jdbcType=INTEGER},
  402. </if>
  403. <if test="unitPrice != null">
  404. unit_price = #{unitPrice,jdbcType=DECIMAL},
  405. </if>
  406. <if test="quantity != null">
  407. quantity = #{quantity,jdbcType=INTEGER},
  408. </if>
  409. <if test="totalAmount != null">
  410. total_amount = #{totalAmount,jdbcType=DECIMAL},
  411. </if>
  412. <if test="partyAmount != null">
  413. party_amount = #{partyAmount,jdbcType=DECIMAL},
  414. </if>
  415. <if test="partyTime != null">
  416. party_time = #{partyTime,jdbcType=TIMESTAMP},
  417. </if>
  418. <if test="createTime != null">
  419. create_time = #{createTime,jdbcType=TIMESTAMP},
  420. </if>
  421. <if test="dunStatus != null">
  422. dun_status = #{dunStatus,jdbcType=INTEGER},
  423. </if>
  424. <if test="effectiveCount != null">
  425. effective_count = #{effectiveCount,jdbcType=INTEGER},
  426. </if>
  427. <if test="startTime != null">
  428. start_time = #{startTime,jdbcType=TIMESTAMP},
  429. </if>
  430. <if test="status != null">
  431. status = #{status,jdbcType=INTEGER},
  432. </if>
  433. </set>
  434. where id = #{id,jdbcType=INTEGER}
  435. </update>
  436. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PaymentNode">
  437. <!--
  438. WARNING - @mbg.generated
  439. This element is automatically generated by MyBatis Generator, do not modify.
  440. This element was generated on Tue Jul 07 13:58:53 CST 2020.
  441. -->
  442. update payment_node
  443. set tid = #{tid,jdbcType=INTEGER},
  444. cid = #{cid,jdbcType=INTEGER},
  445. company_name = #{companyName,jdbcType=VARCHAR},
  446. project_type = #{projectType,jdbcType=INTEGER},
  447. dun_type = #{dunType,jdbcType=INTEGER},
  448. unit_price = #{unitPrice,jdbcType=DECIMAL},
  449. quantity = #{quantity,jdbcType=INTEGER},
  450. total_amount = #{totalAmount,jdbcType=DECIMAL},
  451. party_amount = #{partyAmount,jdbcType=DECIMAL},
  452. party_time = #{partyTime,jdbcType=TIMESTAMP},
  453. create_time = #{createTime,jdbcType=TIMESTAMP},
  454. dun_status = #{dunStatus,jdbcType=INTEGER},
  455. effective_count = #{effectiveCount,jdbcType=INTEGER},
  456. start_time = #{startTime,jdbcType=TIMESTAMP},
  457. status = #{status,jdbcType=INTEGER}
  458. where id = #{id,jdbcType=INTEGER}
  459. </update>
  460. <select id="selectByTid" resultType="com.goafanti.organization.bo.OutPaymentNode">
  461. select id,tid,cid,company_name companyName,unit_price unitPrice,quantity,total_amount totalAmount,create_time createTime,status,
  462. party_amount partyAmount, date_format(party_time,'%Y-%m-%d')partyTimes,project_type projectType,dun_type dunType
  463. from payment_node where tid= #{tid}
  464. <if test="status !=null">
  465. and dun_status = #{status}
  466. </if>
  467. </select>
  468. <select id="selectByStatus" resultType="com.goafanti.organization.bo.OutPaymentNode">
  469. select id,tid,cid,company_name companyName,unit_price unitPrice,quantity,total_amount totalAmount,create_time createTime ,
  470. party_amount partyAmount,party_time partyTime, date_format(party_time,'%Y-%m-%d')partyTimes,project_type projectType,dun_type dunType
  471. from payment_node where dun_status = #{status}
  472. </select>
  473. <select id="selectBytidGetEmail" resultType="com.goafanti.common.bo.paymentNodeEmailBo">
  474. select a.tid,b.order_no orderNo,o.contract_no contractNo ,c.salesman_id salesmanId, c.salesman_name salesmanName,
  475. c.buyer_name userName,d.email
  476. from payment_node a left join t_order_task b on a.tid=b.id left join t_order_new o on b.order_no =o.order_no
  477. left join t_order_mid c on b.order_no=c.order_no left join admin d on c.salesman_id=d.id
  478. where a.tid= #{tid} limit 1
  479. </select>
  480. <select id="selectByTidAndCid" resultType="com.goafanti.organization.bo.OutPaymentNode">
  481. select id,tid,cid,company_name companyName,unit_price unitPrice,quantity,total_amount totalAmount,create_time createTime,
  482. party_amount partyAmount, date_format(party_time,'%Y-%m-%d')partyTimes,project_type projectType,dun_type dunType
  483. from payment_node where 1=1
  484. <if test="cid !=null">
  485. and tid= #{tid}
  486. </if>
  487. <if test="cid !=null">
  488. and cid = #{cid}
  489. </if>
  490. </select>
  491. <select id="selectByCid" resultType="java.lang.Integer">
  492. select count(*) from payment_node where cid= #{tpcId}
  493. </select>
  494. <delete id="deleteByParam" parameterType="java.lang.Integer">
  495. delete from payment_node
  496. where 1=1
  497. <if test="tpcId !=null">
  498. and cid= #{tpcId}
  499. </if>
  500. <if test="tid !=null">
  501. and tid= #{tid}
  502. </if>
  503. </delete>
  504. </mapper>