TOrderTaskMapper.xml 84 KB

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