TOrderTaskMapper.xml 87 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099
  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. <id column="id" jdbcType="INTEGER" property="id" />
  6. <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
  7. <result column="main" jdbcType="INTEGER" property="main" />
  8. <result column="super_id" jdbcType="VARCHAR" property="superId" />
  9. <result column="commodity_id" jdbcType="VARCHAR" property="commodityId" />
  10. <result column="commodity_name" jdbcType="VARCHAR" property="commodityName" />
  11. <result column="commodity_quantity" jdbcType="INTEGER" property="commodityQuantity" />
  12. <result column="commodity_mode" jdbcType="VARCHAR" property="commodityMode" />
  13. <result column="commodity_price" jdbcType="DECIMAL" property="commodityPrice" />
  14. <result column="task_status" jdbcType="INTEGER" property="taskStatus" />
  15. <result column="task_distribution_time" jdbcType="TIMESTAMP" property="taskDistributionTime" />
  16. <result column="task_allocator" jdbcType="VARCHAR" property="taskAllocator" />
  17. <result column="task_receiver" jdbcType="VARCHAR" property="taskReceiver" />
  18. <result column="task_comment" jdbcType="VARCHAR" property="taskComment" />
  19. <result column="task_start_time" jdbcType="TIMESTAMP" property="taskStartTime" />
  20. <result column="task_end_time" jdbcType="TIMESTAMP" property="taskEndTime" />
  21. <result column="attachment_url" jdbcType="VARCHAR" property="attachmentUrl" />
  22. <result column="project_status" jdbcType="INTEGER" property="projectStatus" />
  23. <result column="accept_time" jdbcType="DATE" property="acceptTime" />
  24. <result column="review_time" jdbcType="DATE" property="reviewTime" />
  25. <result column="publicity_time" jdbcType="DATE" property="publicityTime" />
  26. <result column="licence_time" jdbcType="DATE" property="licenceTime" />
  27. <result column="certificate_number" jdbcType="VARCHAR" property="certificateNumber" />
  28. <result column="status" jdbcType="INTEGER" property="status" />
  29. <result column="form_retrieve" jdbcType="INTEGER" property="formRetrieve" />
  30. <result column="task_refund" jdbcType="INTEGER" property="taskRefund" />
  31. <result column="refund_content" jdbcType="VARCHAR" property="refundContent" />
  32. <result column="retrieve_content" jdbcType="VARCHAR" property="retrieveContent" />
  33. <result column="declare_user" jdbcType="VARCHAR" property="declareUser" />
  34. <result column="declare_pwd" jdbcType="VARCHAR" property="declarePwd" />
  35. <result column="set_up_amount" jdbcType="DECIMAL" property="setUpAmount" />
  36. <result column="arrival_money" jdbcType="INTEGER" property="arrivalMoney" />
  37. <result column="outsource_name" jdbcType="VARCHAR" property="outsourceName" />
  38. <result column="outsource_price" jdbcType="DECIMAL" property="outsourcePrice" />
  39. <result column="consultant_id" jdbcType="VARCHAR" property="consultantId" />
  40. <result column="manager_id" jdbcType="VARCHAR" property="managerId" />
  41. <result column="outsource" jdbcType="INTEGER" property="outsource" />
  42. <result column="split_super" jdbcType="INTEGER" property="splitSuper" />
  43. <result column="split_status" jdbcType="INTEGER" property="splitStatus" />
  44. <result column="split_id" jdbcType="INTEGER" property="splitId" />
  45. <result column="split_aid" jdbcType="VARCHAR" property="splitAid" />
  46. <result column="split_time" jdbcType="TIMESTAMP" property="splitTime" />
  47. <result column="cname" jdbcType="VARCHAR" property="cname" />
  48. <result column="receiver_name" jdbcType="VARCHAR" property="receiverName" />
  49. <result column="declaration_batch" jdbcType="INTEGER" property="declarationBatch" />
  50. <result column="cost_reduction" jdbcType="INTEGER" property="costReduction" />
  51. <result column="official_cost" jdbcType="INTEGER" property="officialCost" />
  52. <result column="set_up_status" jdbcType="INTEGER" property="setUpStatus" />
  53. <result column="set_up_time" jdbcType="TIMESTAMP" property="setUpTime" />
  54. <result column="spot_check_status" jdbcType="INTEGER" property="spotCheckStatus" />
  55. <result column="high_tech_status" jdbcType="INTEGER" property="highTechStatus" />
  56. <result column="special_comment" jdbcType="VARCHAR" property="specialComment" />
  57. <result column="if_certification_fee" jdbcType="INTEGER" property="ifCertificationFee" />
  58. <result column="certification_fee" jdbcType="DECIMAL" property="certificationFee" />
  59. <result column="certification_corporate" jdbcType="VARCHAR" property="certificationCorporate" />
  60. <result column="time_record" jdbcType="VARCHAR" property="timeRecord" />
  61. <result column="if_publicity" jdbcType="INTEGER" property="ifPublicity" />
  62. <result column="check_status" jdbcType="INTEGER" property="checkStatus" />
  63. <result column="patent_type" jdbcType="INTEGER" property="patentType" />
  64. <result column="pubicity_url" jdbcType="VARCHAR" property="pubicityUrl" />
  65. </resultMap>
  66. <sql id="Base_Column_List">
  67. id, order_no, main, super_id, commodity_id, commodity_name, commodity_quantity, commodity_mode,
  68. commodity_price, task_status, task_distribution_time, task_allocator, task_receiver,
  69. task_comment, task_start_time, task_end_time, attachment_url, project_status, accept_time,
  70. review_time, publicity_time, licence_time, certificate_number, `status`, form_retrieve,
  71. task_refund, refund_content, retrieve_content, declare_user, declare_pwd, set_up_amount,
  72. arrival_money, outsource_name, outsource_price, consultant_id, manager_id, outsource,
  73. split_super, split_status, split_id, split_aid, split_time, cname, receiver_name,
  74. declaration_batch, cost_reduction, official_cost, set_up_status, set_up_time, spot_check_status,
  75. high_tech_status, special_comment, if_certification_fee, certification_fee, certification_corporate,
  76. time_record, if_publicity, check_status, patent_type, pubicity_url
  77. </sql>
  78. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  79. select
  80. <include refid="Base_Column_List" />
  81. from t_order_task
  82. where id = #{id,jdbcType=INTEGER}
  83. </select>
  84. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  85. delete from t_order_task
  86. where id = #{id,jdbcType=INTEGER}
  87. </delete>
  88. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderTask" useGeneratedKeys="true">
  89. insert into t_order_task (order_no, main, super_id,
  90. commodity_id, commodity_name, commodity_quantity,
  91. commodity_mode, commodity_price, task_status,
  92. task_distribution_time, task_allocator,
  93. task_receiver, task_comment, task_start_time,
  94. task_end_time, attachment_url, project_status,
  95. accept_time, review_time, publicity_time,
  96. licence_time, certificate_number, `status`,
  97. form_retrieve, task_refund, refund_content,
  98. retrieve_content, declare_user, declare_pwd,
  99. set_up_amount, arrival_money, outsource_name,
  100. outsource_price, consultant_id, manager_id,
  101. outsource, split_super, split_status,
  102. split_id, split_aid, split_time,
  103. cname, receiver_name, declaration_batch,
  104. cost_reduction, official_cost, set_up_status,
  105. set_up_time, spot_check_status, high_tech_status,
  106. special_comment, if_certification_fee, certification_fee,
  107. certification_corporate, time_record, if_publicity,
  108. check_status, patent_type, pubicity_url
  109. )
  110. values (#{orderNo,jdbcType=VARCHAR}, #{main,jdbcType=INTEGER}, #{superId,jdbcType=VARCHAR},
  111. #{commodityId,jdbcType=VARCHAR}, #{commodityName,jdbcType=VARCHAR}, #{commodityQuantity,jdbcType=INTEGER},
  112. #{commodityMode,jdbcType=VARCHAR}, #{commodityPrice,jdbcType=DECIMAL}, #{taskStatus,jdbcType=INTEGER},
  113. #{taskDistributionTime,jdbcType=TIMESTAMP}, #{taskAllocator,jdbcType=VARCHAR},
  114. #{taskReceiver,jdbcType=VARCHAR}, #{taskComment,jdbcType=VARCHAR}, #{taskStartTime,jdbcType=TIMESTAMP},
  115. #{taskEndTime,jdbcType=TIMESTAMP}, #{attachmentUrl,jdbcType=VARCHAR}, #{projectStatus,jdbcType=INTEGER},
  116. #{acceptTime,jdbcType=DATE}, #{reviewTime,jdbcType=DATE}, #{publicityTime,jdbcType=DATE},
  117. #{licenceTime,jdbcType=DATE}, #{certificateNumber,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
  118. #{formRetrieve,jdbcType=INTEGER}, #{taskRefund,jdbcType=INTEGER}, #{refundContent,jdbcType=VARCHAR},
  119. #{retrieveContent,jdbcType=VARCHAR}, #{declareUser,jdbcType=VARCHAR}, #{declarePwd,jdbcType=VARCHAR},
  120. #{setUpAmount,jdbcType=DECIMAL}, #{arrivalMoney,jdbcType=INTEGER}, #{outsourceName,jdbcType=VARCHAR},
  121. #{outsourcePrice,jdbcType=DECIMAL}, #{consultantId,jdbcType=VARCHAR}, #{managerId,jdbcType=VARCHAR},
  122. #{outsource,jdbcType=INTEGER}, #{splitSuper,jdbcType=INTEGER}, #{splitStatus,jdbcType=INTEGER},
  123. #{splitId,jdbcType=INTEGER}, #{splitAid,jdbcType=VARCHAR}, #{splitTime,jdbcType=TIMESTAMP},
  124. #{cname,jdbcType=VARCHAR}, #{receiverName,jdbcType=VARCHAR}, #{declarationBatch,jdbcType=INTEGER},
  125. #{costReduction,jdbcType=INTEGER}, #{officialCost,jdbcType=INTEGER}, #{setUpStatus,jdbcType=INTEGER},
  126. #{setUpTime,jdbcType=TIMESTAMP}, #{spotCheckStatus,jdbcType=INTEGER}, #{highTechStatus,jdbcType=INTEGER},
  127. #{specialComment,jdbcType=VARCHAR}, #{ifCertificationFee,jdbcType=INTEGER}, #{certificationFee,jdbcType=DECIMAL},
  128. #{certificationCorporate,jdbcType=VARCHAR}, #{timeRecord,jdbcType=VARCHAR}, #{ifPublicity,jdbcType=INTEGER},
  129. #{checkStatus,jdbcType=INTEGER}, #{patentType,jdbcType=INTEGER}, #{pubicityUrl,jdbcType=VARCHAR}
  130. )
  131. </insert>
  132. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderTask" useGeneratedKeys="true">
  133. insert into t_order_task
  134. <trim prefix="(" suffix=")" suffixOverrides=",">
  135. <if test="orderNo != null">
  136. order_no,
  137. </if>
  138. <if test="main != null">
  139. main,
  140. </if>
  141. <if test="superId != null">
  142. super_id,
  143. </if>
  144. <if test="commodityId != null">
  145. commodity_id,
  146. </if>
  147. <if test="commodityName != null">
  148. commodity_name,
  149. </if>
  150. <if test="commodityQuantity != null">
  151. commodity_quantity,
  152. </if>
  153. <if test="commodityMode != null">
  154. commodity_mode,
  155. </if>
  156. <if test="commodityPrice != null">
  157. commodity_price,
  158. </if>
  159. <if test="taskStatus != null">
  160. task_status,
  161. </if>
  162. <if test="taskDistributionTime != null">
  163. task_distribution_time,
  164. </if>
  165. <if test="taskAllocator != null">
  166. task_allocator,
  167. </if>
  168. <if test="taskReceiver != null">
  169. task_receiver,
  170. </if>
  171. <if test="taskComment != null">
  172. task_comment,
  173. </if>
  174. <if test="taskStartTime != null">
  175. task_start_time,
  176. </if>
  177. <if test="taskEndTime != null">
  178. task_end_time,
  179. </if>
  180. <if test="attachmentUrl != null">
  181. attachment_url,
  182. </if>
  183. <if test="projectStatus != null">
  184. project_status,
  185. </if>
  186. <if test="acceptTime != null">
  187. accept_time,
  188. </if>
  189. <if test="reviewTime != null">
  190. review_time,
  191. </if>
  192. <if test="publicityTime != null">
  193. publicity_time,
  194. </if>
  195. <if test="licenceTime != null">
  196. licence_time,
  197. </if>
  198. <if test="certificateNumber != null">
  199. certificate_number,
  200. </if>
  201. <if test="status != null">
  202. `status`,
  203. </if>
  204. <if test="formRetrieve != null">
  205. form_retrieve,
  206. </if>
  207. <if test="taskRefund != null">
  208. task_refund,
  209. </if>
  210. <if test="refundContent != null">
  211. refund_content,
  212. </if>
  213. <if test="retrieveContent != null">
  214. retrieve_content,
  215. </if>
  216. <if test="declareUser != null">
  217. declare_user,
  218. </if>
  219. <if test="declarePwd != null">
  220. declare_pwd,
  221. </if>
  222. <if test="setUpAmount != null">
  223. set_up_amount,
  224. </if>
  225. <if test="arrivalMoney != null">
  226. arrival_money,
  227. </if>
  228. <if test="outsourceName != null">
  229. outsource_name,
  230. </if>
  231. <if test="outsourcePrice != null">
  232. outsource_price,
  233. </if>
  234. <if test="consultantId != null">
  235. consultant_id,
  236. </if>
  237. <if test="managerId != null">
  238. manager_id,
  239. </if>
  240. <if test="outsource != null">
  241. outsource,
  242. </if>
  243. <if test="splitSuper != null">
  244. split_super,
  245. </if>
  246. <if test="splitStatus != null">
  247. split_status,
  248. </if>
  249. <if test="splitId != null">
  250. split_id,
  251. </if>
  252. <if test="splitAid != null">
  253. split_aid,
  254. </if>
  255. <if test="splitTime != null">
  256. split_time,
  257. </if>
  258. <if test="cname != null">
  259. cname,
  260. </if>
  261. <if test="receiverName != null">
  262. receiver_name,
  263. </if>
  264. <if test="declarationBatch != null">
  265. declaration_batch,
  266. </if>
  267. <if test="costReduction != null">
  268. cost_reduction,
  269. </if>
  270. <if test="officialCost != null">
  271. official_cost,
  272. </if>
  273. <if test="setUpStatus != null">
  274. set_up_status,
  275. </if>
  276. <if test="setUpTime != null">
  277. set_up_time,
  278. </if>
  279. <if test="spotCheckStatus != null">
  280. spot_check_status,
  281. </if>
  282. <if test="highTechStatus != null">
  283. high_tech_status,
  284. </if>
  285. <if test="specialComment != null">
  286. special_comment,
  287. </if>
  288. <if test="ifCertificationFee != null">
  289. if_certification_fee,
  290. </if>
  291. <if test="certificationFee != null">
  292. certification_fee,
  293. </if>
  294. <if test="certificationCorporate != null">
  295. certification_corporate,
  296. </if>
  297. <if test="timeRecord != null">
  298. time_record,
  299. </if>
  300. <if test="ifPublicity != null">
  301. if_publicity,
  302. </if>
  303. <if test="checkStatus != null">
  304. check_status,
  305. </if>
  306. <if test="patentType != null">
  307. patent_type,
  308. </if>
  309. <if test="pubicityUrl != null">
  310. pubicity_url,
  311. </if>
  312. </trim>
  313. <trim prefix="values (" suffix=")" suffixOverrides=",">
  314. <if test="orderNo != null">
  315. #{orderNo,jdbcType=VARCHAR},
  316. </if>
  317. <if test="main != null">
  318. #{main,jdbcType=INTEGER},
  319. </if>
  320. <if test="superId != null">
  321. #{superId,jdbcType=VARCHAR},
  322. </if>
  323. <if test="commodityId != null">
  324. #{commodityId,jdbcType=VARCHAR},
  325. </if>
  326. <if test="commodityName != null">
  327. #{commodityName,jdbcType=VARCHAR},
  328. </if>
  329. <if test="commodityQuantity != null">
  330. #{commodityQuantity,jdbcType=INTEGER},
  331. </if>
  332. <if test="commodityMode != null">
  333. #{commodityMode,jdbcType=VARCHAR},
  334. </if>
  335. <if test="commodityPrice != null">
  336. #{commodityPrice,jdbcType=DECIMAL},
  337. </if>
  338. <if test="taskStatus != null">
  339. #{taskStatus,jdbcType=INTEGER},
  340. </if>
  341. <if test="taskDistributionTime != null">
  342. #{taskDistributionTime,jdbcType=TIMESTAMP},
  343. </if>
  344. <if test="taskAllocator != null">
  345. #{taskAllocator,jdbcType=VARCHAR},
  346. </if>
  347. <if test="taskReceiver != null">
  348. #{taskReceiver,jdbcType=VARCHAR},
  349. </if>
  350. <if test="taskComment != null">
  351. #{taskComment,jdbcType=VARCHAR},
  352. </if>
  353. <if test="taskStartTime != null">
  354. #{taskStartTime,jdbcType=TIMESTAMP},
  355. </if>
  356. <if test="taskEndTime != null">
  357. #{taskEndTime,jdbcType=TIMESTAMP},
  358. </if>
  359. <if test="attachmentUrl != null">
  360. #{attachmentUrl,jdbcType=VARCHAR},
  361. </if>
  362. <if test="projectStatus != null">
  363. #{projectStatus,jdbcType=INTEGER},
  364. </if>
  365. <if test="acceptTime != null">
  366. #{acceptTime,jdbcType=DATE},
  367. </if>
  368. <if test="reviewTime != null">
  369. #{reviewTime,jdbcType=DATE},
  370. </if>
  371. <if test="publicityTime != null">
  372. #{publicityTime,jdbcType=DATE},
  373. </if>
  374. <if test="licenceTime != null">
  375. #{licenceTime,jdbcType=DATE},
  376. </if>
  377. <if test="certificateNumber != null">
  378. #{certificateNumber,jdbcType=VARCHAR},
  379. </if>
  380. <if test="status != null">
  381. #{status,jdbcType=INTEGER},
  382. </if>
  383. <if test="formRetrieve != null">
  384. #{formRetrieve,jdbcType=INTEGER},
  385. </if>
  386. <if test="taskRefund != null">
  387. #{taskRefund,jdbcType=INTEGER},
  388. </if>
  389. <if test="refundContent != null">
  390. #{refundContent,jdbcType=VARCHAR},
  391. </if>
  392. <if test="retrieveContent != null">
  393. #{retrieveContent,jdbcType=VARCHAR},
  394. </if>
  395. <if test="declareUser != null">
  396. #{declareUser,jdbcType=VARCHAR},
  397. </if>
  398. <if test="declarePwd != null">
  399. #{declarePwd,jdbcType=VARCHAR},
  400. </if>
  401. <if test="setUpAmount != null">
  402. #{setUpAmount,jdbcType=DECIMAL},
  403. </if>
  404. <if test="arrivalMoney != null">
  405. #{arrivalMoney,jdbcType=INTEGER},
  406. </if>
  407. <if test="outsourceName != null">
  408. #{outsourceName,jdbcType=VARCHAR},
  409. </if>
  410. <if test="outsourcePrice != null">
  411. #{outsourcePrice,jdbcType=DECIMAL},
  412. </if>
  413. <if test="consultantId != null">
  414. #{consultantId,jdbcType=VARCHAR},
  415. </if>
  416. <if test="managerId != null">
  417. #{managerId,jdbcType=VARCHAR},
  418. </if>
  419. <if test="outsource != null">
  420. #{outsource,jdbcType=INTEGER},
  421. </if>
  422. <if test="splitSuper != null">
  423. #{splitSuper,jdbcType=INTEGER},
  424. </if>
  425. <if test="splitStatus != null">
  426. #{splitStatus,jdbcType=INTEGER},
  427. </if>
  428. <if test="splitId != null">
  429. #{splitId,jdbcType=INTEGER},
  430. </if>
  431. <if test="splitAid != null">
  432. #{splitAid,jdbcType=VARCHAR},
  433. </if>
  434. <if test="splitTime != null">
  435. #{splitTime,jdbcType=TIMESTAMP},
  436. </if>
  437. <if test="cname != null">
  438. #{cname,jdbcType=VARCHAR},
  439. </if>
  440. <if test="receiverName != null">
  441. #{receiverName,jdbcType=VARCHAR},
  442. </if>
  443. <if test="declarationBatch != null">
  444. #{declarationBatch,jdbcType=INTEGER},
  445. </if>
  446. <if test="costReduction != null">
  447. #{costReduction,jdbcType=INTEGER},
  448. </if>
  449. <if test="officialCost != null">
  450. #{officialCost,jdbcType=INTEGER},
  451. </if>
  452. <if test="setUpStatus != null">
  453. #{setUpStatus,jdbcType=INTEGER},
  454. </if>
  455. <if test="setUpTime != null">
  456. #{setUpTime,jdbcType=TIMESTAMP},
  457. </if>
  458. <if test="spotCheckStatus != null">
  459. #{spotCheckStatus,jdbcType=INTEGER},
  460. </if>
  461. <if test="highTechStatus != null">
  462. #{highTechStatus,jdbcType=INTEGER},
  463. </if>
  464. <if test="specialComment != null">
  465. #{specialComment,jdbcType=VARCHAR},
  466. </if>
  467. <if test="ifCertificationFee != null">
  468. #{ifCertificationFee,jdbcType=INTEGER},
  469. </if>
  470. <if test="certificationFee != null">
  471. #{certificationFee,jdbcType=DECIMAL},
  472. </if>
  473. <if test="certificationCorporate != null">
  474. #{certificationCorporate,jdbcType=VARCHAR},
  475. </if>
  476. <if test="timeRecord != null">
  477. #{timeRecord,jdbcType=VARCHAR},
  478. </if>
  479. <if test="ifPublicity != null">
  480. #{ifPublicity,jdbcType=INTEGER},
  481. </if>
  482. <if test="checkStatus != null">
  483. #{checkStatus,jdbcType=INTEGER},
  484. </if>
  485. <if test="patentType != null">
  486. #{patentType,jdbcType=INTEGER},
  487. </if>
  488. <if test="pubicityUrl != null">
  489. #{pubicityUrl,jdbcType=VARCHAR},
  490. </if>
  491. </trim>
  492. </insert>
  493. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderTask">
  494. update t_order_task
  495. <set>
  496. <if test="orderNo != null">
  497. order_no = #{orderNo,jdbcType=VARCHAR},
  498. </if>
  499. <if test="main != null">
  500. main = #{main,jdbcType=INTEGER},
  501. </if>
  502. <if test="superId != null">
  503. super_id = #{superId,jdbcType=VARCHAR},
  504. </if>
  505. <if test="commodityId != null">
  506. commodity_id = #{commodityId,jdbcType=VARCHAR},
  507. </if>
  508. <if test="commodityName != null">
  509. commodity_name = #{commodityName,jdbcType=VARCHAR},
  510. </if>
  511. <if test="commodityQuantity != null">
  512. commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
  513. </if>
  514. <if test="commodityMode != null">
  515. commodity_mode = #{commodityMode,jdbcType=VARCHAR},
  516. </if>
  517. <if test="commodityPrice != null">
  518. commodity_price = #{commodityPrice,jdbcType=DECIMAL},
  519. </if>
  520. <if test="taskStatus != null">
  521. task_status = #{taskStatus,jdbcType=INTEGER},
  522. </if>
  523. <if test="taskDistributionTime != null">
  524. task_distribution_time = #{taskDistributionTime,jdbcType=TIMESTAMP},
  525. </if>
  526. <if test="taskAllocator != null">
  527. task_allocator = #{taskAllocator,jdbcType=VARCHAR},
  528. </if>
  529. <if test="taskReceiver != null">
  530. task_receiver = #{taskReceiver,jdbcType=VARCHAR},
  531. </if>
  532. <if test="taskComment != null">
  533. task_comment = #{taskComment,jdbcType=VARCHAR},
  534. </if>
  535. <if test="taskStartTime != null">
  536. task_start_time = #{taskStartTime,jdbcType=TIMESTAMP},
  537. </if>
  538. <if test="taskEndTime != null">
  539. task_end_time = #{taskEndTime,jdbcType=TIMESTAMP},
  540. </if>
  541. <if test="attachmentUrl != null">
  542. attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
  543. </if>
  544. <if test="projectStatus != null">
  545. project_status = #{projectStatus,jdbcType=INTEGER},
  546. </if>
  547. <if test="acceptTime != null">
  548. accept_time = #{acceptTime,jdbcType=DATE},
  549. </if>
  550. <if test="reviewTime != null">
  551. review_time = #{reviewTime,jdbcType=DATE},
  552. </if>
  553. <if test="publicityTime != null">
  554. publicity_time = #{publicityTime,jdbcType=DATE},
  555. </if>
  556. <if test="licenceTime != null">
  557. licence_time = #{licenceTime,jdbcType=DATE},
  558. </if>
  559. <if test="certificateNumber != null">
  560. certificate_number = #{certificateNumber,jdbcType=VARCHAR},
  561. </if>
  562. <if test="status != null">
  563. `status` = #{status,jdbcType=INTEGER},
  564. </if>
  565. <if test="formRetrieve != null">
  566. form_retrieve = #{formRetrieve,jdbcType=INTEGER},
  567. </if>
  568. <if test="taskRefund != null">
  569. task_refund = #{taskRefund,jdbcType=INTEGER},
  570. </if>
  571. <if test="refundContent != null">
  572. refund_content = #{refundContent,jdbcType=VARCHAR},
  573. </if>
  574. <if test="retrieveContent != null">
  575. retrieve_content = #{retrieveContent,jdbcType=VARCHAR},
  576. </if>
  577. <if test="declareUser != null">
  578. declare_user = #{declareUser,jdbcType=VARCHAR},
  579. </if>
  580. <if test="declarePwd != null">
  581. declare_pwd = #{declarePwd,jdbcType=VARCHAR},
  582. </if>
  583. <if test="setUpAmount != null">
  584. set_up_amount = #{setUpAmount,jdbcType=DECIMAL},
  585. </if>
  586. <if test="arrivalMoney != null">
  587. arrival_money = #{arrivalMoney,jdbcType=INTEGER},
  588. </if>
  589. <if test="outsourceName != null">
  590. outsource_name = #{outsourceName,jdbcType=VARCHAR},
  591. </if>
  592. <if test="outsourcePrice != null">
  593. outsource_price = #{outsourcePrice,jdbcType=DECIMAL},
  594. </if>
  595. <if test="consultantId != null">
  596. consultant_id = #{consultantId,jdbcType=VARCHAR},
  597. </if>
  598. <if test="managerId != null">
  599. manager_id = #{managerId,jdbcType=VARCHAR},
  600. </if>
  601. <if test="outsource != null">
  602. outsource = #{outsource,jdbcType=INTEGER},
  603. </if>
  604. <if test="splitSuper != null">
  605. split_super = #{splitSuper,jdbcType=INTEGER},
  606. </if>
  607. <if test="splitStatus != null">
  608. split_status = #{splitStatus,jdbcType=INTEGER},
  609. </if>
  610. <if test="splitId != null">
  611. split_id = #{splitId,jdbcType=INTEGER},
  612. </if>
  613. <if test="splitAid != null">
  614. split_aid = #{splitAid,jdbcType=VARCHAR},
  615. </if>
  616. <if test="splitTime != null">
  617. split_time = #{splitTime,jdbcType=TIMESTAMP},
  618. </if>
  619. <if test="cname != null">
  620. cname = #{cname,jdbcType=VARCHAR},
  621. </if>
  622. <if test="receiverName != null">
  623. receiver_name = #{receiverName,jdbcType=VARCHAR},
  624. </if>
  625. <if test="declarationBatch != null">
  626. declaration_batch = #{declarationBatch,jdbcType=INTEGER},
  627. </if>
  628. <if test="costReduction != null">
  629. cost_reduction = #{costReduction,jdbcType=INTEGER},
  630. </if>
  631. <if test="officialCost != null">
  632. official_cost = #{officialCost,jdbcType=INTEGER},
  633. </if>
  634. <if test="setUpStatus != null">
  635. set_up_status = #{setUpStatus,jdbcType=INTEGER},
  636. </if>
  637. <if test="setUpTime != null">
  638. set_up_time = #{setUpTime,jdbcType=TIMESTAMP},
  639. </if>
  640. <if test="spotCheckStatus != null">
  641. spot_check_status = #{spotCheckStatus,jdbcType=INTEGER},
  642. </if>
  643. <if test="highTechStatus != null">
  644. high_tech_status = #{highTechStatus,jdbcType=INTEGER},
  645. </if>
  646. <if test="specialComment != null">
  647. special_comment = #{specialComment,jdbcType=VARCHAR},
  648. </if>
  649. <if test="ifCertificationFee != null">
  650. if_certification_fee = #{ifCertificationFee,jdbcType=INTEGER},
  651. </if>
  652. <if test="certificationFee != null">
  653. certification_fee = #{certificationFee,jdbcType=DECIMAL},
  654. </if>
  655. <if test="certificationCorporate != null">
  656. certification_corporate = #{certificationCorporate,jdbcType=VARCHAR},
  657. </if>
  658. <if test="timeRecord != null">
  659. time_record = #{timeRecord,jdbcType=VARCHAR},
  660. </if>
  661. <if test="ifPublicity != null">
  662. if_publicity = #{ifPublicity,jdbcType=INTEGER},
  663. </if>
  664. <if test="checkStatus != null">
  665. check_status = #{checkStatus,jdbcType=INTEGER},
  666. </if>
  667. <if test="patentType != null">
  668. patent_type = #{patentType,jdbcType=INTEGER},
  669. </if>
  670. <if test="pubicityUrl != null">
  671. pubicity_url = #{pubicityUrl,jdbcType=VARCHAR},
  672. </if>
  673. </set>
  674. where id = #{id,jdbcType=INTEGER}
  675. </update>
  676. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrderTask">
  677. update t_order_task
  678. set order_no = #{orderNo,jdbcType=VARCHAR},
  679. main = #{main,jdbcType=INTEGER},
  680. super_id = #{superId,jdbcType=VARCHAR},
  681. commodity_id = #{commodityId,jdbcType=VARCHAR},
  682. commodity_name = #{commodityName,jdbcType=VARCHAR},
  683. commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
  684. commodity_mode = #{commodityMode,jdbcType=VARCHAR},
  685. commodity_price = #{commodityPrice,jdbcType=DECIMAL},
  686. task_status = #{taskStatus,jdbcType=INTEGER},
  687. task_distribution_time = #{taskDistributionTime,jdbcType=TIMESTAMP},
  688. task_allocator = #{taskAllocator,jdbcType=VARCHAR},
  689. task_receiver = #{taskReceiver,jdbcType=VARCHAR},
  690. task_comment = #{taskComment,jdbcType=VARCHAR},
  691. task_start_time = #{taskStartTime,jdbcType=TIMESTAMP},
  692. task_end_time = #{taskEndTime,jdbcType=TIMESTAMP},
  693. attachment_url = #{attachmentUrl,jdbcType=VARCHAR},
  694. project_status = #{projectStatus,jdbcType=INTEGER},
  695. accept_time = #{acceptTime,jdbcType=DATE},
  696. review_time = #{reviewTime,jdbcType=DATE},
  697. publicity_time = #{publicityTime,jdbcType=DATE},
  698. licence_time = #{licenceTime,jdbcType=DATE},
  699. certificate_number = #{certificateNumber,jdbcType=VARCHAR},
  700. `status` = #{status,jdbcType=INTEGER},
  701. form_retrieve = #{formRetrieve,jdbcType=INTEGER},
  702. task_refund = #{taskRefund,jdbcType=INTEGER},
  703. refund_content = #{refundContent,jdbcType=VARCHAR},
  704. retrieve_content = #{retrieveContent,jdbcType=VARCHAR},
  705. declare_user = #{declareUser,jdbcType=VARCHAR},
  706. declare_pwd = #{declarePwd,jdbcType=VARCHAR},
  707. set_up_amount = #{setUpAmount,jdbcType=DECIMAL},
  708. arrival_money = #{arrivalMoney,jdbcType=INTEGER},
  709. outsource_name = #{outsourceName,jdbcType=VARCHAR},
  710. outsource_price = #{outsourcePrice,jdbcType=DECIMAL},
  711. consultant_id = #{consultantId,jdbcType=VARCHAR},
  712. manager_id = #{managerId,jdbcType=VARCHAR},
  713. outsource = #{outsource,jdbcType=INTEGER},
  714. split_super = #{splitSuper,jdbcType=INTEGER},
  715. split_status = #{splitStatus,jdbcType=INTEGER},
  716. split_id = #{splitId,jdbcType=INTEGER},
  717. split_aid = #{splitAid,jdbcType=VARCHAR},
  718. split_time = #{splitTime,jdbcType=TIMESTAMP},
  719. cname = #{cname,jdbcType=VARCHAR},
  720. receiver_name = #{receiverName,jdbcType=VARCHAR},
  721. declaration_batch = #{declarationBatch,jdbcType=INTEGER},
  722. cost_reduction = #{costReduction,jdbcType=INTEGER},
  723. official_cost = #{officialCost,jdbcType=INTEGER},
  724. set_up_status = #{setUpStatus,jdbcType=INTEGER},
  725. set_up_time = #{setUpTime,jdbcType=TIMESTAMP},
  726. spot_check_status = #{spotCheckStatus,jdbcType=INTEGER},
  727. high_tech_status = #{highTechStatus,jdbcType=INTEGER},
  728. special_comment = #{specialComment,jdbcType=VARCHAR},
  729. if_certification_fee = #{ifCertificationFee,jdbcType=INTEGER},
  730. certification_fee = #{certificationFee,jdbcType=DECIMAL},
  731. certification_corporate = #{certificationCorporate,jdbcType=VARCHAR},
  732. time_record = #{timeRecord,jdbcType=VARCHAR},
  733. if_publicity = #{ifPublicity,jdbcType=INTEGER},
  734. check_status = #{checkStatus,jdbcType=INTEGER},
  735. patent_type = #{patentType,jdbcType=INTEGER},
  736. pubicity_url = #{pubicityUrl,jdbcType=VARCHAR}
  737. where id = #{id,jdbcType=INTEGER}
  738. </update>
  739. <insert id="insertSelectiveGetId" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderTask" useGeneratedKeys="true">
  740. insert into t_order_task
  741. <trim prefix="(" suffix=")" suffixOverrides=",">
  742. <if test="id != null">
  743. id,
  744. </if>
  745. <if test="orderNo != null">
  746. order_no,
  747. </if>
  748. <if test="main != null">
  749. main,
  750. </if>
  751. <if test="superId != null">
  752. super_id,
  753. </if>
  754. <if test="commodityId != null">
  755. commodity_id,
  756. </if>
  757. <if test="commodityName != null">
  758. commodity_name,
  759. </if>
  760. <if test="commodityQuantity != null">
  761. commodity_quantity,
  762. </if>
  763. <if test="commodityMode != null">
  764. commodity_mode,
  765. </if>
  766. <if test="commodityPrice != null">
  767. commodity_price,
  768. </if>
  769. <if test="taskStatus != null">
  770. task_status,
  771. </if>
  772. <if test="taskDistributionTime != null">
  773. task_distribution_time,
  774. </if>
  775. <if test="taskAllocator != null">
  776. task_allocator,
  777. </if>
  778. <if test="taskReceiver != null">
  779. task_receiver,
  780. </if>
  781. <if test="taskComment != null">
  782. task_comment,
  783. </if>
  784. <if test="taskStartTime != null">
  785. task_start_time,
  786. </if>
  787. <if test="taskEndTime != null">
  788. task_end_time,
  789. </if>
  790. <if test="projectStatus != null">
  791. project_status,
  792. </if>
  793. <if test="acceptTime != null">
  794. accept_time,
  795. </if>
  796. <if test="reviewTime != null">
  797. review_time,
  798. </if>
  799. <if test="publicityTime != null">
  800. publicity_time,
  801. </if>
  802. <if test="licenceTime != null">
  803. licence_time,
  804. </if>
  805. <if test="certificateNumber != null">
  806. certificate_number,
  807. </if>
  808. <if test="status != null">
  809. `status`,
  810. </if>
  811. <if test="formRetrieve != null">
  812. form_retrieve,
  813. </if>
  814. <if test="taskRefund != null">
  815. task_refund,
  816. </if>
  817. <if test="refundContent != null">
  818. refund_content,
  819. </if>
  820. <if test="retrieveContent != null">
  821. retrieve_content,
  822. </if>
  823. <if test="declareUser != null">
  824. declare_user,
  825. </if>
  826. <if test="declarePwd != null">
  827. declare_pwd,
  828. </if>
  829. <if test="setUpAmount != null">
  830. set_up_amount,
  831. </if>
  832. <if test="arrivalMoney != null">
  833. arrival_money,
  834. </if>
  835. <if test="outsourceName != null">
  836. outsource_name,
  837. </if>
  838. <if test="outsourcePrice != null">
  839. outsource_price,
  840. </if>
  841. <if test="consultantId != null">
  842. consultant_id,
  843. </if>
  844. <if test="managerId != null">
  845. manager_id,
  846. </if>
  847. <if test="outsource != null">
  848. outsource,
  849. </if>
  850. <if test="splitSuper != null">
  851. split_super,
  852. </if>
  853. <if test="splitStatus != null">
  854. split_status,
  855. </if>
  856. <if test="splitId != null">
  857. split_id,
  858. </if>
  859. <if test="splitAid != null">
  860. split_aid,
  861. </if>
  862. <if test="splitTime != null">
  863. split_time,
  864. </if>
  865. <if test="cname != null">
  866. cname,
  867. </if>
  868. <if test="receiverName != null">
  869. receiver_name,
  870. </if>
  871. <if test="declarationBatch != null">
  872. declaration_batch,
  873. </if>
  874. <if test="costReduction != null">
  875. cost_reduction,
  876. </if>
  877. <if test="officialCost != null">
  878. official_cost,
  879. </if>
  880. <if test="setUpStatus != null">
  881. set_up_status,
  882. </if>
  883. <if test="setUpTime != null">
  884. set_up_time,
  885. </if>
  886. <if test="spotCheckStatus != null">
  887. spot_check_status,
  888. </if>
  889. <if test="highTechStatus != null">
  890. high_tech_status,
  891. </if>
  892. <if test="specialComment != null">
  893. special_comment,
  894. </if>
  895. <if test="ifCertificationFee != null">
  896. if_certification_fee,
  897. </if>
  898. <if test="certificationFee != null">
  899. certification_fee,
  900. </if>
  901. <if test="certificationCorporate != null">
  902. certification_corporate,
  903. </if>
  904. <if test="ifPublicity != null">
  905. if_publicity,
  906. </if>
  907. <if test="checkStatus != null">
  908. check_status,
  909. </if>
  910. <if test="patentType != null">
  911. patent_type,
  912. </if>
  913. <if test="attachmentUrl != null">
  914. attachment_url,
  915. </if>
  916. <if test="timeRecord != null">
  917. time_record,
  918. </if>
  919. </trim>
  920. <trim prefix="values (" suffix=")" suffixOverrides=",">
  921. <if test="id != null">
  922. #{id,jdbcType=INTEGER},
  923. </if>
  924. <if test="orderNo != null">
  925. #{orderNo,jdbcType=VARCHAR},
  926. </if>
  927. <if test="main != null">
  928. #{main,jdbcType=INTEGER},
  929. </if>
  930. <if test="superId != null">
  931. #{superId,jdbcType=VARCHAR},
  932. </if>
  933. <if test="commodityId != null">
  934. #{commodityId,jdbcType=VARCHAR},
  935. </if>
  936. <if test="commodityName != null">
  937. #{commodityName,jdbcType=VARCHAR},
  938. </if>
  939. <if test="commodityQuantity != null">
  940. #{commodityQuantity,jdbcType=INTEGER},
  941. </if>
  942. <if test="commodityMode != null">
  943. #{commodityMode,jdbcType=VARCHAR},
  944. </if>
  945. <if test="commodityPrice != null">
  946. #{commodityPrice,jdbcType=DECIMAL},
  947. </if>
  948. <if test="taskStatus != null">
  949. #{taskStatus,jdbcType=INTEGER},
  950. </if>
  951. <if test="taskDistributionTime != null">
  952. #{taskDistributionTime,jdbcType=TIMESTAMP},
  953. </if>
  954. <if test="taskAllocator != null">
  955. #{taskAllocator,jdbcType=VARCHAR},
  956. </if>
  957. <if test="taskReceiver != null">
  958. #{taskReceiver,jdbcType=VARCHAR},
  959. </if>
  960. <if test="taskComment != null">
  961. #{taskComment,jdbcType=VARCHAR},
  962. </if>
  963. <if test="taskStartTime != null">
  964. #{taskStartTime,jdbcType=TIMESTAMP},
  965. </if>
  966. <if test="taskEndTime != null">
  967. #{taskEndTime,jdbcType=TIMESTAMP},
  968. </if>
  969. <if test="projectStatus != null">
  970. #{projectStatus,jdbcType=INTEGER},
  971. </if>
  972. <if test="acceptTime != null">
  973. #{acceptTime,jdbcType=DATE},
  974. </if>
  975. <if test="reviewTime != null">
  976. #{reviewTime,jdbcType=DATE},
  977. </if>
  978. <if test="publicityTime != null">
  979. #{publicityTime,jdbcType=DATE},
  980. </if>
  981. <if test="licenceTime != null">
  982. #{licenceTime,jdbcType=DATE},
  983. </if>
  984. <if test="certificateNumber != null">
  985. #{certificateNumber,jdbcType=VARCHAR},
  986. </if>
  987. <if test="status != null">
  988. #{status,jdbcType=INTEGER},
  989. </if>
  990. <if test="formRetrieve != null">
  991. #{formRetrieve,jdbcType=INTEGER},
  992. </if>
  993. <if test="taskRefund != null">
  994. #{taskRefund,jdbcType=INTEGER},
  995. </if>
  996. <if test="refundContent != null">
  997. #{refundContent,jdbcType=VARCHAR},
  998. </if>
  999. <if test="retrieveContent != null">
  1000. #{retrieveContent,jdbcType=VARCHAR},
  1001. </if>
  1002. <if test="declareUser != null">
  1003. #{declareUser,jdbcType=VARCHAR},
  1004. </if>
  1005. <if test="declarePwd != null">
  1006. #{declarePwd,jdbcType=VARCHAR},
  1007. </if>
  1008. <if test="setUpAmount != null">
  1009. #{setUpAmount,jdbcType=DECIMAL},
  1010. </if>
  1011. <if test="arrivalMoney != null">
  1012. #{arrivalMoney,jdbcType=INTEGER},
  1013. </if>
  1014. <if test="outsourceName != null">
  1015. #{outsourceName,jdbcType=VARCHAR},
  1016. </if>
  1017. <if test="outsourcePrice != null">
  1018. #{outsourcePrice,jdbcType=DECIMAL},
  1019. </if>
  1020. <if test="consultantId != null">
  1021. #{consultantId,jdbcType=VARCHAR},
  1022. </if>
  1023. <if test="managerId != null">
  1024. #{managerId,jdbcType=VARCHAR},
  1025. </if>
  1026. <if test="outsource != null">
  1027. #{outsource,jdbcType=INTEGER},
  1028. </if>
  1029. <if test="splitSuper != null">
  1030. #{splitSuper,jdbcType=INTEGER},
  1031. </if>
  1032. <if test="splitStatus != null">
  1033. #{splitStatus,jdbcType=INTEGER},
  1034. </if>
  1035. <if test="splitId != null">
  1036. #{splitId,jdbcType=INTEGER},
  1037. </if>
  1038. <if test="splitAid != null">
  1039. #{splitAid,jdbcType=VARCHAR},
  1040. </if>
  1041. <if test="splitTime != null">
  1042. #{splitTime,jdbcType=TIMESTAMP},
  1043. </if>
  1044. <if test="cname != null">
  1045. #{cname,jdbcType=VARCHAR},
  1046. </if>
  1047. <if test="receiverName != null">
  1048. #{receiverName,jdbcType=VARCHAR},
  1049. </if>
  1050. <if test="declarationBatch != null">
  1051. #{declarationBatch,jdbcType=INTEGER},
  1052. </if>
  1053. <if test="costReduction != null">
  1054. #{costReduction,jdbcType=INTEGER},
  1055. </if>
  1056. <if test="officialCost != null">
  1057. #{officialCost,jdbcType=INTEGER},
  1058. </if>
  1059. <if test="setUpStatus != null">
  1060. #{setUpStatus,jdbcType=INTEGER},
  1061. </if>
  1062. <if test="setUpTime != null">
  1063. #{setUpTime,jdbcType=TIMESTAMP},
  1064. </if>
  1065. <if test="spotCheckStatus != null">
  1066. #{spotCheckStatus,jdbcType=INTEGER},
  1067. </if>
  1068. <if test="highTechStatus != null">
  1069. #{highTechStatus,jdbcType=INTEGER},
  1070. </if>
  1071. <if test="specialComment != null">
  1072. #{specialComment,jdbcType=VARCHAR},
  1073. </if>
  1074. <if test="ifCertificationFee != null">
  1075. #{ifCertificationFee,jdbcType=INTEGER},
  1076. </if>
  1077. <if test="certificationFee != null">
  1078. #{certificationFee,jdbcType=DECIMAL},
  1079. </if>
  1080. <if test="certificationCorporate != null">
  1081. #{certificationCorporate,jdbcType=VARCHAR},
  1082. </if>
  1083. <if test="ifPublicity != null">
  1084. #{ifPublicity,jdbcType=INTEGER},
  1085. </if>
  1086. <if test="checkStatus != null">
  1087. #{checkStatus,jdbcType=INTEGER},
  1088. </if>
  1089. <if test="patentType != null">
  1090. #{patentType,jdbcType=INTEGER},
  1091. </if>
  1092. <if test="attachmentUrl != null">
  1093. #{attachmentUrl,jdbcType=LONGVARCHAR},
  1094. </if>
  1095. <if test="timeRecord != null">
  1096. #{timeRecord,jdbcType=LONGVARCHAR},
  1097. </if>
  1098. </trim>
  1099. <selectKey keyProperty="id" order="AFTER" resultType="int">
  1100. SELECT LAST_INSERT_ID()
  1101. </selectKey>
  1102. </insert>
  1103. <select id="selectOrderTask" resultType="com.goafanti.order.bo.TOrderTaskBo">
  1104. select a.id,e.contract_no contractNo,a.order_no as orderNo,h.nickname userName,f.name salesmanName,
  1105. a.outsource_name outsourceName,a.outsource, a.outsource_price outsourcePrice,g.name depName,
  1106. e.order_status orderStatus,d.name as contacts,d.contact_mobile as contactsMobile,a.main, c.cname,
  1107. c.sort cSort,a.commodity_name as commodityName,a.commodity_quantity as commodityQuantity,b.patent_transfer patentTransfer ,
  1108. i.price,a.certificate_number as certificateNumber, a.commodity_id as commodityId,a.manager_id managerId,
  1109. a.consultant_id consultantId,a.project_status as projectStatus,a.set_up_amount setUpAmount,
  1110. a.task_comment as taskComment ,a.commodity_price as commodityPrice, a.task_status as taskStatus,
  1111. a.task_receiver as taskReceiver ,a.if_certification_fee ifCertificationFee , a.split_status splitStatus,
  1112. a.cost_reduction costReduction,a.official_cost officialCost,i.`type` ,d.name ,a.declaration_batch declarationBatch,
  1113. a.patent_type patentType
  1114. from t_order_task a left join business_project b on a.commodity_id=b.id
  1115. left join t_order_new e on a.order_no=e.order_no
  1116. left join admin f on e.salesman_id=f.id left join department g on
  1117. e.order_dep=g.id left join user h on e.buyer_id=h.id
  1118. left join business_project i on a.commodity_id=i.id left join
  1119. business_category c on b.cid=c.id left join admin d on
  1120. a.task_receiver=d.id
  1121. where a.super_id is null and a.split_status in(0,1) and a.order_no= #{orderNo,jdbcType=VARCHAR} order by a.id
  1122. </select>
  1123. <select id="selectOrderTaskAll" resultType="com.goafanti.order.bo.TOrderTaskBo">
  1124. select a.id,e.contract_no contractNo,a.order_no as orderNo,h.nickname userName,f.name salesmanName,a.outsource_name outsourceName,a.outsource,
  1125. a.outsource_price outsourcePrice,g.name depName,e.order_status orderStatus,d.name as contacts,d.contact_mobile as contactsMobile,a.main, c.cname,
  1126. c.sort cSort,a.commodity_name as commodityName,a.commodity_quantity as commodityQuantity,i.price,a.certificate_number as certificateNumber,a.receiver_name receiverName,
  1127. a.commodity_id as commodityId,a.manager_id managerId,a.consultant_id consultantId,a.project_status as projectStatus,a.set_up_amount setUpAmount,
  1128. a.task_comment as taskComment ,a.commodity_price as commodityPrice, a.task_status as taskStatus, a.task_receiver as taskReceiver ,
  1129. a.split_status splitStatus,a.split_super splitSuper,a.split_aid splitAid,a.split_time splitTime,a.patent_type patentType
  1130. 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
  1131. 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
  1132. 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
  1133. where a.super_id is null and a.order_no= #{orderNo,jdbcType=VARCHAR} order by a.id
  1134. </select>
  1135. <select id="selectOrderTaskListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
  1136. select a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,a.receiver_name receiverName,a.project_status projectStatus,e.contract_no contractNo,
  1137. a.task_receiver taskReceiver,a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d %H:%i:%S') as taskDate, a.commodity_quantity as commodityQuantity,
  1138. e.approval,l.refund_status outsourceStatus,l.start_type outsourceType,ttm.certificates_count alreadyNumber,f.nickname as userName,h.name as depName, l.company_name as outsourceName ,
  1139. ifnull(k.hours,0) hours,a.split_status splitStatus,a.split_super splitSuper, a.split_id splitId,b.`type` projectType,ttm.cost_amount costAmount,tm.salesman_name salesmanName ,
  1140. ttm.party_amount partyAmount,a.commodity_price commodityPrice,a.outsource,date_format(a.task_end_time,'%Y-%m-%d') taskEndTime,date_format(e.sign_time,'%Y-%m-%d') signTime,
  1141. date_format(e.create_time ,'%Y-%m-%d')creteTime
  1142. 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
  1143. 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
  1144. left join department h on e.order_dep=h.id left join task_hours_count k on a.id=k.tid and a.task_receiver=k.aid left join t_order_outsource l
  1145. on a.id=l.tid left join t_task_mid ttm on a.id=ttm.tid where e.delete_sign in (0,2,3) and e.order_status in (2,4)
  1146. and a.outsource= #{outsource,jdbcType=INTEGER}
  1147. <if test="role == 0 ">
  1148. and a.task_receiver= #{aid,jdbcType=VARCHAR}
  1149. </if>
  1150. <if test="role ==1 and fids != null and fids.size() &gt; 0">
  1151. and e.finance_id in
  1152. <foreach close=")" collection="fids" index="" item="item" open="(" separator=",">
  1153. #{item}
  1154. </foreach>
  1155. </if>
  1156. <if test="specially == 0 ">
  1157. and a.split_status in (0,2)
  1158. </if>
  1159. <if test="orderNo != null">
  1160. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1161. </if>
  1162. <if test="approval ==0">
  1163. and e.approval = 0
  1164. </if>
  1165. <if test="approval ==1">
  1166. and e.approval = 1
  1167. </if>
  1168. <if test="approval ==2">
  1169. and e.approval &gt; 1
  1170. </if>
  1171. <if test="cid != null">
  1172. and c.id = #{cid}
  1173. </if>
  1174. <if test="outsourceStatus !=null">
  1175. and l.refund_status = #{outsourceStatus,jdbcType=INTEGER}
  1176. </if>
  1177. <if test="contractNo != null">
  1178. and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
  1179. </if>
  1180. <if test="projectStatus != null">
  1181. and a.project_status = #{projectStatus,jdbcType=INTEGER}
  1182. </if>
  1183. <if test="depId != null">
  1184. and e.order_dep= #{depId,jdbcType=VARCHAR}
  1185. </if>
  1186. <if test="name != null">
  1187. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1188. </if>
  1189. <if test="orderNo != null">
  1190. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1191. </if>
  1192. <if test="taskId != null">
  1193. and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
  1194. </if>
  1195. <if test="taskStatus != null">
  1196. and a.task_status= #{taskStatus,jdbcType=INTEGER}
  1197. </if>
  1198. <if test="adminName != null">
  1199. and a.receiver_name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
  1200. </if>
  1201. <if test="startTime != null and endTime != null">
  1202. and e.sign_time between #{startTime} and #{endTime}
  1203. </if>
  1204. order by a.task_distribution_time desc
  1205. <if test="page_sql!=null">
  1206. ${page_sql}
  1207. </if>
  1208. </select>
  1209. <select id="selectOrderTaskListCount" resultType="java.lang.Integer">
  1210. 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
  1211. 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 admin g on e.salesman_id=g.id
  1212. 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)
  1213. and a.outsource= #{outsource,jdbcType=INTEGER}
  1214. <if test="role == 0 ">
  1215. and a.task_receiver= #{aid,jdbcType=VARCHAR}
  1216. </if>
  1217. <if test="role ==1 and fids != null and fids.size() &gt; 0">
  1218. and e.finance_id in
  1219. <foreach close=")" collection="fids" index="" item="item" open="(" separator=",">
  1220. #{item}
  1221. </foreach>
  1222. </if>
  1223. <if test="specially == 0 ">
  1224. and a.split_status in (0,2)
  1225. </if>
  1226. <if test="orderNo != null">
  1227. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1228. </if>
  1229. <if test="approval ==0">
  1230. and e.approval = 0
  1231. </if>
  1232. <if test="approval ==1">
  1233. and e.approval = 1
  1234. </if>
  1235. <if test="approval ==2">
  1236. and e.approval &gt; 1
  1237. </if>
  1238. <if test="cid != null">
  1239. and c.id = #{cid}
  1240. </if>
  1241. <if test="outsourceStatus !=null">
  1242. and l.refund_status = #{outsourceStatus,jdbcType=INTEGER}
  1243. </if>
  1244. <if test="contractNo != null">
  1245. and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
  1246. </if>
  1247. <if test="projectStatus != null">
  1248. and a.project_status = #{projectStatus,jdbcType=INTEGER}
  1249. </if>
  1250. <if test="depId != null">
  1251. and e.order_dep = #{depId,jdbcType=VARCHAR}
  1252. </if>
  1253. <if test="name != null">
  1254. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1255. </if>
  1256. <if test="orderNo != null">
  1257. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1258. </if>
  1259. <if test="taskId != null">
  1260. and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
  1261. </if>
  1262. <if test="taskStatus != null">
  1263. and a.task_status= #{taskStatus,jdbcType=INTEGER}
  1264. </if>
  1265. <if test="adminName != null">
  1266. and a.receiver_name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
  1267. </if>
  1268. <if test="startTime != null and endTime != null">
  1269. and e.sign_time between #{startTime} and #{endTime}
  1270. </if>
  1271. </select>
  1272. <select id="getOrderTaskDetail" resultType="com.goafanti.order.bo.TOrderTaskDetailBo">
  1273. select
  1274. a.id,a.commodity_name as taskName,a.order_no as orderNo,c.sort ,c.cname,d.name as receiverName,a.task_comment as taskComment,a.project_status as projectStatus,
  1275. 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,
  1276. 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,
  1277. a.certificate_number as certificateNumber, a.status,a.form_retrieve as formRetrieve, a.task_refund as taskRefund,a.task_receiver taskReceiver,b.patent_transfer patentTransfer,
  1278. a.refund_content as refundContent, a.declare_user as declareUser, a.declare_pwd as declarePwd,e.contract_no as contractNo,e.contacts ,b.`type` bpType,
  1279. 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 ,
  1280. date_format(a.review_time,'%Y-%m-%d') as reviewDate,date_format(a.publicity_time,'%Y-%m-%d') as publicityDate,a.outsource_price outsourcePrice,
  1281. date_format(a.licence_time,'%Y-%m-%d') as licenceDate,date_format(a.task_distribution_time,'%Y-%m-%d %H:%i:%S') as taskDate,e.legal_person as legalPerson,
  1282. e.legal_person_tel as legalPersonTel, a.split_status splitStatus, a.split_super splitSuper, a.split_id splitId,a.declaration_batch declarationBatch,a.patent_type patentType,
  1283. a.if_certification_fee ifCertificationFee , a.certification_corporate certificationCorporate ,a.certification_fee certificationFee ,a.time_record timeRecord,
  1284. a.cost_reduction costReduction, a.official_cost officialCost,a.set_up_status setUpStatus ,date_format(a.set_up_time,'%Y-%m-%d') setUpTime ,a.high_tech_status highTechStatus ,
  1285. a.spot_check_status spotCheckStatus , a.special_comment specialComment ,ttm.certificates_count certificatesCount ,ttm.reject_count rejectCount ,a.check_status checkStatus,
  1286. ttm.authorize_count authorizeCount ,ttm.end_count endCount,ttm.accept_count acceptCount,a.commodity_price commodityPrice,a.commodity_quantity commodityQuantity
  1287. 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
  1288. left join admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no
  1289. left join department h on e.order_dep=h.id left join user f on e.buyer_id=f.id LEFT JOIN t_task_mid ttm ON a.id=ttm.tid
  1290. left join admin g on e.salesman_id=g.id
  1291. where a.id= #{id,jdbcType=VARCHAR}
  1292. </select>
  1293. <select id="selectBySuperId" resultType="com.goafanti.common.model.TOrderTask">
  1294. select super_id as superId,min(task_status) as taskStatus,min(project_status) as projectStatus,max(main) as main from t_order_task
  1295. where super_id = #{superId,jdbcType=VARCHAR} group by super_id
  1296. </select>
  1297. <select id="selectTaskHoursListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
  1298. 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,
  1299. a.task_status as taskStatus,f.nickname as userName,ifnull(g.hours,0) as hours,a.commodity_quantity as commodityQuantity,a.commodity_price commodityPrice,
  1300. 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,
  1301. date_format(a.task_distribution_time,'%Y-%m-%d %H:%i:%S')taskDate, date_format(a.task_end_time,'%Y-%m-%d')taskEndTime,tm.salesman_name salesmanName,
  1302. a.split_status splitStatus, a.split_super splitSuper, a.split_id splitId,ifnull(ttm.cost_amount,0) costAmount,ifnull(ttm.party_amount,0) partyAmount
  1303. 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
  1304. left join t_order_new e on a.order_no=e.order_no left join department dep on e.order_dep=dep.id
  1305. 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
  1306. left join t_order_mid tm on a.order_no=tm.order_no left join t_task_mid ttm on a.id=ttm.tid
  1307. where e.delete_sign =0 and a.super_id is null and a.split_status in(0,2)
  1308. <if test="shiroType == 1 and aid !=null">
  1309. and tm.finance_id= #{aid,jdbcType=VARCHAR}
  1310. </if>
  1311. <if test="shiroType == 2 and aid !=null">
  1312. and tm.finance_id in (select id from admin where superior_id= #{aid,jdbcType=VARCHAR})
  1313. </if>
  1314. <if test="name != null">
  1315. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1316. </if>
  1317. <if test="cid != null">
  1318. and b.cid = #{cid,jdbcType=VARCHAR}
  1319. </if>
  1320. <if test="outsource != null">
  1321. and a.outsource = #{outsource,jdbcType=INTEGER}
  1322. </if>
  1323. <if test="depId != null">
  1324. and e.order_dep = #{depId,jdbcType=VARCHAR}
  1325. </if>
  1326. <if test="contractNo != null">
  1327. and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
  1328. </if>
  1329. <if test="orderNo != null">
  1330. and e.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%')
  1331. </if>
  1332. <if test="taskId != null">
  1333. and a.id= #{taskId,jdbcType=VARCHAR}
  1334. </if>
  1335. <if test="starTime !=null and endTime !=null">
  1336. and e.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1337. </if>
  1338. order by a.task_start_time desc,e.create_time desc
  1339. <if test="page_sql!=null">
  1340. ${page_sql}
  1341. </if>
  1342. </select>
  1343. <select id="selectTaskHoursListCount" resultType="java.lang.Integer">
  1344. 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
  1345. 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
  1346. where e.delete_sign =0 and a.super_id is null and a.split_status in(0,2)
  1347. <if test="shiroType == 1 and aid !=null">
  1348. and tm.finance_id= #{aid,jdbcType=VARCHAR}
  1349. </if>
  1350. <if test="shiroType == 2 and aid !=null">
  1351. and tm.finance_id in (select id from admin where superior_id= #{aid,jdbcType=VARCHAR})
  1352. </if>
  1353. <if test="name != null">
  1354. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1355. </if>
  1356. <if test="outsource != null">
  1357. and a.outsource = #{outsource,jdbcType=INTEGER}
  1358. </if>
  1359. <if test="cid != null">
  1360. and b.cid = #{cid,jdbcType=VARCHAR}
  1361. </if>
  1362. <if test="depId != null">
  1363. and e.order_dep = #{depId,jdbcType=VARCHAR}
  1364. </if>
  1365. <if test="contractNo != null">
  1366. and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
  1367. </if>
  1368. <if test="orderNo != null">
  1369. and e.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%')
  1370. </if>
  1371. <if test="taskId != null">
  1372. and a.id= #{taskId,jdbcType=VARCHAR}
  1373. </if>
  1374. <if test="starTime !=null and endTime !=null">
  1375. and e.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1376. </if>
  1377. </select>
  1378. <select id="selectTaskListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
  1379. select a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,
  1380. a.project_status as projectStatus,a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,
  1381. a.commodity_quantity as commodityQuantity,f.nickname as userName,h.name as depName,ifnull(i.alreadyNumber,0)as alreadyNumber,
  1382. a.split_status splitStatus,a.split_super splitSuper, a.split_id splitId
  1383. from (select task_id from t_task_log a where task_receiver=#{aid ,jdbcType=VARCHAR} UNION select task_id from t_task_log a
  1384. where task_allocator=#{aid ,jdbcType=VARCHAR}) x left join t_order_task a on x.task_id=a.id
  1385. left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.id
  1386. left join admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no
  1387. left join user f on e.buyer_id=f.id left join department h on e.order_dep=h.id
  1388. left join (select task_id , sum(already_number) as alreadyNumber from task_progress group by task_id) i on a.id=i.task_id
  1389. where e.delete_sign in(0,2,3)
  1390. <if test="orderNo != null">
  1391. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1392. </if>
  1393. <if test="name != null">
  1394. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1395. </if>
  1396. <if test="orderNo != null">
  1397. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1398. </if>
  1399. <if test="depId != null">
  1400. and e.order_dep= #{depId ,jdbcType=VARCHAR}
  1401. </if>
  1402. <if test="taskId != null">
  1403. and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
  1404. </if>
  1405. <if test="taskStatus != null">
  1406. and a.task_status= #{taskStatus,jdbcType=INTEGER}
  1407. </if>
  1408. <if test="adminName != null">
  1409. and d.name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
  1410. </if>
  1411. order by a.task_distribution_time desc
  1412. <if test="page_sql!=null">
  1413. ${page_sql}
  1414. </if>
  1415. </select>
  1416. <select id="selectTaskListCount" resultType="java.lang.Integer">
  1417. select count(*)
  1418. from (select task_id from t_task_log a where task_receiver=#{aid ,jdbcType=VARCHAR} UNION select task_id from t_task_log a
  1419. where task_allocator=#{aid ,jdbcType=VARCHAR}) x left join t_order_task a on x.task_id=a.id
  1420. left join business_project b on a.commodity_id=b.id
  1421. left join business_category c on b.cid=c.id
  1422. left join admin d on a.task_receiver=d.id
  1423. left join t_order_new e on a.order_no=e.order_no
  1424. left join user f on e.buyer_id=f.id
  1425. left join department h on e.order_dep=h.id
  1426. left join (select task_id , sum(already_number) as alreadyNumber from task_progress group by task_id) i on a.id=i.task_id
  1427. where e.delete_sign in(0,2,3)
  1428. <if test="orderNo != null">
  1429. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1430. </if>
  1431. <if test="name != null">
  1432. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1433. </if>
  1434. <if test="depId != null">
  1435. and e.order_dep= #{depId ,jdbcType=VARCHAR}
  1436. </if>
  1437. <if test="orderNo != null">
  1438. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1439. </if>
  1440. <if test="taskId != null">
  1441. and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
  1442. </if>
  1443. <if test="taskStatus != null">
  1444. and a.task_status= #{taskStatus,jdbcType=INTEGER}
  1445. </if>
  1446. <if test="adminName != null">
  1447. and d.name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
  1448. </if>
  1449. </select>
  1450. <!-- 根据订单编号获得所有的任务负责人 -->
  1451. <select id="getReceiverByOid" parameterType="java.lang.String" resultMap="BaseResultMap">
  1452. select distinct task_receiver, a.name, a.email, t.id, t.project_status from t_order_task t
  1453. inner join admin a on t.task_receiver = a.id
  1454. where order_no = #{orderNo,jdbcType=VARCHAR} and task_status &gt; 0 and super_id is null
  1455. </select>
  1456. <update id="updateDimissionTransfer" parameterType="java.lang.String">
  1457. update t_order_task set task_allocator= #{aid,jdbcType=VARCHAR},task_receiver= #{transferId,jdbcType=VARCHAR}
  1458. <if test="type==0">
  1459. ,consultant_id=#{transferId,jdbcType=VARCHAR}
  1460. </if>
  1461. <if test="type==1">
  1462. ,manager_id=#{transferId,jdbcType=VARCHAR}
  1463. </if>
  1464. where task_receiver=#{aid,jdbcType=VARCHAR}
  1465. </update>
  1466. <select id="selectEstimateCost" resultType="java.lang.String">
  1467. select ifnull(sum(a.commodity_quantity * ifnull(b.price,0)),0) from t_order_task a
  1468. left join business_project b on a.commodity_id=b.id
  1469. where order_no= #{orderNo}
  1470. </select>
  1471. <select id="listNameByDepAndName" resultType="java.lang.String">
  1472. select
  1473. <if test="type ==0">
  1474. consultant_id
  1475. </if>
  1476. <if test="type ==1">
  1477. manager_id
  1478. </if>
  1479. from t_order_task
  1480. where order_no= #{orderNo}
  1481. group by
  1482. <if test="type ==0">
  1483. consultant_id
  1484. </if>
  1485. <if test="type ==1">
  1486. manager_id
  1487. </if>
  1488. </select>
  1489. <select id="splitProjectList" resultType="com.goafanti.order.bo.TOrderTaskListBo">
  1490. 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,
  1491. 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,
  1492. 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,
  1493. a.split_super splitSuper,date_format(a.split_time,'%Y-%m-%d %H:%i:%S') splitTimes,ad.name splitAname,a.split_id splitId
  1494. 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
  1495. 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
  1496. left join department h on e.order_dep=h.id left join (select task_id , sum(already_number) as alreadyNumber from task_progress
  1497. 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
  1498. 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
  1499. on a.id=l.tid left join admin ad on ad.id=a.split_aid where e.order_status not in (5,7)
  1500. and split_status =2 and a.split_super= #{tid} order by split_id
  1501. </select>
  1502. <select id="selectByidGetCname" resultType="java.lang.String">
  1503. select b.cname from business_project a left join business_category b on a.cid =b.id
  1504. where a.id= #{pid}
  1505. </select>
  1506. <update id="updateByOutsourceToOrderNo">
  1507. update t_order_task set outsource= #{type} where order_no= #{orderNo}
  1508. </update>
  1509. <select id="getLockId" resultType="java.lang.String">
  1510. select id from user_lock_release a left join (select commodity_id from t_order_task
  1511. where order_no = #{orderNo} GROUP by commodity_id )
  1512. b on a.business_project_id =b.commodity_id
  1513. where a.`type` =1 and a.aid = #{aid} and a.uid = #{uid}
  1514. </select>
  1515. <select id="selectProjectStatisticsListByPage" resultType="com.goafanti.order.bo.OutProjectStatistics">
  1516. select date_format( a.task_distribution_time, '%Y-%m-%d %H:%i:%S' ) distributionTime ,d.name province ,c.name depName,e.salesman_name salesmanName,
  1517. b.contract_no contractNo ,b.order_no orderNo ,e.buyer_name userName,bc.cname ,a.commodity_name pname,ta.name techName,td.name techDepName,
  1518. a.project_status projectStatus,a.id,
  1519. <if test="status==1">
  1520. a.set_up_status setUpStatus , date_format( a.set_up_time , '%Y-%m-%d' ) setUpTime ,a.spot_check_status spotCheckStatus ,b.contact_mobile contactMobile ,
  1521. b.legal_person_tel legalPersonTel , a.certificate_number certificateNumber,a.declaration_batch declarationBatch,
  1522. </if>
  1523. <if test="status==2">
  1524. date_format(a.licence_time, '%Y-%m-%d' ) licenceTime,
  1525. </if>
  1526. <if test="status==3">
  1527. a.commodity_quantity commodityQuantity ,ttm.certificates_count certificatesCount,ttm.urgent_day urgentDay ,ttm.if_material ifMaterial,
  1528. date_format(tp.licence_time, '%Y-%m-%d' ) licenceTime,
  1529. a.certificate_number certificateNumber,ttm.cost_amount costAmount ,
  1530. (a.commodity_price-ttm.cost_amount)profit,
  1531. </if>
  1532. <if test="status==4">
  1533. ttm.certificates_count certificatesCount,a.high_tech_status highTechStatus,
  1534. tp.patent_name patentName ,tp.patent_no patentNo ,date_format(tp.accept_time, '%Y-%m-%d ' ) acceptTime ,
  1535. date_format(tp.licence_time, '%Y-%m-%d' ) licenceTime ,date_format(tp.authorize_time, '%Y-%m-%d ' ) authorizeTime,
  1536. ttm.reject_count rejectCount ,ttm.cost_amount costAmount ,(a.commodity_price-ttm.cost_amount)profit,
  1537. </if>
  1538. a.commodity_quantity commodityQuantity , a.commodity_price commodityPrice ,a.special_comment specialComment
  1539. from t_order_task a left join t_order_new b on a.order_no =b.order_no left join department c on b.order_dep =c.id left join district_glossory d on c.province=d.id
  1540. <if test="status==3 or status==4">
  1541. left join task_progress tp on a.id=tp.task_id
  1542. </if>
  1543. left join t_order_mid e on b.order_no =e.order_no left join business_project bp on a.commodity_id =bp.id left join business_category bc on bp.cid =bc.id
  1544. left join t_task_mid ttm on a.id=ttm.tid left join admin ta on a.task_receiver =ta.id left join department td on ta.department_id =td.id
  1545. <if test="screen ==6">
  1546. right join (select tid ,accept_count sls from t_task_mid where accept_count &gt; 0)tj on a.id=tj.tid
  1547. </if>
  1548. <if test="screen ==7">
  1549. right join (select tid ,end_count wjs from t_task_mid where end_count &gt; 0)tj on a.id=tj.tid
  1550. </if>
  1551. <if test="screen ==8">
  1552. right join (select tid ,authorize_count sqs from t_task_mid where authorize_count &gt; 0)tj on a.id=tj.tid
  1553. </if>
  1554. <if test="screen ==9">
  1555. right join (select tid ,reject_count bhs from t_task_mid where reject_count &gt; 0)tj on a.id=tj.tid
  1556. </if>
  1557. <if test="screen ==10">
  1558. right join (select tid ,certificates_count xzs from t_task_mid where certificates_count &gt; 0)tj on a.id=tj.tid
  1559. </if>
  1560. <if test="screen ==11">
  1561. right join (select tid ,apply_count sqs,reject_count bhs,certificates_count xzs from t_task_mid
  1562. where apply_count &gt; 0)tj on a.id=tj.tid
  1563. </if>
  1564. where a.split_status in (0,2)
  1565. <!-- 筛选项 0库存 1派单 2完成 3立项 4抽查 5未通过 6受理 7完结 8授权 9驳回 10下证 11申请 -->
  1566. <if test="screen ==0">
  1567. and a.project_status in(1,2,3)
  1568. </if>
  1569. <if test="screen ==2">
  1570. and a.project_status &gt; 3
  1571. </if>
  1572. <if test="screen ==3">
  1573. and a.set_up_status =1
  1574. </if>
  1575. <if test="screen ==4">
  1576. and a.spot_check_status in (1,2)
  1577. </if>
  1578. <if test="screen ==5">
  1579. and a.spot_check_status =1
  1580. </if>
  1581. <if test="screen ==12">
  1582. and a.publicity_time is not null
  1583. </if>
  1584. <if test="startDate != null and endDate != null">
  1585. and a.task_distribution_time between #{startDate} and #{endDate}
  1586. </if>
  1587. <if test="province !=null">
  1588. and c.province = #{province}
  1589. </if>
  1590. <if test="projectId !=null">
  1591. and a.commodity_id = #{projectId}
  1592. </if>
  1593. <if test="depId !=null">
  1594. and b.order_dep = #{depId}
  1595. </if>
  1596. <if test="thchDepId !=null">
  1597. and td.id= #{thchDepId}
  1598. </if>
  1599. <if test="projectStatus !=null">
  1600. and bp.cid= #{projectStatus}
  1601. </if>
  1602. <if test="projectType !=null">
  1603. and bp.type= #{projectType}
  1604. </if>
  1605. <if test="orderNo !=null">
  1606. and b.order_no = #{orderNo}
  1607. </if>
  1608. <if test="contractNo !=null">
  1609. and b.contract_no = #{contractNo}
  1610. </if>
  1611. <if test="userName !=null">
  1612. and e.buyer_name like concat( #{userName},'%')
  1613. </if>
  1614. <if test="declarationBatch !=null">
  1615. and a.declaration_batch = #{declarationBatch}
  1616. </if>
  1617. <if test="projectSituation !=null">
  1618. and a.status = #{projectSituation}
  1619. </if>
  1620. <if test=" projectAmount !=null and projectAmount != 9">
  1621. and a.commodity_price &gt;= #{amountStart} and a.commodity_price &lt; #{amountEnd}
  1622. </if>
  1623. <if test=" projectAmount == 9">
  1624. and a.commodity_price &gt;= #{amountStart}
  1625. </if>
  1626. <if test="page_sql!=null">
  1627. ${page_sql}
  1628. </if>
  1629. </select>
  1630. <select id="selectProjectStatisticsCount" resultType="java.lang.Integer">
  1631. select count(*)
  1632. from t_order_task a left join t_order_new b on a.order_no =b.order_no left join department c on b.order_dep =c.id left join district_glossory d on c.province=d.id
  1633. left join t_order_mid e on b.order_no =e.order_no left join business_project bp on a.commodity_id =bp.id left join business_category bc on bp.cid =bc.id
  1634. left join t_task_mid ttm on a.id=ttm.tid left join admin ta on a.task_receiver =ta.id left join department td on ta.department_id =td.id
  1635. <if test="status==3 or status==4">
  1636. left join task_progress tp on a.id=tp.task_id
  1637. </if>
  1638. <if test="screen ==6">
  1639. right join (select tid ,accept_count sls from t_task_mid where accept_count &gt; 0)tj on a.id=tj.tid
  1640. </if>
  1641. <if test="screen ==7">
  1642. right join (select tid ,end_count wjs from t_task_mid where end_count &gt; 0)tj on a.id=tj.tid
  1643. </if>
  1644. <if test="screen ==8">
  1645. right join (select tid ,authorize_count sqs from t_task_mid where authorize_count &gt; 0)tj on a.id=tj.tid
  1646. </if>
  1647. <if test="screen ==9">
  1648. right join (select tid ,reject_count bhs from t_task_mid where reject_count &gt; 0)tj on a.id=tj.tid
  1649. </if>
  1650. <if test="screen ==10">
  1651. right join (select tid ,certificates_count xzs from t_task_mid where certificates_count &gt; 0)tj on a.id=tj.tid
  1652. </if>
  1653. <if test="screen ==11">
  1654. right join (select tid ,apply_count sqs,reject_count bhs,certificates_count xzs from t_task_mid
  1655. where apply_count &gt; 0)tj on a.id=tj.tid
  1656. </if>
  1657. where a.split_status in (0,2)
  1658. <!-- 筛选项 0库存 1派单 2完成 3立项 4抽查 5未通过 6受理 7完结 8授权 9驳回 10下证 11申请 -->
  1659. <if test="screen ==0">
  1660. and a.project_status in(1,2,3)
  1661. </if>
  1662. <if test="screen ==2">
  1663. and a.project_status &gt; 3
  1664. </if>
  1665. <if test="screen ==3">
  1666. and a.set_up_status =1
  1667. </if>
  1668. <if test="screen ==4">
  1669. and a.spot_check_status in (1,2)
  1670. </if>
  1671. <if test="screen ==5">
  1672. and a.spot_check_status =1
  1673. </if>
  1674. <if test="screen ==12">
  1675. and a.publicity_time is not null
  1676. </if>
  1677. <if test="startDate != null and endDate != null">
  1678. and a.task_distribution_time between #{startDate} and #{endDate}
  1679. </if>
  1680. <if test="province !=null">
  1681. and c.province = #{province}
  1682. </if>
  1683. <if test="projectId !=null">
  1684. and a.commodity_id = #{projectId}
  1685. </if>
  1686. <if test="depId !=null">
  1687. and b.order_dep = #{depId}
  1688. </if>
  1689. <if test="thchDepId !=null">
  1690. and td.id= #{thchDepId}
  1691. </if>
  1692. <if test="projectStatus !=null">
  1693. and bp.cid= #{projectStatus}
  1694. </if>
  1695. <if test="projectType !=null">
  1696. and bp.type= #{projectType}
  1697. </if>
  1698. <if test="orderNo !=null">
  1699. and b.order_no = #{orderNo}
  1700. </if>
  1701. <if test="contractNo !=null">
  1702. and b.contract_no = #{contractNo}
  1703. </if>
  1704. <if test="userName !=null">
  1705. and e.buyer_name like concat( #{userName},'%')
  1706. </if>
  1707. <if test="declarationBatch !=null">
  1708. and a.declaration_batch = #{declarationBatch}
  1709. </if>
  1710. <if test="projectSituation !=null">
  1711. and a.status = #{projectSituation}
  1712. </if>
  1713. <if test=" projectAmount !=null and projectAmount != 9">
  1714. and a.commodity_price &gt;= #{amountStart} and a.commodity_price &lt; #{amountEnd}
  1715. </if>
  1716. <if test=" projectAmount == 9">
  1717. and a.commodity_price &gt;= #{amountStart}
  1718. </if>
  1719. </select>
  1720. <select id="selectProvincialStatisticsListByPage" resultType="com.goafanti.order.bo.OutProvincialStatistics">
  1721. select dg.name provinceName,de.name thchDepName ,bc.cname projectStatus,
  1722. dg.id province, de.id thchDepId,bc.id bpId,
  1723. ifnull(x.kcs,0) stockCount, ifnull(x.pds,0) distributeCount,
  1724. <if test="status==1">
  1725. ifnull(x.wcs,0) completeCount, ifnull(x.lxs,0) setUpCount,ifnull(x.ccs,0) spotCheckCount,ifnull(x.wtg,0) failedCount,
  1726. </if>
  1727. <if test="status==2 or status==3">
  1728. ifnull(x.sls,0) acceptCount,ifnull(x.wjs,0) completeCount,ifnull(x.sqs,0) authorizeCount,ifnull(x.bhs,0) rejectCount,
  1729. </if>
  1730. <if test="status==4">
  1731. ifnull(x.xzs,0) certificatesCount,
  1732. </if>
  1733. <if test="status==5">
  1734. ifnull(x.sqs,0)applyCount ,ifnull(x.bhs,0)rejectCount ,ifnull(x.xzs,0) certificatesCount,
  1735. </if>
  1736. <if test="status==0">
  1737. ifnull(x.wcs,0) completeCount, ifnull(x.gss,0) publicityCount,
  1738. </if>
  1739. x.amountCount,x.costAmount,x.profit
  1740. from (select dep.province, ad.department_id,bp.cid ,sum(kcs.kcs) kcs,sum(kcs.pds)pds,
  1741. <if test="status==1">
  1742. sum(wcs.wcs)wcs, sum(wcs.lxs)lxs,sum(wcs.ccs)ccs,sum(wcs.wtg)wtg,
  1743. </if>
  1744. <if test="status==2 or status==3">
  1745. sum(tj.sls) sls,sum(tj.wjs)wjs,sum(tj.sqs)sqs, sum(tj.bhs)bhs,
  1746. </if>
  1747. <if test="status==4">
  1748. sum(tj.xzs) xzs,
  1749. </if>
  1750. <if test="status==5">
  1751. sum(tj.sqs) sqs,sum(tj.bhs) bhs,sum(tj.xzs) xzs,
  1752. </if>
  1753. <if test="status==0">
  1754. sum(wcs.wcs)wcs, sum(wcs.gss)gss,
  1755. </if>
  1756. sum(a.commodity_price)amountCount,sum(ttm.cost_amount)costAmount, (sum(a.commodity_price)-sum(ttm.cost_amount))profit
  1757. from t_order_task a left join t_order_new b on a.order_no =b.order_no and b.delete_sign in(0,2) left join t_task_mid ttm on a.id=ttm.tid
  1758. left join department dep on b.order_dep =dep.id inner join admin ad on a.task_receiver =ad.id
  1759. left join business_project bp on a.commodity_id =bp.id
  1760. left join (select id,if(project_status BETWEEN 1 and 3,commodity_quantity,0) kcs,
  1761. if(task_status in (1,2,3),commodity_quantity,0) pds from t_order_task)kcs on a.id=kcs.id
  1762. <if test="status==1">
  1763. left join (select id,if(project_status > 3,commodity_quantity,0) wcs, if( set_up_status=1,commodity_quantity,0) lxs,
  1764. if(spot_check_status in (1,2),commodity_quantity,0) ccs, if( spot_check_status =1,commodity_quantity,0) wtg
  1765. from t_order_task )wcs on a.id=wcs.id
  1766. </if>
  1767. <if test="status==2 or status==3">
  1768. left join (select tid ,accept_count sls,end_count wjs,authorize_count sqs,reject_count bhs from t_task_mid
  1769. where authorize_count &gt; 0)tj on a.id=tj.tid
  1770. </if>
  1771. <if test="status==4">
  1772. left join (select tid ,certificates_count xzs from t_task_mid where certificates_count &gt; 0)tj on a.id=tj.tid
  1773. </if>
  1774. <if test="status==5">
  1775. left join (select tid ,apply_count sqs,reject_count bhs,certificates_count xzs from t_task_mid
  1776. where apply_count &gt; 0)tj on a.id=tj.tid
  1777. </if>
  1778. <if test="status==0">
  1779. left join (select id,if(project_status > 3,commodity_quantity,0) wcs,
  1780. if( if_publicity=1,commodity_quantity,0) gss
  1781. from t_order_task )wcs on a.id=wcs.id
  1782. </if>
  1783. where a.split_status in(0,2)
  1784. <if test="startDate != null and endDate != null">
  1785. and a.task_distribution_time between #{startDate} and #{endDate}
  1786. </if>
  1787. <if test="province !=null">
  1788. and dep.province = #{province}
  1789. </if>
  1790. <if test="thchDepId !=null">
  1791. and ad.department_id = #{thchDepId}
  1792. </if>
  1793. <if test="projectStatus !=null">
  1794. and bp.cid = #{projectStatus}
  1795. </if>
  1796. <if test="projectType !=null">
  1797. and bp.`type` = #{projectType}
  1798. </if>
  1799. <if test="projectId !=null">
  1800. and a.commodity_id = #{projectId}
  1801. </if>
  1802. group by dep.province,ad.department_id,bp.cid )x inner join district_glossory dg on x.province=dg.id
  1803. inner join department de on x.department_id=de.id left join business_category bc on x.cid=bc.id
  1804. <if test="page_sql!=null">
  1805. ${page_sql}
  1806. </if>
  1807. </select>
  1808. <select id="selectProvincialStatisticsCount" resultType="java.lang.Integer">
  1809. select count(*)
  1810. from (select dep.province, ad.department_id,bp.cid
  1811. from t_order_task a left join t_order_new b on a.order_no =b.order_no and b.delete_sign in(0,2) left join t_task_mid ttm on a.id=ttm.tid
  1812. left join department dep on b.order_dep =dep.id inner join admin ad on a.task_receiver =ad.id
  1813. left join business_project bp on a.commodity_id =bp.id
  1814. where a.split_status in(0,2)
  1815. <if test="startDate != null and endDate != null">
  1816. and a.task_distribution_time between #{startDate} and #{endDate}
  1817. </if>
  1818. <if test="province !=null">
  1819. and dep.province = #{province}
  1820. </if>
  1821. <if test="thchDepId !=null">
  1822. and ad.department_id = #{thchDepId}
  1823. </if>
  1824. <if test="projectStatus !=null">
  1825. and bp.cid = #{projectStatus}
  1826. </if>
  1827. <if test="projectType !=null">
  1828. and bp.`type` = #{projectType}
  1829. </if>
  1830. <if test="projectId !=null">
  1831. and a.commodity_id = #{projectId}
  1832. </if>
  1833. group by dep.province,ad.department_id,bp.cid )x inner join district_glossory dg on x.province=dg.id
  1834. inner join department de on x.department_id=de.id left join business_category bc on x.cid=bc.id
  1835. </select>
  1836. <select id="managerSelectByPage" resultType="com.goafanti.order.bo.managerListBo">
  1837. select a.id,a.task_distribution_time taskDistributionTime ,tm.province_name provinceName,tm.dep_name depName,
  1838. tm.salesman_name salesmanName, b.contract_no contractNo ,b.order_no orderNo,tm.buyer_name UserName,a.cname ,
  1839. a.commodity_name commodityName,a.commodity_quantity commodityQuantity,dep.name techDepName,a.receiver_name techName,
  1840. a.project_status projectStatus ,a.commodity_price commodityPrice ,a.special_comment specialComment
  1841. from (select task_id from t_task_log a where task_receiver=#{aid}
  1842. UNION select task_id from t_task_log a where task_allocator=#{aid}) x
  1843. left join t_order_task a on x.task_id=a.id left join t_order_new b on a.order_no =b.order_no
  1844. left join t_order_mid tm on b.order_no=tm.order_no left join admin ad on a.task_receiver =ad.id
  1845. left join department dep on ad.department_id =dep.id left join business_project bp on a.commodity_id =bp.id
  1846. where 1=1
  1847. <if test="orderNo !=null">
  1848. and a.order_no = #{orderNo}
  1849. </if>
  1850. <if test="contractNo !=null">
  1851. and b.contract_no = #{contractNo}
  1852. </if>
  1853. <if test="name !=null">
  1854. and tm.buyer_name like CONCAT('%',#{name},'%')
  1855. </if>
  1856. <if test="cid !=null">
  1857. and bp.cid =#{cid}
  1858. </if>
  1859. <if test="projectType !=null">
  1860. and bp.`type` =#{projectType}
  1861. </if>
  1862. <if test="depId !=null">
  1863. and b.order_dep =#{depId}
  1864. </if>
  1865. <if test="techDepId !=null">
  1866. and ad.department_id =#{techDepId}
  1867. </if>
  1868. <if test="declarationBatch !=null">
  1869. and a.declaration_batch =#{declarationBatch}
  1870. </if>
  1871. <if test="commodityPrice !=null">
  1872. and a.commodity_price =#{commodityPrice}
  1873. </if>
  1874. <if test="startTime !=null and endTime !=null">
  1875. and a.task_distribution_time between #{startTime} and #{endTime}
  1876. </if>
  1877. <if test="page_sql!=null">
  1878. ${page_sql}
  1879. </if>
  1880. </select>
  1881. <select id="managerSelectCount" resultType="java.lang.Integer">
  1882. select count(*)
  1883. from (select task_id from t_task_log a where task_receiver= #{aid} UNION
  1884. select task_id from t_task_log a where task_allocator= #{aid}) x
  1885. left join t_order_task a on x.task_id=a.id left join t_order_new b on a.order_no =b.order_no
  1886. left join t_order_mid tm on b.order_no=tm.order_no left join admin ad on a.task_receiver =ad.id
  1887. left join department dep on ad.department_id =dep.id left join business_project bp on a.commodity_id =bp.id
  1888. where 1=1
  1889. <if test="orderNo !=null">
  1890. and a.order_no = #{orderNo}
  1891. </if>
  1892. <if test="contractNo !=null">
  1893. and b.contract_no = #{contractNo}
  1894. </if>
  1895. <if test="name !=null">
  1896. and tm.buyer_name like CONCAT('%',#{name},'%')
  1897. </if>
  1898. <if test="cid !=null">
  1899. and bp.cid =#{cid}
  1900. </if>
  1901. <if test="projectType !=null">
  1902. and bp.`type` =#{projectType}
  1903. </if>
  1904. <if test="depId !=null">
  1905. and b.order_dep =#{depId}
  1906. </if>
  1907. <if test="techDepId !=null">
  1908. and ad.department_id =#{techDepId}
  1909. </if>
  1910. <if test="declarationBatch !=null">
  1911. and a.declaration_batch =#{declarationBatch}
  1912. </if>
  1913. <if test="commodityPrice !=null">
  1914. and a.commodity_price =#{commodityPrice}
  1915. </if>
  1916. <if test="startTime !=null and endTime !=null">
  1917. and a.task_distribution_time between #{startTime} and #{endTime}
  1918. </if>
  1919. </select>
  1920. <resultMap id="userOrder" type="com.goafanti.common.bo.UserOrderTask">
  1921. <id column="orderNo" jdbcType="VARCHAR" property="orderNo" />
  1922. <collection ofType="com.goafanti.common.bo.UserTask" property="list">
  1923. <id column="id" jdbcType="VARCHAR" property="id" />
  1924. <result column="commodityName" jdbcType="VARCHAR" property="commodityName" />
  1925. </collection>
  1926. </resultMap>
  1927. <select id="selectUidByproject" resultMap="userOrder">
  1928. select a.order_no orderNo ,b.id,b.commodity_name commodityName from t_order_new a
  1929. left join t_order_task b on a.order_no =b.order_no
  1930. where a.buyer_id = #{uid}
  1931. </select>
  1932. <select id="selectProjectCheck" resultType="com.goafanti.order.bo.OutProjectCheck">
  1933. select a.id,a.commodity_name commodityName ,b.order_no orderNo,b.contract_no contractNo,a.commodity_quantity commodityQuantity,
  1934. c.buyer_name userName ,e.cname ,a.task_distribution_time taskDistributionTime,f.name depName ,a.check_status checkStatus ,
  1935. a.main ,a.commodity_price commodityPrice ,a.task_comment taskComment ,a.official_cost officialCost,a.cost_reduction costReduction,
  1936. a.patent_type patentType
  1937. from t_order_task a left join t_order_new b on a.order_no =b.order_no
  1938. left join t_order_mid c on a.order_no =c.order_no
  1939. left join business_project d on a.commodity_id =d.id
  1940. left join business_category e on d.cid =e.id
  1941. left join department f on b.order_dep =f.id
  1942. where check_status =1
  1943. <if test="aid !=null">
  1944. and b.salesman_id = #{aid}
  1945. </if>
  1946. <if test="name !=null">
  1947. and c.buyer_name like concat('%',#{name},'%')
  1948. </if>
  1949. <if test="orderNo !=null">
  1950. and a.order_no = #{orderNo}
  1951. </if>
  1952. <if test="contractNo !=null">
  1953. and b.contract_no = #{contractNo}
  1954. </if>
  1955. <if test="pname !=null">
  1956. and a.commodity_name like concat('%',#{pname},'%')
  1957. </if>
  1958. <if test="depId !=null">
  1959. and b.order_dep = #{depId}
  1960. </if>
  1961. <if test="page_sql!=null">
  1962. ${page_sql}
  1963. </if>
  1964. </select>
  1965. <select id="countProjectCheck" resultType="java.lang.Integer">
  1966. select count(*)
  1967. from t_order_task a left join t_order_new b on a.order_no =b.order_no
  1968. left join t_order_mid c on a.order_no =c.order_no
  1969. left join business_project d on a.commodity_id =d.id
  1970. left join business_category e on d.cid =e.id
  1971. left join department f on b.order_dep =f.id
  1972. where check_status =1
  1973. <if test="aid !=null">
  1974. and b.salesman_id = #{aid}
  1975. </if>
  1976. <if test="name !=null">
  1977. and c.buyer_name like concat('%',#{name},'%')
  1978. </if>
  1979. <if test="orderNo !=null">
  1980. and a.order_no = #{orderNo}
  1981. </if>
  1982. <if test="contractNo !=null">
  1983. and b.contract_no = #{contractNo}
  1984. </if>
  1985. <if test="pname !=null">
  1986. and a.commodity_name like concat('%',#{pname},'%')
  1987. </if>
  1988. <if test="depId !=null">
  1989. and b.order_dep = #{depId}
  1990. </if>
  1991. </select>
  1992. <update id="resstPayment">
  1993. update t_order_task a ,t_task_mid c
  1994. set c.party_amount =0,c.cost_amount =0
  1995. where a.id= #{id} and a.id=c.tid
  1996. </update>
  1997. <update id="updateAddCostAmount">
  1998. update t_task_mid
  1999. set cost_amount =cost_amount + #{cost}
  2000. where tid= #{tid}
  2001. </update>
  2002. <select id="selectAidByParam" resultType="com.goafanti.common.bo.OrderOperator">
  2003. select a.id tid,b.order_no orderNo ,b.salesman_id salesmanId,b.finance_id financeId ,a.task_receiver techId,
  2004. b.salesman_name salesmanName ,b.finance_name financeName ,d.name techName,b.buyer_name buyerName
  2005. from t_order_task a left join t_order_mid b on a.order_no=b.order_no
  2006. left join t_task_mid c on a.id =c.tid left join admin d on a.task_receiver=d.id
  2007. where 1=1
  2008. <if test="tid !=null">
  2009. and a.id= #{tid}
  2010. </if>
  2011. </select>
  2012. <select id="selectByTidGetDtails" resultType="com.goafanti.organization.bo.ProjectTypePuls">
  2013. select a.id,a.official_cost officialCost,a.cost_reduction costReduction ,a.commodity_quantity quantity ,a.patent_type patentType,b.patent_name_type projectType,
  2014. c.amount officialAmount,c.proportion85,b.patent_type outPatentType from t_order_task a left join t_order_outsource b on a.id=b.tid
  2015. left join official_fee_price c on a.patent_type =c.patent_type and b.patent_name_type =c.`type`
  2016. where a.id= #{tid}
  2017. </select>
  2018. <select id="highNewRetrialStatistics" resultType="com.goafanti.order.bo.OutHighNewRetrialStatistics">
  2019. select t1. province,dg.name provinceName ,t1.quantity,t1.pass,t1.notPass,ifnull(t1.signBacks,0) signBacks
  2020. from (SELECT e.province ,sum(1) quantity,sum(if(a.project_status=10,1,0))pass,sum(if(a.project_status != 10,1,0))notPass,
  2021. sum(ttm.high_new_retrial)signBacks
  2022. from t_order_task a left join business_project b on a.commodity_id =b.id left join t_task_mid ttm on a.id=ttm.tid
  2023. left join t_order_new c on a.order_no =c.order_no left join admin d on c.salesman_id =d.id
  2024. left join department e on d.department_id =e.id where b.`type` =5 and c.process_status >4 and c.delete_sign in (0,2)
  2025. <if test="depId!=null">
  2026. and e.id= #{depId}
  2027. </if>
  2028. <if test="startDate!=null and endDate!=null">
  2029. and c.sign_time between #{startDate} and #{endDate}
  2030. </if>
  2031. group by e.province )t1 left join district_glossory dg on t1.province=dg.id
  2032. </select>
  2033. <select id="getHighNewRetrial" resultType="java.lang.Integer">
  2034. select count(*) from t_order_new a left join t_order_new b on a.buyer_id =b.buyer_id
  2035. left join t_order_task c on b.order_no =c.order_no left join business_project d on c.commodity_id =d.id
  2036. where a.order_no =#{orderNo} and b.create_time &lt; a.create_time and d.`type` =5
  2037. </select>
  2038. <select id="highNewRetrialList" resultType="com.goafanti.order.bo.OutHighNewRetrialList">
  2039. select t1.province,dg.name provinceName,t1.salesman_id aid,t1.name name,t1.quantity,t1.pass,t1.notPass,t1.signBacks
  2040. from (SELECT e.province,c.salesman_id,d.name ,sum(1) quantity,sum(if(a.project_status=10,1,0))pass,
  2041. sum(if(a.project_status != 10,1,0))notPass, sum(ttm.high_new_retrial)signBacks
  2042. from t_order_task a left join business_project b on a.commodity_id =b.id left join t_task_mid ttm on a.id=ttm.tid
  2043. left join t_order_new c on a.order_no =c.order_no left join admin d on c.salesman_id =d.id
  2044. left join department e on d.department_id =e.id where b.`type` =5 and c.process_status >4 and c.delete_sign in (0,2)
  2045. <if test="province!=null">
  2046. and e.province= #{province}
  2047. </if>
  2048. <if test="depId!=null">
  2049. and e.id= #{depId}
  2050. </if>
  2051. <if test="startDate!=null and endDate!=null">
  2052. and c.sign_time between #{startDate} and #{endDate}
  2053. </if>
  2054. <if test="aid !=null">
  2055. and c.salesman_id = #{aid}
  2056. </if>
  2057. <if test="depId !=null">
  2058. and d.department_id = #{depId}
  2059. </if>
  2060. group by e.province ,c.salesman_id ,d.name )t1 left join district_glossory dg on t1.province=dg.id
  2061. order by
  2062. <if test="sort==0">
  2063. t1.pass
  2064. </if>
  2065. <if test="sort==1">
  2066. t1.notPass
  2067. </if>
  2068. desc
  2069. </select>
  2070. </mapper>