TOrderTaskMapper.xml 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085
  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.TOrderTaskMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderTask">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  9. -->
  10. <id column="id" jdbcType="INTEGER" property="id" />
  11. <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
  12. <result column="main" jdbcType="INTEGER" property="main" />
  13. <result column="super_id" jdbcType="VARCHAR" property="superId" />
  14. <result column="commodity_id" jdbcType="VARCHAR" property="commodityId" />
  15. <result column="commodity_name" jdbcType="VARCHAR" property="commodityName" />
  16. <result column="commodity_quantity" jdbcType="INTEGER" property="commodityQuantity" />
  17. <result column="commodity_mode" jdbcType="VARCHAR" property="commodityMode" />
  18. <result column="commodity_price" jdbcType="DECIMAL" property="commodityPrice" />
  19. <result column="task_status" jdbcType="INTEGER" property="taskStatus" />
  20. <result column="task_distribution_time" jdbcType="TIMESTAMP" property="taskDistributionTime" />
  21. <result column="task_allocator" jdbcType="VARCHAR" property="taskAllocator" />
  22. <result column="task_receiver" jdbcType="VARCHAR" property="taskReceiver" />
  23. <result column="task_comment" jdbcType="VARCHAR" property="taskComment" />
  24. <result column="task_start_time" jdbcType="TIMESTAMP" property="taskStartTime" />
  25. <result column="task_end_time" jdbcType="TIMESTAMP" property="taskEndTime" />
  26. <result column="project_status" jdbcType="INTEGER" property="projectStatus" />
  27. <result column="accept_time" jdbcType="DATE" property="acceptTime" />
  28. <result column="review_time" jdbcType="DATE" property="reviewTime" />
  29. <result column="publicity_time" jdbcType="DATE" property="publicityTime" />
  30. <result column="licence_time" jdbcType="DATE" property="licenceTime" />
  31. <result column="certificate_number" jdbcType="VARCHAR" property="certificateNumber" />
  32. <result column="status" jdbcType="INTEGER" property="status" />
  33. <result column="form_retrieve" jdbcType="INTEGER" property="formRetrieve" />
  34. <result column="declare_user" jdbcType="VARCHAR" property="declareUser" />
  35. <result column="declare_pwd" jdbcType="VARCHAR" property="declarePwd" />
  36. <result column="task_refund" jdbcType="INTEGER" property="taskRefund" />
  37. <result column="refund_content" jdbcType="VARCHAR" property="refundContent" />
  38. <result column="set_up_amount" jdbcType="DECIMAL" property="setUpAmount" />
  39. <result column="arrival_money" jdbcType="INTEGER" property="arrivalMoney" />
  40. <result column="retrieve_content" jdbcType="VARCHAR" property="retrieveContent" />
  41. </resultMap>
  42. <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.TOrderTask">
  43. <!--
  44. WARNING - @mbg.generated
  45. This element is automatically generated by MyBatis Generator, do not modify.
  46. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  47. -->
  48. <result column="attachment_url" jdbcType="LONGVARCHAR" property="attachmentUrl" />
  49. </resultMap>
  50. <sql id="Example_Where_Clause">
  51. <!--
  52. WARNING - @mbg.generated
  53. This element is automatically generated by MyBatis Generator, do not modify.
  54. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  55. -->
  56. <where>
  57. <foreach collection="oredCriteria" item="criteria" separator="or">
  58. <if test="criteria.valid">
  59. <trim prefix="(" prefixOverrides="and" suffix=")">
  60. <foreach collection="criteria.criteria" item="criterion">
  61. <choose>
  62. <when test="criterion.noValue">
  63. and ${criterion.condition}
  64. </when>
  65. <when test="criterion.singleValue">
  66. and ${criterion.condition} #{criterion.value}
  67. </when>
  68. <when test="criterion.betweenValue">
  69. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  70. </when>
  71. <when test="criterion.listValue">
  72. and ${criterion.condition}
  73. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  74. #{listItem}
  75. </foreach>
  76. </when>
  77. </choose>
  78. </foreach>
  79. </trim>
  80. </if>
  81. </foreach>
  82. </where>
  83. </sql>
  84. <sql id="Update_By_Example_Where_Clause">
  85. <!--
  86. WARNING - @mbg.generated
  87. This element is automatically generated by MyBatis Generator, do not modify.
  88. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  89. -->
  90. <where>
  91. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  92. <if test="criteria.valid">
  93. <trim prefix="(" prefixOverrides="and" suffix=")">
  94. <foreach collection="criteria.criteria" item="criterion">
  95. <choose>
  96. <when test="criterion.noValue">
  97. and ${criterion.condition}
  98. </when>
  99. <when test="criterion.singleValue">
  100. and ${criterion.condition} #{criterion.value}
  101. </when>
  102. <when test="criterion.betweenValue">
  103. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  104. </when>
  105. <when test="criterion.listValue">
  106. and ${criterion.condition}
  107. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  108. #{listItem}
  109. </foreach>
  110. </when>
  111. </choose>
  112. </foreach>
  113. </trim>
  114. </if>
  115. </foreach>
  116. </where>
  117. </sql>
  118. <sql id="Base_Column_List">
  119. <!--
  120. WARNING - @mbg.generated
  121. This element is automatically generated by MyBatis Generator, do not modify.
  122. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  123. -->
  124. id, order_no, main, super_id, commodity_id, commodity_name, commodity_quantity, commodity_mode,
  125. commodity_price, task_status, task_distribution_time, task_allocator, task_receiver,
  126. task_comment, task_start_time, task_end_time, project_status, accept_time, review_time,
  127. publicity_time, licence_time, certificate_number, status, form_retrieve, declare_user,
  128. declare_pwd, task_refund, refund_content, set_up_amount, arrival_money, retrieve_content
  129. </sql>
  130. <sql id="Blob_Column_List">
  131. <!--
  132. WARNING - @mbg.generated
  133. This element is automatically generated by MyBatis Generator, do not modify.
  134. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  135. -->
  136. attachment_url
  137. </sql>
  138. <select id="selectByExampleWithBLOBs" parameterType="com.goafanti.common.model.TOrderTaskExample" resultMap="ResultMapWithBLOBs">
  139. <!--
  140. WARNING - @mbg.generated
  141. This element is automatically generated by MyBatis Generator, do not modify.
  142. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  143. -->
  144. select
  145. <if test="distinct">
  146. distinct
  147. </if>
  148. <include refid="Base_Column_List" />
  149. ,
  150. <include refid="Blob_Column_List" />
  151. from t_order_task
  152. <if test="_parameter != null">
  153. <include refid="Example_Where_Clause" />
  154. </if>
  155. <if test="orderByClause != null">
  156. order by ${orderByClause}
  157. </if>
  158. </select>
  159. <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderTaskExample" resultMap="BaseResultMap">
  160. <!--
  161. WARNING - @mbg.generated
  162. This element is automatically generated by MyBatis Generator, do not modify.
  163. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  164. -->
  165. select
  166. <if test="distinct">
  167. distinct
  168. </if>
  169. <include refid="Base_Column_List" />
  170. from t_order_task
  171. <if test="_parameter != null">
  172. <include refid="Example_Where_Clause" />
  173. </if>
  174. <if test="orderByClause != null">
  175. order by ${orderByClause}
  176. </if>
  177. </select>
  178. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
  179. <!--
  180. WARNING - @mbg.generated
  181. This element is automatically generated by MyBatis Generator, do not modify.
  182. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  183. -->
  184. select
  185. <include refid="Base_Column_List" />
  186. ,
  187. <include refid="Blob_Column_List" />
  188. from t_order_task
  189. where id = #{id,jdbcType=INTEGER}
  190. </select>
  191. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  192. <!--
  193. WARNING - @mbg.generated
  194. This element is automatically generated by MyBatis Generator, do not modify.
  195. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  196. -->
  197. delete from t_order_task
  198. where id = #{id,jdbcType=INTEGER}
  199. </delete>
  200. <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderTaskExample">
  201. <!--
  202. WARNING - @mbg.generated
  203. This element is automatically generated by MyBatis Generator, do not modify.
  204. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  205. -->
  206. delete from t_order_task
  207. <if test="_parameter != null">
  208. <include refid="Example_Where_Clause" />
  209. </if>
  210. </delete>
  211. <insert id="insert" parameterType="com.goafanti.common.model.TOrderTask">
  212. <!--
  213. WARNING - @mbg.generated
  214. This element is automatically generated by MyBatis Generator, do not modify.
  215. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  216. -->
  217. insert into t_order_task (id, order_no, main,
  218. super_id, commodity_id, commodity_name,
  219. commodity_quantity, commodity_mode, commodity_price,
  220. task_status, task_distribution_time, task_allocator,
  221. task_receiver, task_comment, task_start_time,
  222. task_end_time, project_status, accept_time,
  223. review_time, publicity_time, licence_time,
  224. certificate_number, status, form_retrieve,
  225. declare_user, declare_pwd, task_refund,
  226. refund_content, set_up_amount, arrival_money,
  227. retrieve_content, attachment_url)
  228. values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{main,jdbcType=INTEGER},
  229. #{superId,jdbcType=VARCHAR}, #{commodityId,jdbcType=VARCHAR}, #{commodityName,jdbcType=VARCHAR},
  230. #{commodityQuantity,jdbcType=INTEGER}, #{commodityMode,jdbcType=VARCHAR}, #{commodityPrice,jdbcType=DECIMAL},
  231. #{taskStatus,jdbcType=INTEGER}, #{taskDistributionTime,jdbcType=TIMESTAMP}, #{taskAllocator,jdbcType=VARCHAR},
  232. #{taskReceiver,jdbcType=VARCHAR}, #{taskComment,jdbcType=VARCHAR}, #{taskStartTime,jdbcType=TIMESTAMP},
  233. #{taskEndTime,jdbcType=TIMESTAMP}, #{projectStatus,jdbcType=INTEGER}, #{acceptTime,jdbcType=DATE},
  234. #{reviewTime,jdbcType=DATE}, #{publicityTime,jdbcType=DATE}, #{licenceTime,jdbcType=DATE},
  235. #{certificateNumber,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{formRetrieve,jdbcType=INTEGER},
  236. #{declareUser,jdbcType=VARCHAR}, #{declarePwd,jdbcType=VARCHAR}, #{taskRefund,jdbcType=INTEGER},
  237. #{refundContent,jdbcType=VARCHAR}, #{setUpAmount,jdbcType=DECIMAL}, #{arrivalMoney,jdbcType=INTEGER},
  238. #{retrieveContent,jdbcType=VARCHAR}, #{attachmentUrl,jdbcType=LONGVARCHAR})
  239. </insert>
  240. <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderTask">
  241. <!--
  242. WARNING - @mbg.generated
  243. This element is automatically generated by MyBatis Generator, do not modify.
  244. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  245. -->
  246. insert into t_order_task
  247. <trim prefix="(" suffix=")" suffixOverrides=",">
  248. <if test="id != null">
  249. id,
  250. </if>
  251. <if test="orderNo != null">
  252. order_no,
  253. </if>
  254. <if test="main != null">
  255. main,
  256. </if>
  257. <if test="superId != null">
  258. super_id,
  259. </if>
  260. <if test="commodityId != null">
  261. commodity_id,
  262. </if>
  263. <if test="commodityName != null">
  264. commodity_name,
  265. </if>
  266. <if test="commodityQuantity != null">
  267. commodity_quantity,
  268. </if>
  269. <if test="commodityMode != null">
  270. commodity_mode,
  271. </if>
  272. <if test="commodityPrice != null">
  273. commodity_price,
  274. </if>
  275. <if test="taskStatus != null">
  276. task_status,
  277. </if>
  278. <if test="taskDistributionTime != null">
  279. task_distribution_time,
  280. </if>
  281. <if test="taskAllocator != null">
  282. task_allocator,
  283. </if>
  284. <if test="taskReceiver != null">
  285. task_receiver,
  286. </if>
  287. <if test="taskComment != null">
  288. task_comment,
  289. </if>
  290. <if test="taskStartTime != null">
  291. task_start_time,
  292. </if>
  293. <if test="taskEndTime != null">
  294. task_end_time,
  295. </if>
  296. <if test="projectStatus != null">
  297. project_status,
  298. </if>
  299. <if test="acceptTime != null">
  300. accept_time,
  301. </if>
  302. <if test="reviewTime != null">
  303. review_time,
  304. </if>
  305. <if test="publicityTime != null">
  306. publicity_time,
  307. </if>
  308. <if test="licenceTime != null">
  309. licence_time,
  310. </if>
  311. <if test="certificateNumber != null">
  312. certificate_number,
  313. </if>
  314. <if test="status != null">
  315. status,
  316. </if>
  317. <if test="formRetrieve != null">
  318. form_retrieve,
  319. </if>
  320. <if test="declareUser != null">
  321. declare_user,
  322. </if>
  323. <if test="declarePwd != null">
  324. declare_pwd,
  325. </if>
  326. <if test="taskRefund != null">
  327. task_refund,
  328. </if>
  329. <if test="refundContent != null">
  330. refund_content,
  331. </if>
  332. <if test="setUpAmount != null">
  333. set_up_amount,
  334. </if>
  335. <if test="arrivalMoney != null">
  336. arrival_money,
  337. </if>
  338. <if test="retrieveContent != null">
  339. retrieve_content,
  340. </if>
  341. <if test="attachmentUrl != null">
  342. attachment_url,
  343. </if>
  344. </trim>
  345. <trim prefix="values (" suffix=")" suffixOverrides=",">
  346. <if test="id != null">
  347. #{id,jdbcType=INTEGER},
  348. </if>
  349. <if test="orderNo != null">
  350. #{orderNo,jdbcType=VARCHAR},
  351. </if>
  352. <if test="main != null">
  353. #{main,jdbcType=INTEGER},
  354. </if>
  355. <if test="superId != null">
  356. #{superId,jdbcType=VARCHAR},
  357. </if>
  358. <if test="commodityId != null">
  359. #{commodityId,jdbcType=VARCHAR},
  360. </if>
  361. <if test="commodityName != null">
  362. #{commodityName,jdbcType=VARCHAR},
  363. </if>
  364. <if test="commodityQuantity != null">
  365. #{commodityQuantity,jdbcType=INTEGER},
  366. </if>
  367. <if test="commodityMode != null">
  368. #{commodityMode,jdbcType=VARCHAR},
  369. </if>
  370. <if test="commodityPrice != null">
  371. #{commodityPrice,jdbcType=DECIMAL},
  372. </if>
  373. <if test="taskStatus != null">
  374. #{taskStatus,jdbcType=INTEGER},
  375. </if>
  376. <if test="taskDistributionTime != null">
  377. #{taskDistributionTime,jdbcType=TIMESTAMP},
  378. </if>
  379. <if test="taskAllocator != null">
  380. #{taskAllocator,jdbcType=VARCHAR},
  381. </if>
  382. <if test="taskReceiver != null">
  383. #{taskReceiver,jdbcType=VARCHAR},
  384. </if>
  385. <if test="taskComment != null">
  386. #{taskComment,jdbcType=VARCHAR},
  387. </if>
  388. <if test="taskStartTime != null">
  389. #{taskStartTime,jdbcType=TIMESTAMP},
  390. </if>
  391. <if test="taskEndTime != null">
  392. #{taskEndTime,jdbcType=TIMESTAMP},
  393. </if>
  394. <if test="projectStatus != null">
  395. #{projectStatus,jdbcType=INTEGER},
  396. </if>
  397. <if test="acceptTime != null">
  398. #{acceptTime,jdbcType=DATE},
  399. </if>
  400. <if test="reviewTime != null">
  401. #{reviewTime,jdbcType=DATE},
  402. </if>
  403. <if test="publicityTime != null">
  404. #{publicityTime,jdbcType=DATE},
  405. </if>
  406. <if test="licenceTime != null">
  407. #{licenceTime,jdbcType=DATE},
  408. </if>
  409. <if test="certificateNumber != null">
  410. #{certificateNumber,jdbcType=VARCHAR},
  411. </if>
  412. <if test="status != null">
  413. #{status,jdbcType=INTEGER},
  414. </if>
  415. <if test="formRetrieve != null">
  416. #{formRetrieve,jdbcType=INTEGER},
  417. </if>
  418. <if test="declareUser != null">
  419. #{declareUser,jdbcType=VARCHAR},
  420. </if>
  421. <if test="declarePwd != null">
  422. #{declarePwd,jdbcType=VARCHAR},
  423. </if>
  424. <if test="taskRefund != null">
  425. #{taskRefund,jdbcType=INTEGER},
  426. </if>
  427. <if test="refundContent != null">
  428. #{refundContent,jdbcType=VARCHAR},
  429. </if>
  430. <if test="setUpAmount != null">
  431. #{setUpAmount,jdbcType=DECIMAL},
  432. </if>
  433. <if test="arrivalMoney != null">
  434. #{arrivalMoney,jdbcType=INTEGER},
  435. </if>
  436. <if test="retrieveContent != null">
  437. #{retrieveContent,jdbcType=VARCHAR},
  438. </if>
  439. <if test="attachmentUrl != null">
  440. #{attachmentUrl,jdbcType=LONGVARCHAR},
  441. </if>
  442. </trim>
  443. </insert>
  444. <select id="countByExample" parameterType="com.goafanti.common.model.TOrderTaskExample" resultType="java.lang.Long">
  445. <!--
  446. WARNING - @mbg.generated
  447. This element is automatically generated by MyBatis Generator, do not modify.
  448. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  449. -->
  450. select count(*) from t_order_task
  451. <if test="_parameter != null">
  452. <include refid="Example_Where_Clause" />
  453. </if>
  454. </select>
  455. <update id="updateByExampleSelective" parameterType="map">
  456. <!--
  457. WARNING - @mbg.generated
  458. This element is automatically generated by MyBatis Generator, do not modify.
  459. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  460. -->
  461. update t_order_task
  462. <set>
  463. <if test="record.id != null">
  464. id = #{record.id,jdbcType=INTEGER},
  465. </if>
  466. <if test="record.orderNo != null">
  467. order_no = #{record.orderNo,jdbcType=VARCHAR},
  468. </if>
  469. <if test="record.main != null">
  470. main = #{record.main,jdbcType=INTEGER},
  471. </if>
  472. <if test="record.superId != null">
  473. super_id = #{record.superId,jdbcType=VARCHAR},
  474. </if>
  475. <if test="record.commodityId != null">
  476. commodity_id = #{record.commodityId,jdbcType=VARCHAR},
  477. </if>
  478. <if test="record.commodityName != null">
  479. commodity_name = #{record.commodityName,jdbcType=VARCHAR},
  480. </if>
  481. <if test="record.commodityQuantity != null">
  482. commodity_quantity = #{record.commodityQuantity,jdbcType=INTEGER},
  483. </if>
  484. <if test="record.commodityMode != null">
  485. commodity_mode = #{record.commodityMode,jdbcType=VARCHAR},
  486. </if>
  487. <if test="record.commodityPrice != null">
  488. commodity_price = #{record.commodityPrice,jdbcType=DECIMAL},
  489. </if>
  490. <if test="record.taskStatus != null">
  491. task_status = #{record.taskStatus,jdbcType=INTEGER},
  492. </if>
  493. <if test="record.taskDistributionTime != null">
  494. task_distribution_time = #{record.taskDistributionTime,jdbcType=TIMESTAMP},
  495. </if>
  496. <if test="record.taskAllocator != null">
  497. task_allocator = #{record.taskAllocator,jdbcType=VARCHAR},
  498. </if>
  499. <if test="record.taskReceiver != null">
  500. task_receiver = #{record.taskReceiver,jdbcType=VARCHAR},
  501. </if>
  502. <if test="record.taskComment != null">
  503. task_comment = #{record.taskComment,jdbcType=VARCHAR},
  504. </if>
  505. <if test="record.taskStartTime != null">
  506. task_start_time = #{record.taskStartTime,jdbcType=TIMESTAMP},
  507. </if>
  508. <if test="record.taskEndTime != null">
  509. task_end_time = #{record.taskEndTime,jdbcType=TIMESTAMP},
  510. </if>
  511. <if test="record.projectStatus != null">
  512. project_status = #{record.projectStatus,jdbcType=INTEGER},
  513. </if>
  514. <if test="record.acceptTime != null">
  515. accept_time = #{record.acceptTime,jdbcType=DATE},
  516. </if>
  517. <if test="record.reviewTime != null">
  518. review_time = #{record.reviewTime,jdbcType=DATE},
  519. </if>
  520. <if test="record.publicityTime != null">
  521. publicity_time = #{record.publicityTime,jdbcType=DATE},
  522. </if>
  523. <if test="record.licenceTime != null">
  524. licence_time = #{record.licenceTime,jdbcType=DATE},
  525. </if>
  526. <if test="record.certificateNumber != null">
  527. certificate_number = #{record.certificateNumber,jdbcType=VARCHAR},
  528. </if>
  529. <if test="record.status != null">
  530. status = #{record.status,jdbcType=INTEGER},
  531. </if>
  532. <if test="record.formRetrieve != null">
  533. form_retrieve = #{record.formRetrieve,jdbcType=INTEGER},
  534. </if>
  535. <if test="record.declareUser != null">
  536. declare_user = #{record.declareUser,jdbcType=VARCHAR},
  537. </if>
  538. <if test="record.declarePwd != null">
  539. declare_pwd = #{record.declarePwd,jdbcType=VARCHAR},
  540. </if>
  541. <if test="record.taskRefund != null">
  542. task_refund = #{record.taskRefund,jdbcType=INTEGER},
  543. </if>
  544. <if test="record.refundContent != null">
  545. refund_content = #{record.refundContent,jdbcType=VARCHAR},
  546. </if>
  547. <if test="record.setUpAmount != null">
  548. set_up_amount = #{record.setUpAmount,jdbcType=DECIMAL},
  549. </if>
  550. <if test="record.arrivalMoney != null">
  551. arrival_money = #{record.arrivalMoney,jdbcType=INTEGER},
  552. </if>
  553. <if test="record.retrieveContent != null">
  554. retrieve_content = #{record.retrieveContent,jdbcType=VARCHAR},
  555. </if>
  556. <if test="record.attachmentUrl != null">
  557. attachment_url = #{record.attachmentUrl,jdbcType=LONGVARCHAR},
  558. </if>
  559. </set>
  560. <if test="_parameter != null">
  561. <include refid="Update_By_Example_Where_Clause" />
  562. </if>
  563. </update>
  564. <update id="updateByExampleWithBLOBs" parameterType="map">
  565. <!--
  566. WARNING - @mbg.generated
  567. This element is automatically generated by MyBatis Generator, do not modify.
  568. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  569. -->
  570. update t_order_task
  571. set id = #{record.id,jdbcType=INTEGER},
  572. order_no = #{record.orderNo,jdbcType=VARCHAR},
  573. main = #{record.main,jdbcType=INTEGER},
  574. super_id = #{record.superId,jdbcType=VARCHAR},
  575. commodity_id = #{record.commodityId,jdbcType=VARCHAR},
  576. commodity_name = #{record.commodityName,jdbcType=VARCHAR},
  577. commodity_quantity = #{record.commodityQuantity,jdbcType=INTEGER},
  578. commodity_mode = #{record.commodityMode,jdbcType=VARCHAR},
  579. commodity_price = #{record.commodityPrice,jdbcType=DECIMAL},
  580. task_status = #{record.taskStatus,jdbcType=INTEGER},
  581. task_distribution_time = #{record.taskDistributionTime,jdbcType=TIMESTAMP},
  582. task_allocator = #{record.taskAllocator,jdbcType=VARCHAR},
  583. task_receiver = #{record.taskReceiver,jdbcType=VARCHAR},
  584. task_comment = #{record.taskComment,jdbcType=VARCHAR},
  585. task_start_time = #{record.taskStartTime,jdbcType=TIMESTAMP},
  586. task_end_time = #{record.taskEndTime,jdbcType=TIMESTAMP},
  587. project_status = #{record.projectStatus,jdbcType=INTEGER},
  588. accept_time = #{record.acceptTime,jdbcType=DATE},
  589. review_time = #{record.reviewTime,jdbcType=DATE},
  590. publicity_time = #{record.publicityTime,jdbcType=DATE},
  591. licence_time = #{record.licenceTime,jdbcType=DATE},
  592. certificate_number = #{record.certificateNumber,jdbcType=VARCHAR},
  593. status = #{record.status,jdbcType=INTEGER},
  594. form_retrieve = #{record.formRetrieve,jdbcType=INTEGER},
  595. declare_user = #{record.declareUser,jdbcType=VARCHAR},
  596. declare_pwd = #{record.declarePwd,jdbcType=VARCHAR},
  597. task_refund = #{record.taskRefund,jdbcType=INTEGER},
  598. refund_content = #{record.refundContent,jdbcType=VARCHAR},
  599. set_up_amount = #{record.setUpAmount,jdbcType=DECIMAL},
  600. arrival_money = #{record.arrivalMoney,jdbcType=INTEGER},
  601. retrieve_content = #{record.retrieveContent,jdbcType=VARCHAR},
  602. attachment_url = #{record.attachmentUrl,jdbcType=LONGVARCHAR}
  603. <if test="_parameter != null">
  604. <include refid="Update_By_Example_Where_Clause" />
  605. </if>
  606. </update>
  607. <update id="updateByExample" parameterType="map">
  608. <!--
  609. WARNING - @mbg.generated
  610. This element is automatically generated by MyBatis Generator, do not modify.
  611. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  612. -->
  613. update t_order_task
  614. set id = #{record.id,jdbcType=INTEGER},
  615. order_no = #{record.orderNo,jdbcType=VARCHAR},
  616. main = #{record.main,jdbcType=INTEGER},
  617. super_id = #{record.superId,jdbcType=VARCHAR},
  618. commodity_id = #{record.commodityId,jdbcType=VARCHAR},
  619. commodity_name = #{record.commodityName,jdbcType=VARCHAR},
  620. commodity_quantity = #{record.commodityQuantity,jdbcType=INTEGER},
  621. commodity_mode = #{record.commodityMode,jdbcType=VARCHAR},
  622. commodity_price = #{record.commodityPrice,jdbcType=DECIMAL},
  623. task_status = #{record.taskStatus,jdbcType=INTEGER},
  624. task_distribution_time = #{record.taskDistributionTime,jdbcType=TIMESTAMP},
  625. task_allocator = #{record.taskAllocator,jdbcType=VARCHAR},
  626. task_receiver = #{record.taskReceiver,jdbcType=VARCHAR},
  627. task_comment = #{record.taskComment,jdbcType=VARCHAR},
  628. task_start_time = #{record.taskStartTime,jdbcType=TIMESTAMP},
  629. task_end_time = #{record.taskEndTime,jdbcType=TIMESTAMP},
  630. project_status = #{record.projectStatus,jdbcType=INTEGER},
  631. accept_time = #{record.acceptTime,jdbcType=DATE},
  632. review_time = #{record.reviewTime,jdbcType=DATE},
  633. publicity_time = #{record.publicityTime,jdbcType=DATE},
  634. licence_time = #{record.licenceTime,jdbcType=DATE},
  635. certificate_number = #{record.certificateNumber,jdbcType=VARCHAR},
  636. status = #{record.status,jdbcType=INTEGER},
  637. form_retrieve = #{record.formRetrieve,jdbcType=INTEGER},
  638. declare_user = #{record.declareUser,jdbcType=VARCHAR},
  639. declare_pwd = #{record.declarePwd,jdbcType=VARCHAR},
  640. task_refund = #{record.taskRefund,jdbcType=INTEGER},
  641. refund_content = #{record.refundContent,jdbcType=VARCHAR},
  642. set_up_amount = #{record.setUpAmount,jdbcType=DECIMAL},
  643. arrival_money = #{record.arrivalMoney,jdbcType=INTEGER},
  644. retrieve_content = #{record.retrieveContent,jdbcType=VARCHAR}
  645. <if test="_parameter != null">
  646. <include refid="Update_By_Example_Where_Clause" />
  647. </if>
  648. </update>
  649. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderTask">
  650. <!--
  651. WARNING - @mbg.generated
  652. This element is automatically generated by MyBatis Generator, do not modify.
  653. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  654. -->
  655. update t_order_task
  656. <set>
  657. <if test="orderNo != null">
  658. order_no = #{orderNo,jdbcType=VARCHAR},
  659. </if>
  660. <if test="main != null">
  661. main = #{main,jdbcType=INTEGER},
  662. </if>
  663. <if test="superId != null">
  664. super_id = #{superId,jdbcType=VARCHAR},
  665. </if>
  666. <if test="commodityId != null">
  667. commodity_id = #{commodityId,jdbcType=VARCHAR},
  668. </if>
  669. <if test="commodityName != null">
  670. commodity_name = #{commodityName,jdbcType=VARCHAR},
  671. </if>
  672. <if test="commodityQuantity != null">
  673. commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
  674. </if>
  675. <if test="commodityMode != null">
  676. commodity_mode = #{commodityMode,jdbcType=VARCHAR},
  677. </if>
  678. <if test="commodityPrice != null">
  679. commodity_price = #{commodityPrice,jdbcType=DECIMAL},
  680. </if>
  681. <if test="taskStatus != null">
  682. task_status = #{taskStatus,jdbcType=INTEGER},
  683. </if>
  684. <if test="taskDistributionTime != null">
  685. task_distribution_time = #{taskDistributionTime,jdbcType=TIMESTAMP},
  686. </if>
  687. <if test="taskAllocator != null">
  688. task_allocator = #{taskAllocator,jdbcType=VARCHAR},
  689. </if>
  690. <if test="taskReceiver != null">
  691. task_receiver = #{taskReceiver,jdbcType=VARCHAR},
  692. </if>
  693. <if test="taskComment != null">
  694. task_comment = #{taskComment,jdbcType=VARCHAR},
  695. </if>
  696. <if test="taskStartTime != null">
  697. task_start_time = #{taskStartTime,jdbcType=TIMESTAMP},
  698. </if>
  699. <if test="taskEndTime != null">
  700. task_end_time = #{taskEndTime,jdbcType=TIMESTAMP},
  701. </if>
  702. <if test="projectStatus != null">
  703. project_status = #{projectStatus,jdbcType=INTEGER},
  704. </if>
  705. <if test="acceptTime != null">
  706. accept_time = #{acceptTime,jdbcType=DATE},
  707. </if>
  708. <if test="reviewTime != null">
  709. review_time = #{reviewTime,jdbcType=DATE},
  710. </if>
  711. <if test="publicityTime != null">
  712. publicity_time = #{publicityTime,jdbcType=DATE},
  713. </if>
  714. <if test="licenceTime != null">
  715. licence_time = #{licenceTime,jdbcType=DATE},
  716. </if>
  717. <if test="certificateNumber != null">
  718. certificate_number = #{certificateNumber,jdbcType=VARCHAR},
  719. </if>
  720. <if test="status != null">
  721. status = #{status,jdbcType=INTEGER},
  722. </if>
  723. <if test="formRetrieve != null">
  724. form_retrieve = #{formRetrieve,jdbcType=INTEGER},
  725. </if>
  726. <if test="declareUser != null">
  727. declare_user = #{declareUser,jdbcType=VARCHAR},
  728. </if>
  729. <if test="declarePwd != null">
  730. declare_pwd = #{declarePwd,jdbcType=VARCHAR},
  731. </if>
  732. <if test="taskRefund != null">
  733. task_refund = #{taskRefund,jdbcType=INTEGER},
  734. </if>
  735. <if test="refundContent != null">
  736. refund_content = #{refundContent,jdbcType=VARCHAR},
  737. </if>
  738. <if test="setUpAmount != null">
  739. set_up_amount = #{setUpAmount,jdbcType=DECIMAL},
  740. </if>
  741. <if test="arrivalMoney != null">
  742. arrival_money = #{arrivalMoney,jdbcType=INTEGER},
  743. </if>
  744. <if test="retrieveContent != null">
  745. retrieve_content = #{retrieveContent,jdbcType=VARCHAR},
  746. </if>
  747. <if test="attachmentUrl != null">
  748. attachment_url = #{attachmentUrl,jdbcType=LONGVARCHAR},
  749. </if>
  750. </set>
  751. where id = #{id,jdbcType=INTEGER}
  752. </update>
  753. <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.goafanti.common.model.TOrderTask">
  754. <!--
  755. WARNING - @mbg.generated
  756. This element is automatically generated by MyBatis Generator, do not modify.
  757. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  758. -->
  759. update t_order_task
  760. set order_no = #{orderNo,jdbcType=VARCHAR},
  761. main = #{main,jdbcType=INTEGER},
  762. super_id = #{superId,jdbcType=VARCHAR},
  763. commodity_id = #{commodityId,jdbcType=VARCHAR},
  764. commodity_name = #{commodityName,jdbcType=VARCHAR},
  765. commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
  766. commodity_mode = #{commodityMode,jdbcType=VARCHAR},
  767. commodity_price = #{commodityPrice,jdbcType=DECIMAL},
  768. task_status = #{taskStatus,jdbcType=INTEGER},
  769. task_distribution_time = #{taskDistributionTime,jdbcType=TIMESTAMP},
  770. task_allocator = #{taskAllocator,jdbcType=VARCHAR},
  771. task_receiver = #{taskReceiver,jdbcType=VARCHAR},
  772. task_comment = #{taskComment,jdbcType=VARCHAR},
  773. task_start_time = #{taskStartTime,jdbcType=TIMESTAMP},
  774. task_end_time = #{taskEndTime,jdbcType=TIMESTAMP},
  775. project_status = #{projectStatus,jdbcType=INTEGER},
  776. accept_time = #{acceptTime,jdbcType=DATE},
  777. review_time = #{reviewTime,jdbcType=DATE},
  778. publicity_time = #{publicityTime,jdbcType=DATE},
  779. licence_time = #{licenceTime,jdbcType=DATE},
  780. certificate_number = #{certificateNumber,jdbcType=VARCHAR},
  781. status = #{status,jdbcType=INTEGER},
  782. form_retrieve = #{formRetrieve,jdbcType=INTEGER},
  783. declare_user = #{declareUser,jdbcType=VARCHAR},
  784. declare_pwd = #{declarePwd,jdbcType=VARCHAR},
  785. task_refund = #{taskRefund,jdbcType=INTEGER},
  786. refund_content = #{refundContent,jdbcType=VARCHAR},
  787. set_up_amount = #{setUpAmount,jdbcType=DECIMAL},
  788. arrival_money = #{arrivalMoney,jdbcType=INTEGER},
  789. retrieve_content = #{retrieveContent,jdbcType=VARCHAR},
  790. attachment_url = #{attachmentUrl,jdbcType=LONGVARCHAR}
  791. where id = #{id,jdbcType=INTEGER}
  792. </update>
  793. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderTask">
  794. <!--
  795. WARNING - @mbg.generated
  796. This element is automatically generated by MyBatis Generator, do not modify.
  797. This element was generated on Thu Jun 06 14:08:45 CST 2019.
  798. -->
  799. update t_order_task
  800. set order_no = #{orderNo,jdbcType=VARCHAR},
  801. main = #{main,jdbcType=INTEGER},
  802. super_id = #{superId,jdbcType=VARCHAR},
  803. commodity_id = #{commodityId,jdbcType=VARCHAR},
  804. commodity_name = #{commodityName,jdbcType=VARCHAR},
  805. commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
  806. commodity_mode = #{commodityMode,jdbcType=VARCHAR},
  807. commodity_price = #{commodityPrice,jdbcType=DECIMAL},
  808. task_status = #{taskStatus,jdbcType=INTEGER},
  809. task_distribution_time = #{taskDistributionTime,jdbcType=TIMESTAMP},
  810. task_allocator = #{taskAllocator,jdbcType=VARCHAR},
  811. task_receiver = #{taskReceiver,jdbcType=VARCHAR},
  812. task_comment = #{taskComment,jdbcType=VARCHAR},
  813. task_start_time = #{taskStartTime,jdbcType=TIMESTAMP},
  814. task_end_time = #{taskEndTime,jdbcType=TIMESTAMP},
  815. project_status = #{projectStatus,jdbcType=INTEGER},
  816. accept_time = #{acceptTime,jdbcType=DATE},
  817. review_time = #{reviewTime,jdbcType=DATE},
  818. publicity_time = #{publicityTime,jdbcType=DATE},
  819. licence_time = #{licenceTime,jdbcType=DATE},
  820. certificate_number = #{certificateNumber,jdbcType=VARCHAR},
  821. status = #{status,jdbcType=INTEGER},
  822. form_retrieve = #{formRetrieve,jdbcType=INTEGER},
  823. declare_user = #{declareUser,jdbcType=VARCHAR},
  824. declare_pwd = #{declarePwd,jdbcType=VARCHAR},
  825. task_refund = #{taskRefund,jdbcType=INTEGER},
  826. refund_content = #{refundContent,jdbcType=VARCHAR},
  827. set_up_amount = #{setUpAmount,jdbcType=DECIMAL},
  828. arrival_money = #{arrivalMoney,jdbcType=INTEGER},
  829. retrieve_content = #{retrieveContent,jdbcType=VARCHAR}
  830. where id = #{id,jdbcType=INTEGER}
  831. </update>
  832. <select id="selectOrderTask" resultType="com.goafanti.order.bo.TOrderTaskBo">
  833. select
  834. a.id,a.order_no as orderNo,a.commodity_name as commodityName,a.commodity_id as commodityId,
  835. a.commodity_quantity as commodityQuantity,a.commodity_price as commodityPrice,a.task_comment as taskComment,
  836. a.task_status as taskStatus,a.project_status as projectStatus,a.main,a.task_receiver as taskReceiver ,a.certificate_number as certificateNumber,
  837. d.name as contacts,d.contact_mobile as contactsMobile,c.cname
  838. from t_order_task a left join business_project b on a.commodity_id=b.id
  839. left join business_category c on b.cid=c.id left join admin d on a.task_receiver=d.id
  840. where a.super_id is null and a.order_no= #{orderNo,jdbcType=VARCHAR}
  841. </select>
  842. <select id="selectOrderTaskListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
  843. select a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,
  844. a.project_status as projectStatus,a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,
  845. a.commodity_quantity as commodityQuantity,ifnull(i.alreadyNumber,0) as alreadyNumber,f.nickname as userName,h.name as depName
  846. from t_order_task a left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.id
  847. left join admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no left join user f on e.buyer_id=f.id
  848. left join department h on e.order_dep=h.id left join (select task_id , sum(already_number) as alreadyNumber from task_progress
  849. group by task_id) i on a.id=i.task_id where e.delete_sign=0 and e.order_status not in (5,7)
  850. <if test="specially == 0">
  851. and a.task_receiver= #{aid,jdbcType=VARCHAR}
  852. </if>
  853. <if test="specially == 1">
  854. and a.task_receiver= #{aid,jdbcType=VARCHAR}
  855. </if>
  856. <if test="specially == 2">
  857. and d.superior_id= (select department_id from admin where id= #{aid,jdbcType=VARCHAR})
  858. </if>
  859. <if test="orderNo != null">
  860. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  861. </if>
  862. <if test="depId != null">
  863. and e.order_dep= #{depId,jdbcType=VARCHAR}
  864. </if>
  865. <if test="name != null">
  866. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  867. </if>
  868. <if test="orderNo != null">
  869. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  870. </if>
  871. <if test="taskId != null">
  872. and a.id= #{taskId,jdbcType=VARCHAR}
  873. </if>
  874. <if test="taskStatus != null">
  875. and a.task_status= #{taskStatus,jdbcType=INTEGER}
  876. </if>
  877. <if test="adminName != null">
  878. and d.name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
  879. </if>
  880. order by a.task_distribution_time desc
  881. <if test="page_sql!=null">
  882. ${page_sql}
  883. </if>
  884. </select>
  885. <select id="selectOrderTaskListCount" resultType="java.lang.Integer">
  886. select count(*)
  887. from t_order_task a
  888. left join admin d on a.task_receiver=d.id
  889. left join t_order_new e on a.order_no=e.order_no
  890. left join admin g on e.salesman_id=g.id
  891. left join department h on g.department_id=h.id
  892. where e.delete_sign=0 and e.order_status not in (5,7)
  893. <if test="specially == 0">
  894. and a.task_receiver= #{aid,jdbcType=VARCHAR}
  895. </if>
  896. <if test="specially == 1">
  897. and a.task_receiver= #{aid,jdbcType=VARCHAR}
  898. </if>
  899. <if test="specially == 2">
  900. and d.superior_id= (select department_id from admin where id= #{aid,jdbcType=VARCHAR})
  901. </if>
  902. <if test="orderNo != null">
  903. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  904. </if>
  905. <if test="depId != null">
  906. and e.order_dep= #{depId,jdbcType=VARCHAR}
  907. </if>
  908. <if test="name != null">
  909. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  910. </if>
  911. <if test="orderNo != null">
  912. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  913. </if>
  914. <if test="taskId != null">
  915. and a.id= #{taskId,jdbcType=VARCHAR}
  916. </if>
  917. <if test="taskStatus != null">
  918. and a.task_status= #{taskStatus,jdbcType=INTEGER}
  919. </if>
  920. <if test="adminName != null">
  921. and d.name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
  922. </if>
  923. </select>
  924. <select id="getOrderTaskDetail" resultType="com.goafanti.order.bo.TOrderTaskDetailBo">
  925. select
  926. a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,a.task_comment as taskComment,
  927. a.project_status as projectStatus,a.task_status as taskStatus,e.contacts,a.attachment_url as attachmentUrl,
  928. f.nickname as userName,g.name as salesmanName,date_format(a.task_start_time,'%Y-%m-%d') as startDate,a.retrieve_content as retrieveContent,
  929. a.certificate_number as certificateNumber, a.status,a.form_retrieve as formRetrieve, a.task_refund as taskRefund,
  930. a.refund_content as refundContent, a.declare_user as declareUser, a.declare_pwd as declarePwd,e.contract_no as contractNo,
  931. date_format(a.task_end_time,'%Y-%m-%d') as endDate,date_format(a.accept_time,'%Y-%m-%d') as acceptDate,h.name as depName,
  932. date_format(a.review_time,'%Y-%m-%d') as reviewDate,date_format(a.publicity_time,'%Y-%m-%d') as publicityDate,
  933. date_format(a.licence_time,'%Y-%m-%d') as licenceDate,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,
  934. e.contacts ,e.contact_mobile as contactMobile ,e.legal_person as legalPerson,e.legal_person_tel as legalPersonTel,
  935. a.set_up_amount as setUpAmount,a.arrival_money as arrivalMoney
  936. from t_order_task a left join business_project b on a.commodity_id=b.id
  937. left join business_category c on b.cid=c.id
  938. left join admin d on a.task_receiver=d.id
  939. left join t_order_new e on a.order_no=e.order_no
  940. left join department h on e.order_dep=h.id
  941. left join user f on e.buyer_id=f.id
  942. left join admin g on e.salesman_id=g.id
  943. where a.id= #{id,jdbcType=VARCHAR}
  944. </select>
  945. <select id="selectBySuperId" resultType="com.goafanti.common.model.TOrderTask">
  946. select super_id as superId,min(task_status) as taskStatus,min(project_status) as projectStatus,max(main) as main from t_order_task
  947. where super_id = #{superId,jdbcType=VARCHAR} group by super_id
  948. </select>
  949. <select id="selectTaskHoursListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
  950. select a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,dep.name as depName,
  951. a.task_status as taskStatus,f.nickname as userName,ifnull(g.hours,0) as hours,a.commodity_quantity as commodityQuantity,
  952. e.contract_no as contractNo,date_format(e.create_time,'%Y-%m-%d %H:%I:%S')as creteTime,date_format(e.sign_time,'%Y-%m-%d')as signTime
  953. from t_order_task a left join business_project b on a.commodity_id=b.id
  954. left join business_category c on b.cid=c.id
  955. left join admin d on a.task_receiver=d.id
  956. left join t_order_new e on a.order_no=e.order_no
  957. left join department dep on e.order_dep=dep.id
  958. left join user f on e.buyer_id=f.id
  959. left join (select task_id,sum(hours) as hours from t_task_hours group by task_id) g on a.id=g.task_id
  960. where e.delete_sign=0 and a.super_id is null
  961. <if test="name != null">
  962. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  963. </if>
  964. <if test="taskId != null">
  965. and a.id= #{taskId,jdbcType=VARCHAR}
  966. </if>
  967. <if test="starTime !=null and endTime !=null">
  968. and a.task_start_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  969. </if>
  970. order by a.task_start_time desc
  971. <if test="page_sql!=null">
  972. ${page_sql}
  973. </if>
  974. </select>
  975. <select id="selectTaskHoursListCount" resultType="java.lang.Integer">
  976. select count(*)
  977. from t_order_task a left join business_project b on a.commodity_id=b.id
  978. left join business_category c on b.cid=c.id
  979. left join admin d on a.task_receiver=d.id
  980. left join t_order_new e on a.order_no=e.order_no
  981. left join user f on e.buyer_id=f.id
  982. where e.delete_sign=0 and a.super_id is null
  983. <if test="name != null">
  984. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  985. </if>
  986. <if test="taskId != null">
  987. and a.id= #{taskId,jdbcType=VARCHAR}
  988. </if>
  989. <if test="starTime !=null and endTime !=null">
  990. and a.task_start_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  991. </if>
  992. </select>
  993. <select id="selectTaskListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
  994. select a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,
  995. a.project_status as projectStatus,a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,
  996. a.commodity_quantity as commodityQuantity,f.nickname as userName,h.name as depName,ifnull(i.alreadyNumber,0)as alreadyNumber
  997. from (select task_id from t_task_log a where task_receiver='e36eba1b-3b1a-4297-9c03-17952205d84e ' UNION select task_id from t_task_log a
  998. where task_allocator='e36eba1b-3b1a-4297-9c03-17952205d84e') x left join t_order_task a on x.task_id=a.id
  999. left join business_project b on a.commodity_id=b.id
  1000. left join business_category c on b.cid=c.id
  1001. left join admin d on a.task_receiver=d.id
  1002. left join t_order_new e on a.order_no=e.order_no
  1003. left join user f on e.buyer_id=f.id
  1004. left join department h on e.order_dep=h.id
  1005. left join (select task_id , sum(already_number) as alreadyNumber from task_progress group by task_id) i on a.id=i.task_id
  1006. where e.delete_sign=0
  1007. <if test="orderNo != null">
  1008. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1009. </if>
  1010. <if test="name != null">
  1011. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1012. </if>
  1013. <if test="orderNo != null">
  1014. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1015. </if>
  1016. <if test="depId != null">
  1017. and e.order_dep= #{depId ,jdbcType=VARCHAR}
  1018. </if>
  1019. <if test="taskId != null">
  1020. and a.id= #{taskId,jdbcType=VARCHAR}
  1021. </if>
  1022. <if test="taskStatus != null">
  1023. and a.task_status= #{taskStatus,jdbcType=INTEGER}
  1024. </if>
  1025. <if test="adminName != null">
  1026. and d.name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
  1027. </if>
  1028. order by a.task_distribution_time desc
  1029. <if test="page_sql!=null">
  1030. ${page_sql}
  1031. </if>
  1032. </select>
  1033. <select id="selectTaskListCount" resultType="java.lang.Integer">
  1034. select count(*)
  1035. from (select task_id from t_task_log a where task_receiver='e36eba1b-3b1a-4297-9c03-17952205d84e ' UNION select task_id from t_task_log a
  1036. where task_allocator='e36eba1b-3b1a-4297-9c03-17952205d84e') x left join t_order_task a on x.task_id=a.id
  1037. left join business_project b on a.commodity_id=b.id
  1038. left join business_category c on b.cid=c.id
  1039. left join admin d on a.task_receiver=d.id
  1040. left join t_order_new e on a.order_no=e.order_no
  1041. left join user f on e.buyer_id=f.id
  1042. left join department h on e.order_dep=h.id
  1043. left join (select task_id , sum(already_number) as alreadyNumber from task_progress group by task_id) i on a.id=i.task_id
  1044. where e.delete_sign=0
  1045. <if test="orderNo != null">
  1046. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1047. </if>
  1048. <if test="name != null">
  1049. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1050. </if>
  1051. <if test="depId != null">
  1052. and e.order_dep= #{depId ,jdbcType=VARCHAR}
  1053. </if>
  1054. <if test="orderNo != null">
  1055. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1056. </if>
  1057. <if test="taskId != null">
  1058. and a.id= #{taskId,jdbcType=VARCHAR}
  1059. </if>
  1060. <if test="taskStatus != null">
  1061. and a.task_status= #{taskStatus,jdbcType=INTEGER}
  1062. </if>
  1063. <if test="adminName != null">
  1064. and d.name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
  1065. </if>
  1066. </select>
  1067. <!-- 根据订单编号获得所有的任务负责人 -->
  1068. <select id="getReceiverByOid" parameterType="java.lang.String" resultMap="BaseResultMap">
  1069. select distinct task_receiver, a.name, a.email, t.id, t.project_status from t_order_task t
  1070. inner join admin a on t.task_receiver = a.id
  1071. where order_no = #{orderNo,jdbcType=VARCHAR} and task_status &gt; 0 and super_id is null
  1072. </select>
  1073. <update id="updateDimissionTransfer" parameterType="java.lang.String">
  1074. update t_order_task set task_allocator= #{aid,jdbcType=VARCHAR},task_receiver= #{transferId,jdbcType=VARCHAR}
  1075. where task_receiver=#{aid,jdbcType=VARCHAR}
  1076. </update>
  1077. </mapper>