TChanggeTaskMapper.xml 16 KB

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