NewOrderDunMapper.xml 19 KB

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