NewOrderDunMapper.xml 17 KB

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