TOrderTaskMapper.xml 100 KB

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