TChangeDunMapper.xml 20 KB

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