TOrderTaskMapper.xml 99 KB

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