TOrderTaskMapper.xml 100 KB

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