TOrderTaskMapper.xml 102 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483
  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,toa.type,toa.type_explain typeExplain
  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. <if test="type !=null">
  1082. inner join
  1083. </if>
  1084. <if test="type ==null">
  1085. left join
  1086. </if>
  1087. (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  1088. from t_order_approval
  1089. <if test="type !=null">
  1090. where `type` in
  1091. <foreach collection="type" item="item" separator="," open="(" close=")">
  1092. #{item}
  1093. </foreach>
  1094. </if>
  1095. group by order_no) toa on e.order_no=toa.order_no
  1096. where e.delete_sign in (0,2,3) and e.order_status in (2,4)
  1097. and a.outsource= #{outsource,jdbcType=INTEGER}
  1098. <include refid="selectOrderTaskListSql"/>
  1099. order by a.task_distribution_time desc
  1100. <if test="page_sql!=null">
  1101. ${page_sql}
  1102. </if>
  1103. </select>
  1104. <sql id="selectOrderTaskListSql">
  1105. <if test="role == 0 ">
  1106. and a.task_receiver= #{aid,jdbcType=VARCHAR}
  1107. </if>
  1108. <if test="role ==1 and fids != null and fids.size() &gt; 0">
  1109. and e.finance_id in
  1110. <foreach close=")" collection="fids" index="" item="item" open="(" separator=",">
  1111. #{item}
  1112. </foreach>
  1113. </if>
  1114. <if test="specially == 0 ">
  1115. and a.split_status in (0,2)
  1116. </if>
  1117. <if test="orderNo != null">
  1118. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1119. </if>
  1120. <if test="approval ==0">
  1121. and e.approval = 0
  1122. </if>
  1123. <if test="approval ==1">
  1124. and e.approval in(1,2)
  1125. </if>
  1126. <if test="approval ==2">
  1127. and e.approval in (4,5)
  1128. </if>
  1129. <if test="cid != null">
  1130. and c.id = #{cid}
  1131. </if>
  1132. <if test="outsourceStatus !=null">
  1133. and l.refund_status = #{outsourceStatus,jdbcType=INTEGER}
  1134. </if>
  1135. <if test="contractNo != null">
  1136. and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
  1137. </if>
  1138. <if test="projectStatus != null">
  1139. and a.project_status = #{projectStatus,jdbcType=INTEGER}
  1140. </if>
  1141. <if test="deps != null">
  1142. and e.order_dep in
  1143. <foreach close=")" collection="deps" item="depId" open="(" separator=",">
  1144. #{depId}
  1145. </foreach>
  1146. </if>
  1147. <if test="name != null">
  1148. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1149. </if>
  1150. <if test="projectName != null">
  1151. and a.commodity_name like CONCAT('%',#{projectName,jdbcType=VARCHAR},'%')
  1152. </if>
  1153. <if test="taskId != null">
  1154. and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
  1155. </if>
  1156. <if test="taskStatus != null">
  1157. and a.task_status= #{taskStatus,jdbcType=INTEGER}
  1158. </if>
  1159. <if test="adminName != null">
  1160. and a.receiver_name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
  1161. </if>
  1162. <if test="startTime != null and endTime != null">
  1163. and e.sign_time between #{startTime} and #{endTime}
  1164. </if>
  1165. </sql>
  1166. <select id="selectOrderTaskListCount" resultType="java.lang.Integer">
  1167. select count(*) from t_order_task a
  1168. left join t_order_new e on a.order_no=e.order_no
  1169. <if test="cid != null">
  1170. left join business_project b on a.commodity_id=b.id
  1171. left join business_category c on b.cid=c.id
  1172. </if>
  1173. <if test="name != null">
  1174. left join user f on e.buyer_id=f.id
  1175. </if>
  1176. <if test="outsourceStatus !=null">
  1177. left join t_order_outsource l on a.id=l.tid
  1178. </if>
  1179. <if test="type !=null">
  1180. inner join
  1181. (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  1182. from t_order_approval
  1183. where `type` in
  1184. <foreach collection="type" item="item" separator="," open="(" close=")">
  1185. #{item}
  1186. </foreach>
  1187. group by order_no) toa on o.order_no=toa.order_no
  1188. </if>
  1189. where e.delete_sign in (0,2,3) and e.order_status in (2,4)
  1190. and a.outsource= #{outsource,jdbcType=INTEGER}
  1191. <include refid="selectOrderTaskListSql"/>
  1192. </select>
  1193. <select id="selectOrderTaskListSum" resultType="java.util.Map">
  1194. select sum(a.commodity_price) totalAmount,sum(a.commodity_quantity)totalNumber
  1195. from t_order_task a
  1196. left join t_order_new e on a.order_no=e.order_no
  1197. <if test="cid != null">
  1198. left join business_project b on a.commodity_id=b.id
  1199. left join business_category c on b.cid=c.id
  1200. </if>
  1201. <if test="name != null">
  1202. left join user f on e.buyer_id=f.id
  1203. </if>
  1204. <if test="outsourceStatus !=null">
  1205. left join t_order_outsource l on a.id=l.tid
  1206. </if>
  1207. <if test="type !=null">
  1208. inner join
  1209. (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  1210. from t_order_approval
  1211. where `type` in
  1212. <foreach collection="type" item="item" separator="," open="(" close=")">
  1213. #{item}
  1214. </foreach>
  1215. group by order_no) toa on e.order_no=toa.order_no
  1216. </if>
  1217. where e.delete_sign in (0,2,3) and e.order_status in (2,4)
  1218. and a.outsource= #{outsource,jdbcType=INTEGER}
  1219. <include refid="selectOrderTaskListSql"/>
  1220. </select>
  1221. <select id="getOrderTaskDetail" resultType="com.goafanti.order.bo.TOrderTaskDetailBo">
  1222. select
  1223. 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,
  1224. 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,
  1225. 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,
  1226. 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,
  1227. 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,
  1228. 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 ,
  1229. 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,
  1230. 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,
  1231. 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,
  1232. a.if_certification_fee ifCertificationFee , a.certification_corporate certificationCorporate ,a.certification_fee certificationFee ,a.time_record timeRecord,
  1233. 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 ,
  1234. a.spot_check_status spotCheckStatus , a.special_comment specialComment ,ttm.certificates_count certificatesCount ,ttm.reject_count rejectCount ,a.check_status checkStatus,
  1235. ttm.authorize_count authorizeCount ,ttm.end_count endCount,ttm.accept_count acceptCount,a.commodity_price commodityPrice,a.commodity_quantity commodityQuantity,
  1236. a.satisfaction_degree satisfactionDegree,a.satisfaction_degree_url satisfactionDegreeUrl
  1237. 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
  1238. left join admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no
  1239. 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
  1240. left join admin g on e.salesman_id=g.id
  1241. where a.id= #{id,jdbcType=VARCHAR}
  1242. </select>
  1243. <select id="selectBySuperId" resultType="com.goafanti.common.model.TOrderTask">
  1244. select super_id as superId,min(task_status) as taskStatus,min(project_status) as projectStatus,max(main) as main from t_order_task
  1245. where super_id = #{superId,jdbcType=VARCHAR} group by super_id
  1246. </select>
  1247. <select id="selectTaskHoursListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
  1248. 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,
  1249. a.task_status as taskStatus,f.nickname as userName,ifnull(g.hours,0) as hours,a.commodity_quantity as commodityQuantity,a.commodity_price commodityPrice,
  1250. 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,
  1251. 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,
  1252. a.split_status splitStatus, a.split_super splitSuper, a.split_id splitId,ifnull(ttm.cost_amount,0) costAmount,ifnull(ttm.party_amount,0) partyAmount
  1253. 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
  1254. left join t_order_new e on a.order_no=e.order_no left join department dep on e.order_dep=dep.id
  1255. 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
  1256. left join t_order_mid tm on a.order_no=tm.order_no left join t_task_mid ttm on a.id=ttm.tid
  1257. where e.delete_sign =0 and a.super_id is null and a.split_status in(0,2)
  1258. <if test="shiroType == 1 and aid !=null">
  1259. and tm.finance_id= #{aid,jdbcType=VARCHAR}
  1260. </if>
  1261. <if test="shiroType == 2 and aid !=null">
  1262. and tm.finance_id in (select id from admin where superior_id= #{aid,jdbcType=VARCHAR})
  1263. </if>
  1264. <if test="name != null">
  1265. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1266. </if>
  1267. <if test="thchId != null">
  1268. and a.task_receiver = #{thchId,jdbcType=VARCHAR}
  1269. </if>
  1270. <if test="cid != null">
  1271. and b.cid = #{cid,jdbcType=VARCHAR}
  1272. </if>
  1273. <if test="outsource != null">
  1274. and a.outsource = #{outsource,jdbcType=INTEGER}
  1275. </if>
  1276. <if test="depId != null">
  1277. and e.order_dep = #{depId,jdbcType=VARCHAR}
  1278. </if>
  1279. <if test="contractNo != null">
  1280. and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
  1281. </if>
  1282. <if test="orderNo != null">
  1283. and e.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%')
  1284. </if>
  1285. <if test="taskId != null">
  1286. and a.id= #{taskId,jdbcType=VARCHAR}
  1287. </if>
  1288. <if test="starTime !=null and endTime !=null">
  1289. and e.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1290. </if>
  1291. order by a.task_start_time desc,e.create_time desc
  1292. <if test="page_sql!=null">
  1293. ${page_sql}
  1294. </if>
  1295. </select>
  1296. <select id="selectTaskHoursListCount" resultType="java.lang.Integer">
  1297. 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
  1298. 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
  1299. where e.delete_sign =0 and a.super_id is null and a.split_status in(0,2)
  1300. <if test="shiroType == 1 and aid !=null">
  1301. and tm.finance_id= #{aid,jdbcType=VARCHAR}
  1302. </if>
  1303. <if test="shiroType == 2 and aid !=null">
  1304. and tm.finance_id in (select id from admin where superior_id= #{aid,jdbcType=VARCHAR})
  1305. </if>
  1306. <if test="name != null">
  1307. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1308. </if>
  1309. <if test="thchId != null">
  1310. and a.task_receiver = #{thchId,jdbcType=VARCHAR}
  1311. </if>
  1312. <if test="outsource != null">
  1313. and a.outsource = #{outsource,jdbcType=INTEGER}
  1314. </if>
  1315. <if test="cid != null">
  1316. and b.cid = #{cid,jdbcType=VARCHAR}
  1317. </if>
  1318. <if test="depId != null">
  1319. and e.order_dep = #{depId,jdbcType=VARCHAR}
  1320. </if>
  1321. <if test="contractNo != null">
  1322. and e.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
  1323. </if>
  1324. <if test="orderNo != null">
  1325. and e.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%')
  1326. </if>
  1327. <if test="taskId != null">
  1328. and a.id= #{taskId,jdbcType=VARCHAR}
  1329. </if>
  1330. <if test="starTime !=null and endTime !=null">
  1331. and e.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
  1332. </if>
  1333. </select>
  1334. <select id="selectTaskListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
  1335. select a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,
  1336. a.project_status as projectStatus,a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,
  1337. a.commodity_quantity as commodityQuantity,f.nickname as userName,h.name as depName,ifnull(i.alreadyNumber,0)as alreadyNumber,
  1338. a.split_status splitStatus,a.split_super splitSuper, a.split_id splitId,ttm.contract_term contractTerm,ttm.service_year serviceYear
  1339. from (select task_id from t_task_log a where task_receiver=#{aid ,jdbcType=VARCHAR} UNION select task_id from t_task_log a
  1340. where task_allocator=#{aid ,jdbcType=VARCHAR}) x left join t_order_task a on x.task_id=a.id
  1341. left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.id
  1342. left join admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no
  1343. left join user f on e.buyer_id=f.id left join department h on e.order_dep=h.id
  1344. left join (select task_id , sum(already_number) as alreadyNumber from task_progress group by task_id) i on a.id=i.task_id
  1345. left join t_task_member ttm on a.id=ttm.tid
  1346. where e.delete_sign in(0,2,3)
  1347. <if test="orderNo != null">
  1348. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1349. </if>
  1350. <if test="name != null">
  1351. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1352. </if>
  1353. <if test="orderNo != null">
  1354. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1355. </if>
  1356. <if test="depId != null">
  1357. and e.order_dep= #{depId ,jdbcType=VARCHAR}
  1358. </if>
  1359. <if test="thchId != null">
  1360. and a.task_receiver = #{thchId,jdbcType=VARCHAR}
  1361. </if>
  1362. <if test="taskId != null">
  1363. and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
  1364. </if>
  1365. <if test="taskStatus != null">
  1366. and a.task_status= #{taskStatus,jdbcType=INTEGER}
  1367. </if>
  1368. <if test="adminName != null">
  1369. and d.name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
  1370. </if>
  1371. order by a.task_distribution_time desc
  1372. <if test="page_sql!=null">
  1373. ${page_sql}
  1374. </if>
  1375. </select>
  1376. <select id="selectTaskListCount" resultType="java.lang.Integer">
  1377. select count(*)
  1378. from (select task_id from t_task_log a where task_receiver=#{aid ,jdbcType=VARCHAR} UNION select task_id from t_task_log a
  1379. where task_allocator=#{aid ,jdbcType=VARCHAR}) x left join t_order_task a on x.task_id=a.id
  1380. left join business_project b on a.commodity_id=b.id
  1381. left join business_category c on b.cid=c.id
  1382. left join admin d on a.task_receiver=d.id
  1383. left join t_order_new e on a.order_no=e.order_no
  1384. left join user f on e.buyer_id=f.id
  1385. left join department h on e.order_dep=h.id
  1386. left join (select task_id , sum(already_number) as alreadyNumber from task_progress group by task_id) i on a.id=i.task_id
  1387. where e.delete_sign in(0,2,3)
  1388. <if test="orderNo != null">
  1389. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1390. </if>
  1391. <if test="name != null">
  1392. and f.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
  1393. </if>
  1394. <if test="depId != null">
  1395. and e.order_dep= #{depId ,jdbcType=VARCHAR}
  1396. </if>
  1397. <if test="thchId != null">
  1398. and a.task_receiver = #{thchId,jdbcType=VARCHAR}
  1399. </if>
  1400. <if test="orderNo != null">
  1401. and a.order_no= #{orderNo,jdbcType=VARCHAR}
  1402. </if>
  1403. <if test="taskId != null">
  1404. and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
  1405. </if>
  1406. <if test="taskStatus != null">
  1407. and a.task_status= #{taskStatus,jdbcType=INTEGER}
  1408. </if>
  1409. <if test="adminName != null">
  1410. and d.name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
  1411. </if>
  1412. </select>
  1413. <!-- 根据订单编号获得所有的任务负责人 -->
  1414. <select id="getReceiverByOid" resultType="com.goafanti.order.bo.TOrderTaskBo">
  1415. select distinct task_receiver, a.name, a.email, t.id, t.project_status from t_order_task t
  1416. inner join admin a on t.task_receiver = a.id
  1417. where order_no = #{orderNo,jdbcType=VARCHAR} and task_status &gt; 0 and super_id is null
  1418. </select>
  1419. <update id="updateDimissionTransfer" parameterType="java.lang.String">
  1420. update t_order_task a left join t_change_task b on a.id =b.tid
  1421. left join (select * from admin where id= #{transferId,jdbcType=VARCHAR})c on 1=1
  1422. set a.task_allocator= #{aid,jdbcType=VARCHAR},a.task_receiver= c.id,
  1423. a.receiver_name=c.name,b.receiver_name=c.name
  1424. <if test="type==0">
  1425. ,a.consultant_id=c.id
  1426. </if>
  1427. <if test="type==1">
  1428. ,a.manager_id=c.id
  1429. </if>
  1430. <if test="type==3">
  1431. ,a.consultant_id= null
  1432. ,a.manager_id=c.id
  1433. </if>
  1434. <if test="type==4">
  1435. ,a.consultant_id=c.id
  1436. ,a.manager_id= null
  1437. </if>
  1438. <if test="type==1">
  1439. ,a.manager_id= null
  1440. </if>
  1441. where task_receiver=#{aid,jdbcType=VARCHAR}
  1442. </update>
  1443. <select id="selectEstimateCost" resultType="java.lang.String">
  1444. select ifnull(sum(a.commodity_quantity * ifnull(b.price,0)),0) from t_order_task a
  1445. left join business_project b on a.commodity_id=b.id
  1446. where order_no= #{orderNo}
  1447. </select>
  1448. <select id="listNameByDepAndName" resultType="java.lang.String">
  1449. select
  1450. <if test="type ==0">
  1451. consultant_id
  1452. </if>
  1453. <if test="type ==1">
  1454. manager_id
  1455. </if>
  1456. from t_order_task
  1457. where order_no= #{orderNo}
  1458. group by
  1459. <if test="type ==0">
  1460. consultant_id
  1461. </if>
  1462. <if test="type ==1">
  1463. manager_id
  1464. </if>
  1465. </select>
  1466. <select id="splitProjectList" resultType="com.goafanti.order.bo.TOrderTaskListBo">
  1467. 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,
  1468. e.contract_no contractNo,a.task_receiver taskReceiver, a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,
  1469. a.commodity_quantity as commodityQuantity,e.approval,l.refund_status outsourceStatus, ifnull(i.alreadyNumber,0) as alreadyNumber,a.task_comment taskComment ,
  1470. 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,
  1471. 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,
  1472. ttm.service_life serviceLife,ttm.service_year serviceYear ,ttm.year_sum yearSum ,ttm.contract_term contractTerm,a.process_status processStatus
  1473. 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
  1474. 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
  1475. left join department h on e.order_dep=h.id left join (select task_id , sum(already_number) as alreadyNumber
  1476. from task_progress group by task_id) i on a.id=i.task_id left join (select order_no,max(name)as name
  1477. 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
  1478. 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
  1479. where e.order_status in (0,1,2,3,4,5)
  1480. and split_status =2 and a.split_super= #{tid}
  1481. <if test="type == 1">
  1482. and a.process_status in(0,3)
  1483. </if>
  1484. order by split_id
  1485. </select>
  1486. <select id="selectByidGetCname" resultType="java.lang.String">
  1487. select b.cname from business_project a left join business_category b on a.cid =b.id
  1488. where a.id= #{pid}
  1489. </select>
  1490. <update id="updateByOutsourceToOrderNo">
  1491. update t_order_task set outsource= #{type} where order_no= #{orderNo}
  1492. </update>
  1493. <select id="getLockId" resultType="java.lang.String">
  1494. select id from user_lock_release a left join (select commodity_id from t_order_task
  1495. where order_no = #{orderNo} GROUP by commodity_id ) b on a.business_project_id =b.commodity_id
  1496. where a.`type` =1 and a.aid = #{aid} and a.uid = #{uid}
  1497. </select>
  1498. <select id="selectProjectStatisticsListByPage" resultType="com.goafanti.order.bo.OutProjectStatistics">
  1499. select date_format( a.task_distribution_time, '%Y-%m-%d %H:%i:%S' ) distributionTime ,d.name province , c.name depName,e.salesman_name salesmanName,
  1500. b.contract_no contractNo ,b.order_no orderNo ,e.buyer_name userName,bc.cname ,a.commodity_name pname,ta.name techName,td.name techDepName,
  1501. 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 ,
  1502. a.spot_check_status spotCheckStatus ,b.contact_mobile contactMobile ,b.legal_person_tel legalPersonTel , a.certificate_number certificateNumber,
  1503. a.declaration_batch declarationBatch, date_format(a.licence_time, '%Y-%m-%d' ) licenceTime, a.commodity_quantity commodityQuantity ,
  1504. ttm.certificates_count certificatesCount,ttm.urgent_day urgentDay ,ttm.if_material ifMaterial, ttm.cost_amount costAmount ,
  1505. (a.commodity_price-ttm.cost_amount)profit, a.high_tech_status highTechStatus, tp.patent_name patentName ,tp.patent_no patentNo ,
  1506. date_format(tp.accept_time, '%Y-%m-%d ' ) acceptTime , date_format(tp.authorize_time, '%Y-%m-%d ' ) authorizeTime, ttm.reject_count rejectCount ,
  1507. tm.service_life serviceLife,tm.service_year serviceyear, tm.year_sum yearsum,tm.contract_term contractTerm, a.commodity_price commodityPrice ,
  1508. a.special_comment specialComment,a.task_comment taskComment,ttm.last_year lastYear,ttm.last_year_capital lastYearCapital,ttm.last_year_income lastYearIncome,
  1509. e.service_type serviceType,e.service_project serviceProject, a.form_retrieve formRetrieve ,a.satisfaction_degree satisfactionDegree,
  1510. toa.type,toa.type_explain typeExplain
  1511. 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
  1512. 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
  1513. 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
  1514. 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
  1515. <if test="screen ==6">
  1516. right join (select tid ,accept_count sls from t_task_mid where accept_count &gt; 0)tj on a.id=tj.tid
  1517. </if>
  1518. <if test="screen ==7">
  1519. right join (select tid ,end_count wjs from t_task_mid where end_count &gt; 0)tj on a.id=tj.tid
  1520. </if>
  1521. <if test="screen ==8">
  1522. right join (select tid ,authorize_count sqs from t_task_mid where authorize_count &gt; 0)tj on a.id=tj.tid
  1523. </if>
  1524. <if test="screen ==9">
  1525. right join (select tid ,reject_count bhs from t_task_mid where reject_count &gt; 0)tj on a.id=tj.tid
  1526. </if>
  1527. <if test="screen ==10">
  1528. right join (select tid ,certificates_count xzs from t_task_mid where certificates_count &gt; 0)tj on a.id=tj.tid
  1529. </if>
  1530. <if test="screen ==11">
  1531. right join (select tid ,apply_count sqs,reject_count bhs,certificates_count xzs from t_task_mid
  1532. where apply_count &gt; 0)tj on a.id=tj.tid
  1533. </if>
  1534. <if test="type !=null">
  1535. inner join
  1536. </if>
  1537. <if test="type ==null">
  1538. left join
  1539. </if>
  1540. (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  1541. from t_order_approval
  1542. <if test="type !=null">
  1543. where `type` in
  1544. <foreach collection="type" item="item" separator="," open="(" close=")">
  1545. #{item}
  1546. </foreach>
  1547. </if>
  1548. group by order_no) toa on b.order_no=toa.order_no
  1549. where a.split_status in (0,2) and b. delete_sign in (0,2)
  1550. <!-- 筛选项 0库存 1派单 2完成 3立项 4抽查 5未通过 6受理 7完结 8授权 9驳回 10下证 11申请 -->
  1551. <if test="screen ==0">
  1552. and a.project_status in(0,1,2,3)
  1553. </if>
  1554. <if test="screen ==2">
  1555. and a.project_status &gt; 3
  1556. </if>
  1557. <if test="screen ==3">
  1558. and a.set_up_status =1
  1559. </if>
  1560. <if test="screen ==4">
  1561. and a.spot_check_status in (1,2)
  1562. </if>
  1563. <if test="screen ==5">
  1564. and a.spot_check_status =1
  1565. </if>
  1566. <if test="screen ==12">
  1567. and a.publicity_time is not null
  1568. </if>
  1569. <if test="startDate != null and endDate != null">
  1570. and a.task_distribution_time between #{startDate} and #{endDate}
  1571. </if>
  1572. <if test="province !=null">
  1573. and c.province = #{province}
  1574. </if>
  1575. <if test="projectId !=null">
  1576. and a.commodity_id = #{projectId}
  1577. </if>
  1578. <if test="sdStatus !=null">
  1579. <if test="sdStatus==0">
  1580. and a.form_retrieve=0
  1581. </if>
  1582. <if test="sdStatus==1">
  1583. and a.form_retrieve=1
  1584. </if>
  1585. <if test="sdStatus==2">
  1586. and a.form_retrieve=2
  1587. and a.satisfaction_degree=0
  1588. </if>
  1589. <if test="sdStatus==3">
  1590. and a.form_retrieve=2
  1591. and a.satisfaction_degree=1
  1592. </if>
  1593. <if test="sdStatus==4">
  1594. and a.form_retrieve=2
  1595. and a.satisfaction_degree=2
  1596. </if>
  1597. <if test="sdStatus==5">
  1598. and a.form_retrieve=2
  1599. and a.satisfaction_degree=3
  1600. </if>
  1601. </if>
  1602. <if test="deps != null">
  1603. and b.order_dep in
  1604. <foreach close=")" collection="deps" item="dep" open="(" separator=",">
  1605. #{dep}
  1606. </foreach>
  1607. </if>
  1608. <if test="thchDeps != null">
  1609. and td.id in
  1610. <foreach close=")" collection="thchDeps" item="thchDep" open="(" separator=",">
  1611. #{thchDep}
  1612. </foreach>
  1613. </if>
  1614. <if test="projectStatus !=null">
  1615. and bp.cid= #{projectStatus}
  1616. </if>
  1617. <if test="taskProjectStatus !=null">
  1618. and a.project_status= #{taskProjectStatus}
  1619. </if>
  1620. <if test="projectType !=null">
  1621. and bp.type= #{projectType}
  1622. </if>
  1623. <if test="orderNo !=null">
  1624. and b.order_no = #{orderNo}
  1625. </if>
  1626. <if test="contractNo !=null">
  1627. and b.contract_no = #{contractNo}
  1628. </if>
  1629. <if test="userName !=null">
  1630. and e.buyer_name like concat('%', #{userName},'%')
  1631. </if>
  1632. <if test="thchId !=null">
  1633. and a.task_receiver = #{thchId}
  1634. </if>
  1635. <if test="declarationBatch !=null">
  1636. and a.declaration_batch = #{declarationBatch}
  1637. </if>
  1638. <if test="projectSituation !=null">
  1639. and a.status = #{projectSituation}
  1640. </if>
  1641. <if test=" projectAmount !=null and projectAmount != 9">
  1642. and a.commodity_price &gt;= #{amountStart} and a.commodity_price &lt; #{amountEnd}
  1643. </if>
  1644. <if test=" projectAmount == 9">
  1645. and a.commodity_price &gt;= #{amountStart}
  1646. </if>
  1647. <if test="page_sql!=null">
  1648. ${page_sql}
  1649. </if>
  1650. </select>
  1651. <select id="selectProjectStatisticsCount" resultType="java.lang.Integer">
  1652. select count(*)
  1653. from t_order_task a left join t_order_new b on a.order_no =b.order_no
  1654. <if test="province !=null">
  1655. left join department c on b.order_dep =c.id
  1656. </if>
  1657. <if test="userName !=null">
  1658. left join t_order_mid e on b.order_no =e.order_no
  1659. </if>
  1660. <if test="projectStatus !=null or projectType !=null">
  1661. left join business_project bp on a.commodity_id =bp.id
  1662. </if>
  1663. <if test="thchDeps !=null">
  1664. left join admin ta on a.task_receiver =ta.id
  1665. left join department td on ta.department_id =td.id
  1666. </if>
  1667. <if test="status==3 or status==4">
  1668. left join task_progress tp on a.id=tp.task_id
  1669. </if>
  1670. <if test="screen ==6">
  1671. right join (select tid ,accept_count sls from t_task_mid where accept_count &gt; 0)tj on a.id=tj.tid
  1672. </if>
  1673. <if test="screen ==7">
  1674. right join (select tid ,end_count wjs from t_task_mid where end_count &gt; 0)tj on a.id=tj.tid
  1675. </if>
  1676. <if test="screen ==8">
  1677. right join (select tid ,authorize_count sqs from t_task_mid where authorize_count &gt; 0)tj on a.id=tj.tid
  1678. </if>
  1679. <if test="screen ==9">
  1680. right join (select tid ,reject_count bhs from t_task_mid where reject_count &gt; 0)tj on a.id=tj.tid
  1681. </if>
  1682. <if test="screen ==10">
  1683. right join (select tid ,certificates_count xzs from t_task_mid where certificates_count &gt; 0)tj on a.id=tj.tid
  1684. </if>
  1685. <if test="screen ==11">
  1686. right join (select tid ,apply_count sqs,reject_count bhs,certificates_count xzs from t_task_mid
  1687. where apply_count &gt; 0)tj on a.id=tj.tid
  1688. </if>
  1689. <if test="type !=null">
  1690. inner join
  1691. (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  1692. from t_order_approval
  1693. where `type` in
  1694. <foreach collection="type" item="item" separator="," open="(" close=")">
  1695. #{item}
  1696. </foreach>
  1697. group by order_no) toa on o.order_no=toa.order_no
  1698. </if>
  1699. where a.split_status in (0,2) and b. delete_sign in (0,2)
  1700. <!-- 筛选项 0库存 1派单 2完成 3立项 4抽查 5未通过 6受理 7完结 8授权 9驳回 10下证 11申请 -->
  1701. <if test="screen ==0">
  1702. and a.project_status in(0,1,2,3)
  1703. </if>
  1704. <if test="screen ==2">
  1705. and a.project_status &gt; 3
  1706. </if>
  1707. <if test="screen ==3">
  1708. and a.set_up_status =1
  1709. </if>
  1710. <if test="screen ==4">
  1711. and a.spot_check_status in (1,2)
  1712. </if>
  1713. <if test="screen ==5">
  1714. and a.spot_check_status =1
  1715. </if>
  1716. <if test="screen ==12">
  1717. and a.publicity_time is not null
  1718. </if>
  1719. <if test="startDate != null and endDate != null">
  1720. and a.task_distribution_time between #{startDate} and #{endDate}
  1721. </if>
  1722. <if test="province !=null">
  1723. and c.province = #{province}
  1724. </if>
  1725. <if test="projectId !=null">
  1726. and a.commodity_id = #{projectId}
  1727. </if>
  1728. <if test="deps != null">
  1729. and b.order_dep in
  1730. <foreach close=")" collection="deps" item="dep" open="(" separator=",">
  1731. #{dep}
  1732. </foreach>
  1733. </if>
  1734. <if test="thchDeps != null">
  1735. and td.id in
  1736. <foreach close=")" collection="thchDeps" item="thchDep" open="(" separator=",">
  1737. #{thchDep}
  1738. </foreach>
  1739. </if>
  1740. <if test="projectStatus !=null">
  1741. and bp.cid= #{projectStatus}
  1742. </if>
  1743. <if test="sdStatus !=null">
  1744. <if test="sdStatus==0">
  1745. and a.form_retrieve=0
  1746. </if>
  1747. <if test="sdStatus==1">
  1748. and a.form_retrieve=1
  1749. </if>
  1750. <if test="sdStatus==2">
  1751. and a.form_retrieve=2
  1752. and a.satisfaction_degree=0
  1753. </if>
  1754. <if test="sdStatus==3">
  1755. and a.form_retrieve=2
  1756. and a.satisfaction_degree=1
  1757. </if>
  1758. <if test="sdStatus==4">
  1759. and a.form_retrieve=2
  1760. and a.satisfaction_degree=2
  1761. </if>
  1762. <if test="sdStatus==5">
  1763. and a.form_retrieve=2
  1764. and a.satisfaction_degree=3
  1765. </if>
  1766. </if>
  1767. <if test="taskProjectStatus !=null">
  1768. and a.project_status= #{taskProjectStatus}
  1769. </if>
  1770. <if test="projectType !=null">
  1771. and bp.type= #{projectType}
  1772. </if>
  1773. <if test="orderNo !=null">
  1774. and b.order_no = #{orderNo}
  1775. </if>
  1776. <if test="contractNo !=null">
  1777. and b.contract_no = #{contractNo}
  1778. </if>
  1779. <if test="userName !=null">
  1780. and e.buyer_name like concat('%', #{userName},'%')
  1781. </if>
  1782. <if test="thchId !=null">
  1783. and a.task_receiver = #{thchId}
  1784. </if>
  1785. <if test="declarationBatch !=null">
  1786. and a.declaration_batch = #{declarationBatch}
  1787. </if>
  1788. <if test="projectSituation !=null">
  1789. and a.status = #{projectSituation}
  1790. </if>
  1791. <if test=" projectAmount !=null and projectAmount != 9">
  1792. and a.commodity_price &gt;= #{amountStart} and a.commodity_price &lt; #{amountEnd}
  1793. </if>
  1794. <if test=" projectAmount == 9">
  1795. and a.commodity_price &gt;= #{amountStart}
  1796. </if>
  1797. </select>
  1798. <select id="selectProvincialStatisticsListByPage" resultType="com.goafanti.order.bo.OutProvincialStatistics">
  1799. select z.cid bpId, bc.cname projectStatus,z.dispatch_province province,dg.name provinceName,
  1800. z.duty_dep thchDepId,d.name thchDepName,z.distributeCount,z.stockCount,z.completeCount,z.publicityCount,
  1801. z.setUpCount,z.spotCheckCount,z.failCount,z.certificatesCount,z.acceptCount,z.endCount,z.authorizeCount,
  1802. z.rejectCount,z.applyCount,z.amountCount,z.costAmount,z.profit
  1803. from ( select y.dispatch_province, y.cid, y.duty_dep, sum(y.dispatch_count)distributeCount,
  1804. sum(y.stock_count)stockCount, sum(y.complete_count)completeCount,sum(y.promulgate_count)publicityCount,
  1805. sum(y.set_up_count)setUpCount,sum(y.spot_check_count)spotCheckCount,sum(y.fail_count)failCount,
  1806. sum(y.certificates_count)certificatesCount,sum(y.accept_count)acceptCount,sum(y.end_count)endCount,
  1807. sum(y.authorize_count)authorizeCount,sum(y.reject_count)rejectCount, sum(y.apply_count)applyCount,
  1808. sum(y.commodity_price)amountCount,sum(y.cost_amount)costAmount, sum(y.commodity_price-y.cost_amount)profit
  1809. from(select b.dispatch_province, bp.cid, b.duty_dep,
  1810. b.stock_count,b.dispatch_count,b.promulgate_count, b.complete_count,b.set_up_count ,b.spot_check_count ,
  1811. b.fail_count ,b.certificates_count, b.accept_count,b.end_count,b.authorize_count,b.reject_count,b.apply_count,
  1812. a.commodity_price ,b.cost_amount, a.task_distribution_time from t_order_task a
  1813. left join t_task_mid b on a.id=b.tid left join business_project bp on a.commodity_id =bp.id
  1814. left join t_order_new ton on a.order_no =ton .order_no
  1815. where a.task_status in(1,2,3) and ton.delete_sign in (0,2)
  1816. <if test="projectId !=null">
  1817. and a.commodity_id = #{projectId}
  1818. </if>
  1819. <if test="province !=null">
  1820. and b.dispatch_province = #{province}
  1821. </if>
  1822. <if test="thchDeps !=null">
  1823. and b.duty_dep in
  1824. <foreach close=")" collection="thchDeps" item="depId" open="(" separator=",">
  1825. #{depId}
  1826. </foreach>
  1827. </if>
  1828. <if test="projectType !=null">
  1829. and bp.`type` = #{projectType}
  1830. </if>
  1831. <if test="projectStatus !=null">
  1832. and bp.cid= #{projectStatus}
  1833. </if>
  1834. <if test="startDate != null and endDate != null">
  1835. and a.task_distribution_time between #{startDate} and #{endDate}
  1836. </if>
  1837. )y
  1838. group by y.dispatch_province, y.cid, y.duty_dep )z
  1839. left join business_category bc on z.cid=bc.id left join district_glossory dg on z.dispatch_province=dg.id
  1840. left join department d on z.duty_dep=d.id
  1841. <if test="page_sql!=null">
  1842. ${page_sql}
  1843. </if>
  1844. </select>
  1845. <select id="selectProvincialStatisticsCount" resultType="java.lang.Integer">
  1846. select count(*)
  1847. from(select y.dispatch_province from (select bp.cid,
  1848. b.dispatch_province,b.duty_dep,a.cname,b.stock_count,b.dispatch_count,b.promulgate_count,
  1849. b.complete_count,b.set_up_count ,b.spot_check_count ,b.fail_count ,b.certificates_count,
  1850. b.accept_count,b.end_count,b.authorize_count,b.reject_count,b.apply_count,
  1851. a.commodity_price ,b.cost_amount, a.task_distribution_time
  1852. from t_order_task a
  1853. left join t_task_mid b on a.id=b.tid
  1854. left join business_project bp on a.commodity_id =bp.id
  1855. left join t_order_new ton on a.order_no =ton .order_no
  1856. where a.task_status in(1,2,3) and ton.delete_sign in (0,2)
  1857. <if test="projectId !=null">
  1858. and a.commodity_id = #{projectId}
  1859. </if>
  1860. <if test="province !=null">
  1861. and b.dispatch_province = #{province}
  1862. </if>
  1863. <if test="thchDeps !=null">
  1864. and b.duty_dep in
  1865. <foreach close=")" collection="thchDeps" item="depId" open="(" separator=",">
  1866. #{depId}
  1867. </foreach>
  1868. </if>
  1869. <if test="projectType !=null">
  1870. and bp.`type` = #{projectType}
  1871. </if>
  1872. <if test="projectStatus !=null">
  1873. and bp.cid= #{projectStatus}
  1874. </if>
  1875. <if test="startDate != null and endDate != null">
  1876. and a.task_distribution_time between #{startDate} and #{endDate}
  1877. </if>
  1878. )y group by y.dispatch_province, y.cid, y.duty_dep )x
  1879. </select>
  1880. <select id="managerSelectByPage" resultType="com.goafanti.order.bo.managerListBo">
  1881. select a.id,a.task_distribution_time taskDistributionTime ,tm.province_name provinceName,tm.dep_name depName,
  1882. tm.salesman_name salesmanName, b.contract_no contractNo ,b.order_no orderNo,tm.buyer_name UserName,a.cname ,
  1883. a.commodity_name commodityName,a.commodity_quantity commodityQuantity,dep.name techDepName,a.receiver_name techName,
  1884. a.project_status projectStatus ,a.commodity_price commodityPrice ,a.special_comment specialComment
  1885. from (select task_id from t_task_log a where task_receiver=#{aid}
  1886. UNION select task_id from t_task_log a where task_allocator=#{aid}) x
  1887. 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
  1888. left join t_order_mid tm on b.order_no=tm.order_no left join admin ad on a.task_receiver =ad.id
  1889. left join department dep on ad.department_id =dep.id left join business_project bp on a.commodity_id =bp.id
  1890. where 1=1
  1891. <if test="orderNo !=null">
  1892. and a.order_no = #{orderNo}
  1893. </if>
  1894. <if test="contractNo !=null">
  1895. and b.contract_no = #{contractNo}
  1896. </if>
  1897. <if test="name !=null">
  1898. and tm.buyer_name like CONCAT('%',#{name},'%')
  1899. </if>
  1900. <if test="thchId !=null">
  1901. and a.task_receiver = #{thchId}
  1902. </if>
  1903. <if test="cid !=null">
  1904. and bp.cid =#{cid}
  1905. </if>
  1906. <if test="projectType !=null">
  1907. and bp.`type` =#{projectType}
  1908. </if>
  1909. <if test="depId !=null">
  1910. and b.order_dep =#{depId}
  1911. </if>
  1912. <if test="techDepId !=null">
  1913. and ad.department_id =#{techDepId}
  1914. </if>
  1915. <if test="declarationBatch !=null">
  1916. and a.declaration_batch =#{declarationBatch}
  1917. </if>
  1918. <if test="commodityPrice !=null">
  1919. and a.commodity_price =#{commodityPrice}
  1920. </if>
  1921. <if test="startTime !=null and endTime !=null">
  1922. and a.task_distribution_time between #{startTime} and #{endTime}
  1923. </if>
  1924. <if test="page_sql!=null">
  1925. ${page_sql}
  1926. </if>
  1927. </select>
  1928. <select id="managerSelectCount" resultType="java.lang.Integer">
  1929. select count(*)
  1930. from (select task_id from t_task_log a where task_receiver= #{aid} UNION
  1931. select task_id from t_task_log a where task_allocator= #{aid}) x
  1932. 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
  1933. left join t_order_mid tm on b.order_no=tm.order_no left join admin ad on a.task_receiver =ad.id
  1934. left join department dep on ad.department_id =dep.id left join business_project bp on a.commodity_id =bp.id
  1935. where 1=1
  1936. <if test="orderNo !=null">
  1937. and a.order_no = #{orderNo}
  1938. </if>
  1939. <if test="contractNo !=null">
  1940. and b.contract_no = #{contractNo}
  1941. </if>
  1942. <if test="name !=null">
  1943. and tm.buyer_name like CONCAT('%',#{name},'%')
  1944. </if>
  1945. <if test="thchId !=null">
  1946. and a.task_receiver = #{thchId}
  1947. </if>
  1948. <if test="cid !=null">
  1949. and bp.cid =#{cid}
  1950. </if>
  1951. <if test="projectType !=null">
  1952. and bp.`type` =#{projectType}
  1953. </if>
  1954. <if test="depId !=null">
  1955. and b.order_dep =#{depId}
  1956. </if>
  1957. <if test="techDepId !=null">
  1958. and ad.department_id =#{techDepId}
  1959. </if>
  1960. <if test="declarationBatch !=null">
  1961. and a.declaration_batch =#{declarationBatch}
  1962. </if>
  1963. <if test="commodityPrice !=null">
  1964. and a.commodity_price =#{commodityPrice}
  1965. </if>
  1966. <if test="startTime !=null and endTime !=null">
  1967. and a.task_distribution_time between #{startTime} and #{endTime}
  1968. </if>
  1969. </select>
  1970. <resultMap id="userOrder" type="com.goafanti.common.bo.UserOrderTask">
  1971. <id column="orderNo" jdbcType="VARCHAR" property="orderNo" />
  1972. <collection ofType="com.goafanti.common.bo.UserTask" property="list">
  1973. <id column="id" jdbcType="VARCHAR" property="id" />
  1974. <result column="commodityName" jdbcType="VARCHAR" property="commodityName" />
  1975. </collection>
  1976. </resultMap>
  1977. <select id="selectUidByproject" resultMap="userOrder">
  1978. select a.order_no orderNo ,b.id,b.commodity_name commodityName from t_order_new a
  1979. left join t_order_task b on a.order_no =b.order_no
  1980. where a.buyer_id = #{uid}
  1981. </select>
  1982. <select id="selectProjectCheck" resultType="com.goafanti.order.bo.OutProjectCheck">
  1983. select a.id,a.commodity_name commodityName ,b.order_no orderNo,b.contract_no contractNo,a.commodity_quantity commodityQuantity,
  1984. c.buyer_name userName ,e.cname ,a.task_distribution_time taskDistributionTime,f.name depName ,a.check_status checkStatus ,
  1985. a.main ,a.commodity_price commodityPrice ,a.task_comment taskComment ,a.official_cost officialCost,a.cost_reduction costReduction,
  1986. a.patent_type patentType
  1987. from t_order_task a left join t_order_new b on a.order_no =b.order_no
  1988. left join t_order_mid c on a.order_no =c.order_no
  1989. left join business_project d on a.commodity_id =d.id
  1990. left join business_category e on d.cid =e.id
  1991. left join department f on b.order_dep =f.id
  1992. where check_status =1
  1993. <if test="aid !=null">
  1994. and b.salesman_id = #{aid}
  1995. </if>
  1996. <if test="name !=null">
  1997. and c.buyer_name like concat('%',#{name},'%')
  1998. </if>
  1999. <if test="orderNo !=null">
  2000. and a.order_no = #{orderNo}
  2001. </if>
  2002. <if test="contractNo !=null">
  2003. and b.contract_no = #{contractNo}
  2004. </if>
  2005. <if test="pname !=null">
  2006. and a.commodity_name like concat('%',#{pname},'%')
  2007. </if>
  2008. <if test="deps !=null">
  2009. and b.order_dep in
  2010. <foreach close=")" collection="deps" item="depId" open="(" separator=",">
  2011. #{depId}
  2012. </foreach>
  2013. </if>
  2014. <if test="page_sql!=null">
  2015. ${page_sql}
  2016. </if>
  2017. </select>
  2018. <select id="countProjectCheck" resultType="java.lang.Integer">
  2019. select count(*)
  2020. from t_order_task a left join t_order_new b on a.order_no =b.order_no
  2021. left join t_order_mid c on a.order_no =c.order_no
  2022. left join business_project d on a.commodity_id =d.id
  2023. left join business_category e on d.cid =e.id
  2024. left join department f on b.order_dep =f.id
  2025. where check_status =1
  2026. <if test="aid !=null">
  2027. and b.salesman_id = #{aid}
  2028. </if>
  2029. <if test="name !=null">
  2030. and c.buyer_name like concat('%',#{name},'%')
  2031. </if>
  2032. <if test="orderNo !=null">
  2033. and a.order_no = #{orderNo}
  2034. </if>
  2035. <if test="contractNo !=null">
  2036. and b.contract_no = #{contractNo}
  2037. </if>
  2038. <if test="pname !=null">
  2039. and a.commodity_name like concat('%',#{pname},'%')
  2040. </if>
  2041. <if test="deps !=null">
  2042. and b.order_dep in
  2043. <foreach close=")" collection="deps" item="depId" open="(" separator=",">
  2044. #{depId}
  2045. </foreach>
  2046. </if>
  2047. </select>
  2048. <update id="resstPayment">
  2049. update t_order_task a ,t_task_mid c
  2050. set c.party_amount =0,c.cost_amount =0
  2051. where a.id= #{id} and a.id=c.tid
  2052. </update>
  2053. <update id="updateAddCostAmount">
  2054. update t_task_mid
  2055. set cost_amount =cost_amount + #{cost}
  2056. where tid= #{tid}
  2057. </update>
  2058. <select id="selectAidByParam" resultType="com.goafanti.common.bo.OrderOperator">
  2059. select a.id tid,b.order_no orderNo ,b.salesman_id salesmanId,b.finance_id financeId ,a.task_receiver techId,
  2060. b.salesman_name salesmanName ,b.finance_name financeName ,d.name techName,b.buyer_name buyerName,a.commodity_name projectName
  2061. from t_order_task a left join t_order_mid b on a.order_no=b.order_no
  2062. left join admin d on a.task_receiver=d.id
  2063. where 1=1
  2064. <if test="tid !=null">
  2065. and a.id= #{tid}
  2066. </if>
  2067. </select>
  2068. <select id="selectByTidGetDtails" resultType="com.goafanti.organization.bo.ProjectTypePuls">
  2069. select a.id,a.order_no orderNo,a.official_cost officialCost,a.cost_reduction costReduction ,a.commodity_quantity quantity ,a.patent_type patentType,
  2070. b.patent_name_type projectType, c.amount officialAmount,c.proportion85,b.patent_type outPatentType,d.type
  2071. 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`
  2072. left join business_project d on a.commodity_id=d.id
  2073. where a.id= #{tid}
  2074. </select>
  2075. <select id="highNewRetrialStatistics" resultType="com.goafanti.order.bo.OutHighNewRetrialStatistics">
  2076. select t1. province,dg.name provinceName ,t1.quantity,t1.pass,t1.notPass,ifnull(t1.signBacks,0) signBacks
  2077. 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,
  2078. sum(ttm.high_new_retrial)signBacks
  2079. 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
  2080. left join t_order_new c on a.order_no =c.order_no left join admin d on c.salesman_id =d.id
  2081. 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)
  2082. <if test="depId!=null">
  2083. and e.id= #{depId}
  2084. </if>
  2085. <if test="startDate!=null and endDate!=null">
  2086. and c.sign_time between #{startDate} and #{endDate}
  2087. </if>
  2088. group by e.province )t1 left join district_glossory dg on t1.province=dg.id
  2089. </select>
  2090. <select id="getHighNewRetrial" resultType="java.lang.Integer">
  2091. select count(*) from t_order_new a left join t_order_new b on a.buyer_id =b.buyer_id
  2092. left join t_order_task c on b.order_no =c.order_no left join business_project d on c.commodity_id =d.id
  2093. where a.order_no =#{orderNo} and b.create_time &lt; a.create_time and d.`type` =5
  2094. </select>
  2095. <select id="highNewRetrialList" resultType="com.goafanti.order.bo.OutHighNewRetrialList">
  2096. select t1.province,dg.name provinceName,t1.salesman_id aid,t1.name name,t1.quantity,t1.pass,t1.notPass,t1.signBacks
  2097. from (SELECT e.province,c.salesman_id,d.name ,sum(1) quantity,sum(if(a.project_status=10,1,0))pass,
  2098. sum(if(a.project_status != 10,1,0))notPass, sum(ttm.high_new_retrial)signBacks
  2099. 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
  2100. left join t_order_new c on a.order_no =c.order_no left join admin d on c.salesman_id =d.id
  2101. 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)
  2102. <if test="province!=null">
  2103. and e.province= #{province}
  2104. </if>
  2105. <if test="depId!=null">
  2106. and e.id= #{depId}
  2107. </if>
  2108. <if test="startDate!=null and endDate!=null">
  2109. and c.sign_time between #{startDate} and #{endDate}
  2110. </if>
  2111. <if test="aid !=null">
  2112. and c.salesman_id = #{aid}
  2113. </if>
  2114. <if test="depId !=null">
  2115. and d.department_id = #{depId}
  2116. </if>
  2117. group by e.province ,c.salesman_id ,d.name )t1 left join district_glossory dg on t1.province=dg.id
  2118. order by
  2119. <if test="sort==0">
  2120. t1.pass
  2121. </if>
  2122. <if test="sort==1">
  2123. t1.notPass
  2124. </if>
  2125. desc
  2126. </select>
  2127. <select id="findMemberList" resultType="com.goafanti.order.bo.OutMemberList">
  2128. select a.id,b.contract_no contractNo,c.buyer_name userName,a.order_no orderNo,b.approval ,c.dep_name depName,
  2129. c.salesman_name salesmanName,c.finance_name financeName,a.commodity_name projectName,a.member_type memberType,
  2130. b.delete_sign deleteSign ,b.total_amount totalAmount ,b.sales_type salesType ,b.other,a.examine_type examineType,
  2131. a.process_status status,a.commodity_id commodityId,a.commodity_name commodityName,a.approval approvalType,
  2132. a.commodity_quantity commodityQuantity,a.task_comment taskComment,a.picture_url pictureUrl,
  2133. e.service_life serviceLife ,e.service_year serviceYear,e.year_sum yearSum,e.contract_term contractTerm
  2134. from t_order_task a left join t_order_new b on a.order_no =b.order_no
  2135. left join t_order_mid c on a.order_no =c.order_no
  2136. left join t_task_member e on a.id=e.tid
  2137. <if test="shiroType ==2 or shiroType ==3">
  2138. left join department d on b.order_dep =d.id
  2139. </if>
  2140. <if test="type !=null">
  2141. inner join
  2142. </if>
  2143. <if test="type ==null">
  2144. left join
  2145. </if>
  2146. (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  2147. from t_order_approval
  2148. <if test="type !=null">
  2149. where `type` in
  2150. <foreach collection="type" item="item" separator="," open="(" close=")">
  2151. #{item}
  2152. </foreach>
  2153. </if>
  2154. group by order_no) toa on b.order_no=toa.order_no
  2155. where b.delete_sign in (0,2)
  2156. and a.process_status in (1,2,3,4)
  2157. <if test="shiroType ==1">
  2158. and b.salesman_id = #{aid}
  2159. </if>
  2160. <if test="shiroType ==2">
  2161. and (d.finance_id = #{aid} or d.retrial_finance_id =#{aid})
  2162. </if>
  2163. <if test="shiroType ==3">
  2164. and d.approval_aid= #{aid}
  2165. </if>
  2166. <!-- <if test="approvalType !=null">-->
  2167. <!-- and a.approval= #{approvalType}-->
  2168. <!-- </if>-->
  2169. <if test="orderNo != null">
  2170. and a.order_no = #{orderNo}
  2171. </if>
  2172. <if test="userName != null">
  2173. and c.buyer_name like concat('%',#{userName},'%')
  2174. </if>
  2175. <if test="deps != null">
  2176. and b.order_dep in
  2177. <foreach close=")" collection="deps" item="dep" open="(" separator=",">
  2178. #{dep}
  2179. </foreach>
  2180. </if>
  2181. <if test="contractNo != null">
  2182. and b.contract_no =#{contractNo}
  2183. </if>
  2184. <if test="salesmanId != null">
  2185. and b.salesman_id =#{salesmanId}
  2186. </if>
  2187. <if test="projectName != null">
  2188. and a.commodity_name like concat('%',#{projectName},'%')
  2189. </if>
  2190. <if test="amountStatus == 0">
  2191. and b.total_amount &lt; 10
  2192. </if>
  2193. <if test="amountStatus == 1">
  2194. and b.total_amount between 10 and 20
  2195. </if>
  2196. <if test="amountStatus == 2">
  2197. and b.total_amount between 20 and 30
  2198. </if>
  2199. <if test="amountStatus == 3">
  2200. and b.total_amount between 30 and 40
  2201. </if>
  2202. <if test="amountStatus == 4">
  2203. and b.total_amount &gt; 40
  2204. </if>
  2205. <if test="approval != null and approval &lt; 3">
  2206. and b.approval = #{approval}
  2207. </if>
  2208. <if test="approval != null and approval ==4">
  2209. and b.approval in (1,2)
  2210. </if>
  2211. <if test="status != null and status !=5">
  2212. and a.process_status = #{status}
  2213. </if>
  2214. order by a.process_status
  2215. <if test="page_sql!=null">
  2216. ${page_sql}
  2217. </if>
  2218. </select>
  2219. <select id="findMemberCount" resultType="java.lang.Integer">
  2220. select count(*)
  2221. from t_order_task a left join t_order_new b on a.order_no =b.order_no
  2222. left join t_order_mid c on a.order_no =c.order_no
  2223. <if test="shiroType ==2 or shiroType ==3">
  2224. left join department d on b.order_dep =d.id
  2225. </if>
  2226. <if test="type !=null">
  2227. inner join
  2228. (select order_no ,GROUP_CONCAT(`type`)`type` ,GROUP_CONCAT(type_explain)type_explain
  2229. from t_order_approval
  2230. where `type` in
  2231. <foreach collection="type" item="item" separator="," open="(" close=")">
  2232. #{item}
  2233. </foreach>
  2234. group by order_no) toa on o.order_no=toa.order_no
  2235. </if>
  2236. where b.delete_sign in (0,2)
  2237. and a.process_status in (1,2,3,4)
  2238. <if test="shiroType ==1">
  2239. and b.salesman_id = #{aid}
  2240. </if>
  2241. <if test="shiroType ==2">
  2242. and (d.finance_id = #{aid} or d.retrial_finance_id =#{aid})
  2243. </if>
  2244. <if test="shiroType ==3">
  2245. and d.approval_aid= #{aid}
  2246. </if>
  2247. <!-- <if test="approvalType !=null">-->
  2248. <!-- and a.approval= #{approvalType}-->
  2249. <!-- </if>-->
  2250. <if test="orderNo != null">
  2251. and a.order_no = #{orderNo}
  2252. </if>
  2253. <if test="userName != null">
  2254. and c.buyer_name like concat('%',#{userName},'%')
  2255. </if>
  2256. <if test="deps != null">
  2257. and b.order_dep in
  2258. <foreach close=")" collection="deps" item="dep" open="(" separator=",">
  2259. #{dep}
  2260. </foreach>
  2261. </if>
  2262. <if test="contractNo != null">
  2263. and b.contract_no =#{contractNo}
  2264. </if>
  2265. <if test="salesmanId != null">
  2266. and b.salesman_id =#{salesmanId}
  2267. </if>
  2268. <if test="projectName != null">
  2269. and a.commodity_name like concat('%',#{projectName},'%')
  2270. </if>
  2271. <if test="amountStatus == 1">
  2272. and b.total_amount between 10 and 20
  2273. </if>
  2274. <if test="amountStatus == 2">
  2275. and b.total_amount between 20 and 30
  2276. </if>
  2277. <if test="amountStatus == 3">
  2278. and b.total_amount between 30 and 40
  2279. </if>
  2280. <if test="amountStatus == 4">
  2281. and b.total_amount &gt; 40
  2282. </if>
  2283. <if test="approval != null and approval &lt; 3">
  2284. and b.approval = #{approval}
  2285. </if>
  2286. <if test="approval != null and approval ==4">
  2287. and b.approval in (1,2)
  2288. </if>
  2289. <if test="status != null and status !=5">
  2290. and a.process_status = #{status}
  2291. </if>
  2292. </select>
  2293. <select id="selectByAid" resultType="com.goafanti.common.model.TChangeTask">
  2294. select b.id,b.cid from t_order_task a
  2295. left join t_change_task b on a.id=b.tid
  2296. left join new_order_change noc on b.cid =noc.id
  2297. where b.id is not null and noc.process_state &lt; 4 and noc.status in (0,1,2)
  2298. and a.task_receiver = #{aid}
  2299. </select>
  2300. <select id="getSplitCount" resultType="java.lang.Integer">
  2301. select count(*) from t_order_task
  2302. where split_super = #{tid}
  2303. </select>
  2304. <select id="selectProjectSotpList" resultType="com.goafanti.order.bo.OutselectProjectSotp">
  2305. 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,
  2306. c.order_no orderNo ,tom.buyer_name userName,b.cname ,b.commodity_name projectName,b.commodity_quantity commodityQuantity ,a.annex_url annexUrl,
  2307. tom.service_type serviceType , b.receiver_name receiverName ,b.status ,b.commodity_price commodityPrice ,a.reason,a.id,b.id tid,
  2308. ttm.stop_status projectStopStatus, ttm.stop_type projectStopType
  2309. from task_stop a left join t_order_task b on a.tid=b.id
  2310. left join t_order_new c on b.order_no =c.order_no
  2311. left join t_task_mid ttm on b.id=ttm.tid
  2312. left join t_order_mid tom on c.order_no =tom.order_no
  2313. left join department d on c.order_dep =d.id
  2314. left join district_glossory dg on d.province =dg.id
  2315. where 1=1
  2316. <if test="shiro ==1">
  2317. and c.salesman_id =#{aid}
  2318. </if>
  2319. <if test="shiro ==2">
  2320. and c.order_dep in
  2321. <foreach close=")" collection="deps" item="dep" open="(" separator=",">
  2322. #{dep}
  2323. </foreach>
  2324. </if>
  2325. <if test="orderNo !=null">
  2326. and b.order_no = #{orderNo}
  2327. </if>
  2328. <if test="userName !=null">
  2329. and tom.buyer_name like CONCAT('%',#{userName},'%')
  2330. </if>
  2331. <if test="depId !=null">
  2332. and c.order_dep = #{depId}
  2333. </if>
  2334. <if test="contractNo !=null">
  2335. and c.contract_no like CONCAT('%',#{contractNo},'%')
  2336. </if>
  2337. <if test="projectName !=null">
  2338. and b.commodity_name like CONCAT('%',#{projectName},'%')
  2339. </if>
  2340. <if test="status !=null">
  2341. <if test="status==0">
  2342. and a.`type` =0 and a.status =0
  2343. </if>
  2344. <if test="status==1">
  2345. and a.`type` =1 and a.status =0
  2346. </if>
  2347. <if test="status==2">
  2348. and a.`type` =0 and a.status =1
  2349. </if>
  2350. <if test="status==3">
  2351. and a.`type` =1 and a.status =1
  2352. </if>
  2353. <if test="status==4">
  2354. and a.`type` =0 and a.status =2
  2355. </if>
  2356. <if test="status==5">
  2357. and a.`type` =1 and a.status =2
  2358. </if>
  2359. </if>
  2360. <if test="receiverId !=null">
  2361. and b.task_receiver = #{receiverId}
  2362. </if>
  2363. <if test="startTime !=null and endTime !=null">
  2364. and a.create_time BETWEEN #{startTime} and #{endTime}
  2365. </if>
  2366. order by a.create_time desc
  2367. <if test="page_sql!=null">
  2368. ${page_sql}
  2369. </if>
  2370. </select>
  2371. <select id="selectProjectSotpCount" resultType="java.lang.Integer">
  2372. select count(*)
  2373. from task_stop a left join t_order_task b on a.tid=b.id
  2374. left join t_order_new c on b.order_no =c.order_no
  2375. left join t_order_mid tom on c.order_no =tom.order_no
  2376. where 1=1
  2377. <if test="shiro ==1">
  2378. and c.salesman_id =#{aid}
  2379. </if>
  2380. <if test="shiro ==2">
  2381. and c.order_dep in
  2382. <foreach close=")" collection="deps" item="dep" open="(" separator=",">
  2383. #{dep}
  2384. </foreach>
  2385. </if>
  2386. <if test="orderNo !=null">
  2387. and b.order_no = #{orderNo}
  2388. </if>
  2389. <if test="userName !=null">
  2390. and tom.buyer_name like CONCAT('%',#{userName},'%')
  2391. </if>
  2392. <if test="depId !=null">
  2393. and c.order_dep = #{depId}
  2394. </if>
  2395. <if test="contractNo !=null">
  2396. and c.contract_no like CONCAT('%',#{contractNo},'%')
  2397. </if>
  2398. <if test="projectName !=null">
  2399. and b.commodity_name like CONCAT('%',#{projectName},'%')
  2400. </if>
  2401. <if test="status !=null">
  2402. <if test="status==0">
  2403. and a.`type` =0 and a.status =0
  2404. </if>
  2405. <if test="status==1">
  2406. and a.`type` =1 and a.status =0
  2407. </if>
  2408. <if test="status==2">
  2409. and a.`type` =0 and a.status =1
  2410. </if>
  2411. <if test="status==3">
  2412. and a.`type` =1 and a.status =1
  2413. </if>
  2414. <if test="status==4">
  2415. and a.status=2
  2416. </if>
  2417. </if>
  2418. <if test="receiverId !=null">
  2419. and b.task_receiver = #{receiverId}
  2420. </if>
  2421. <if test="startTime !=null and endTime !=null">
  2422. and a.create_time BETWEEN #{startTime} and #{endTime}
  2423. </if>
  2424. </select>
  2425. <select id="selectOrderNoAllByaid" resultType="java.lang.String">
  2426. select order_no
  2427. from t_order_task
  2428. where task_receiver = #{aid} group by order_no
  2429. </select>
  2430. <delete id="deleteBySplitId" parameterType="java.lang.Integer">
  2431. delete from t_order_task
  2432. where split_super = #{id,jdbcType=INTEGER}
  2433. </delete>
  2434. <update id="updateDimissionTransferManager">
  2435. update t_order_task
  2436. set manager_id= #{transferId}
  2437. where manager_id = #{aid}
  2438. </update>
  2439. </mapper>