TOrderTaskMapper.xml 65 KB

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