TOrderTaskMapper.xml 111 KB

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