TOrderTaskMapper.xml 53 KB

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