CommonMapper.xml 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148
  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.gree.mall.manager.commonmapper.CommonMapper">
  4. <select id="queryChargingStandrdList" resultType="com.gree.mall.manager.bean.charging.ChargingStandardBean">
  5. select
  6. a.* ,
  7. b.name as 'typeName',
  8. c.brand_name,
  9. (select name from goods_category where type=2 and category_id = a.one_category_id) as 'oneCategoryName',
  10. (select name from goods_category where type=2 and category_id = a.two_category_id) as 'twoCategoryName'
  11. from charging_standard a
  12. left join charging_standard_type b on a.charging_standard_type_id = b.id
  13. join brand c on c.id = a.brand_id
  14. where 1=1
  15. <if test="companyWechatId != null and companyWechatId !=''">
  16. and a.company_wechat_id=#{companyWechatId}
  17. </if>
  18. <if test="id != null and id !=''">
  19. and a.id = #{id}
  20. </if>
  21. <if test="type != null">
  22. and a.type = #{type}
  23. </if>
  24. <if test="status != null">
  25. and a.status=#{status}
  26. </if>
  27. <if test="brandId != null and brandId != ''">
  28. and a.brand_id=#{brandId}
  29. </if>
  30. <if test="oneCategoryId != null and oneCategoryId !=''">
  31. and a.one_category_id = #{oneCategoryId}
  32. </if>
  33. <if test="twoCategoryId != null and twoCategoryId !=''">
  34. and a.two_category_id = #{twoCategoryId}
  35. </if>
  36. <if test="content1 != null and content1 !=''">
  37. and a.content1 like concat('%',#{content1},'%')
  38. </if>
  39. order by a.create_time desc
  40. </select>
  41. <select id="chargingStandardTypeList" resultType="com.gree.mall.manager.bean.listvo.ChargingStandardTypeVO">
  42. select
  43. ${ex.selected}
  44. from charging_standard_type a
  45. ${ex.query}
  46. ORDER BY a.create_time DESC
  47. </select>
  48. <select id="chargingStandardList" resultType="com.gree.mall.manager.bean.listvo.ChargingStandardVO">
  49. select
  50. ${ex.selected},
  51. b.name 'chargingStandardTypeName',
  52. c.name 'oneCategoryName',
  53. d.name 'twoCategoryName'
  54. from charging_standard a
  55. join charging_standard_type b on a.charging_standard_type_id=b.id
  56. left join goods_category c on c.category_id = a.one_category_id
  57. left join goods_category d on d.category_id = a.two_category_id
  58. join brand e on e.id = a.brand_id
  59. ${ex.query}
  60. and a.type = 1
  61. ORDER BY a.create_time DESC
  62. </select>
  63. <select id="chargingStandardList2" resultType="com.gree.mall.manager.bean.listvo.ChargingStandard2VO">
  64. select
  65. ${ex.selected},
  66. c.name 'oneCategoryName',
  67. d.name 'twoCategoryName'
  68. from charging_standard a
  69. join brand b on b.id = a.brand_id
  70. left join goods_category c on c.category_id = a.one_category_id
  71. left join goods_category d on d.category_id = a.two_category_id
  72. ${ex.query}
  73. and a.type = 2
  74. ORDER BY a.create_time DESC
  75. </select>
  76. <select id="userList" resultType="com.gree.mall.manager.bean.listvo.UserVO">
  77. select
  78. ${ex.selected}
  79. <!--
  80. b.websit_id,
  81. c.name as 'websit_name',
  82. d.nick_name as 'slaveWorkerName'
  83. -->
  84. from user a
  85. <!--
  86. join websit_user b on a.user_id = b.user_id
  87. join admin_websit c on c.websit_id = b.websit_id
  88. left join user d on b.slave_worker_id = d.user_id
  89. -->
  90. ${ex.query}
  91. <!--
  92. <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
  93. AND c.websit_id IN
  94. <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
  95. #{item}
  96. </foreach>
  97. </if>
  98. -->
  99. <if test="isOK != null and isOK == true">
  100. AND a.worker_number IS NOT NULL
  101. </if>
  102. <if test="ex.isGroupByWorkerId != null and ex.isGroupByWorkerId == true">
  103. GROUP BY a.worker_number
  104. </if>
  105. ORDER BY <!-- FIELD(b.examine_status,'WAIT','OK','FAIL'), --> a.create_time DESC
  106. </select>
  107. <select id="userServiceList" resultType="com.gree.mall.manager.bean.listvo.User2VO">
  108. select
  109. ${ex.selected}
  110. from user a
  111. ${ex.query}
  112. ORDER BY FIELD(a.examine_status,'WAIT','OK','FAIL'),a.create_time DESC
  113. </select>
  114. <select id="userCustomerList" resultType="com.gree.mall.manager.bean.listvo.UserCustomerVO">
  115. select
  116. ${ex.selected},
  117. b.nick_name as 'serviceName',
  118. b.mobile as 'serviceMobile',
  119. c.nick_name as 'firstServiceName',
  120. c.mobile as 'firstServiceMobile'
  121. from user a
  122. left join user b on a.service_id = b.user_id
  123. left join user c on a.first_service_id = c.user_id
  124. ${ex.query}
  125. and a.type='GENERAL'
  126. ORDER BY a.create_time DESC
  127. </select>
  128. <select id="amityList" resultType="com.gree.mall.manager.bean.common.AmityUrlVO">
  129. select
  130. a.*
  131. from amity_url a
  132. ${ex.query}
  133. AND a.del = 0
  134. <if test="ex.orderBy == null or ex.orderBy ==''">
  135. order by a.create_time desc
  136. </if>
  137. ${ex.orderBy}
  138. </select>
  139. <select id="orderSmallTypeList" resultType="com.gree.mall.manager.bean.listvo.workorder.OrderSmallTypeVO">
  140. select
  141. ${ex.selected}
  142. from order_small_type a
  143. ${ex.query}
  144. order by a.id desc
  145. </select>
  146. <select id="orderBaseList" resultType="com.gree.mall.manager.bean.listvo.workorder.OrderBaseVO">
  147. select
  148. ${ex.selected}
  149. from pg_order_base a
  150. ${ex.query}
  151. <if test="ex.orderSmallType != null and ex.orderSmallType !=''">
  152. and a.order_small_type = #{ex.orderSmallType}
  153. </if>
  154. <if test="ex.orderStatus != null and ex.orderStatus.key !='YCD'.toString() and ex.orderStatus.key !='DYY'.toString() and ex.orderStatus.key !='PJSQZ'.toString() and ex.orderStatus.key !='PJYDH'.toString() and ex.orderStatus.key !='PJYQX'.toString()">
  155. and a.order_status = #{ex.orderStatus.key}
  156. </if>
  157. <if test="ex.orderStatus != null and ex.orderStatus.key =='YCD'.toString()">
  158. and a.is_exception =1
  159. </if>
  160. <if test="ex.orderStatus != null and ex.orderStatus.key =='DYY'.toString()">
  161. and a.appointment_time is null and a.order_status in('DYY','DSHPG','DWDPG','DJD')
  162. </if>
  163. <if test="ex.partsApplyStatus != null and ex.partsApplyStatus =='PJSQZ'.toString()">
  164. and a.id in(select order_base_id from websit_parts_apply where `status` = 'ING')
  165. </if>
  166. <if test="ex.partsApplyStatus != null and ex.partsApplyStatus =='PJYDH'.toString()">
  167. and a.id in(select order_base_id from websit_parts_apply where `status` = 'END')
  168. </if>
  169. <if test="ex.partsApplyStatus != null and ex.partsApplyStatus =='PJYQX'.toString()">
  170. and a.id in(select order_base_id from websit_parts_apply where `status` = 'CANCEL')
  171. </if>
  172. <if test="ex.isYb != null and ex.isYb == true">
  173. and a.pg_incre_item_id !=''
  174. </if>
  175. <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0 and adminUserType != null and adminUserType == 0">
  176. AND (
  177. a.websit_id IN
  178. <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
  179. #{item}
  180. </foreach>
  181. or
  182. a.create_websit_id IN
  183. <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
  184. #{item}
  185. </foreach>
  186. <if test="companyWechatId != null and companyWechatId != ''">
  187. or a.company_wechat_id = #{companyWechatId}
  188. </if>
  189. )
  190. </if>
  191. order by a.create_time desc,id desc
  192. </select>
  193. <select id="examineProjectConfigList"
  194. resultType="com.gree.mall.manager.bean.workorder.ExamineProjectConfigVO">
  195. SELECT
  196. ${ex.selected}
  197. FROM pg_examine_project_config a
  198. ${ex.query}
  199. AND a.del = 0
  200. <if test="ex.orderBy == null or ex.orderBy ==''">
  201. ORDER BY a.create_time DESC
  202. </if>
  203. </select>
  204. <select id="examineProjectList" resultType="com.gree.mall.manager.bean.workorder.ExamineProjectVO">
  205. SELECT
  206. ${ex.selected}
  207. FROM pg_examine_project a
  208. ${ex.query}
  209. <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0 and adminUserType != null and adminUserType == 0">
  210. AND
  211. a.websit_id IN
  212. <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
  213. #{item}
  214. </foreach>
  215. </if>
  216. <if test="ex.orderBy == null or ex.orderBy ==''">
  217. ORDER BY a.create_time DESC
  218. </if>
  219. </select>
  220. <select id="orderBaseAppraiseList" resultType="com.gree.mall.manager.bean.listvo.workorder.OrderBaseAppraiseVO">
  221. select
  222. ${ex.selected}
  223. from pg_order_base a
  224. ${ex.query}
  225. and a.appraise_status != 'N'
  226. <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
  227. AND (
  228. a.websit_id IN
  229. <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
  230. #{item}
  231. </foreach>
  232. )
  233. </if>
  234. order by a.id desc
  235. </select>
  236. <select id="installNormList" resultType="com.gree.mall.manager.bean.workorder.InstallSettleNormVO">
  237. SELECT
  238. ${ex.selected}
  239. FROM pg_settle_norm a
  240. ${ex.query}
  241. AND a.del = 0
  242. AND a.settle_norm_type = 'INSTALL'
  243. <if test="ex.orderBy == null or ex.orderBy ==''">
  244. ORDER BY a.type, a.parent_category_id, a.category_id
  245. </if>
  246. </select>
  247. <select id="repairNormList" resultType="com.gree.mall.manager.bean.workorder.RepairSettleNormVO">
  248. SELECT
  249. ${ex.selected}
  250. FROM pg_settle_norm a
  251. ${ex.query}
  252. AND a.del = 0
  253. AND a.settle_norm_type = 'REPAIR'
  254. <if test="ex.orderBy == null or ex.orderBy ==''">
  255. ORDER BY a.type, a.parent_category_id, a.category_id, a.label
  256. </if>
  257. </select>
  258. <select id="otherNormList" resultType="com.gree.mall.manager.bean.workorder.OtherSettleNormVO">
  259. SELECT
  260. ${ex.selected}
  261. FROM pg_settle_norm a
  262. ${ex.query}
  263. AND a.del = 0
  264. AND a.settle_norm_type = 'OTHER'
  265. <if test="ex.orderBy == null or ex.orderBy ==''">
  266. ORDER BY a.type, a.label
  267. </if>
  268. </select>
  269. <select id="settleOrderList" resultType="com.gree.mall.manager.bean.workorder.SettleOrderVO">
  270. SELECT
  271. ${ex.selected}
  272. FROM pg_settle_order a
  273. ${ex.query}
  274. <if test="websitIds != null and websitIds.size > 0">
  275. AND (
  276. a.websit_id IN
  277. <foreach item="item" index="index" collection="websitIds" open="(" separator="," close=")">
  278. #{item}
  279. </foreach>
  280. )
  281. </if>
  282. <if test="ex.orderBy == null or ex.orderBy ==''">
  283. ORDER BY a.create_time DESC
  284. </if>
  285. ${ex.orderBy}
  286. </select>
  287. <select id="settlePoolList" resultType="com.gree.mall.manager.bean.workorder.SettlePoolVO">
  288. SELECT
  289. ${ex.selected}
  290. FROM pg_settle_pool a
  291. ${ex.query}
  292. <if test="websitIds != null and websitIds.size > 0">
  293. AND (
  294. a.websit_id IN
  295. <foreach item="item" index="index" collection="websitIds" open="(" separator="," close=")">
  296. #{item}
  297. </foreach>
  298. )
  299. </if>
  300. <if test="ex.orderBy == null or ex.orderBy ==''">
  301. ORDER BY a.pool_create_time DESC
  302. </if>
  303. ${ex.orderBy}
  304. </select>
  305. <select id="poolDetailList" resultType="com.gree.mall.manager.bean.workorder.SettlePoolWorkerVO">
  306. SELECT
  307. a.*,
  308. b.id AS order_id,
  309. b.order_base_id,
  310. b.customer_name,
  311. b.customer_mobile,
  312. b.customer_address,
  313. b.order_status,
  314. b.order_create_time,
  315. b.worker_end_time,
  316. b.order_type,
  317. b.order_type_text,
  318. b.order_small_type,
  319. b.order_small_type_text,
  320. b.brand_id,
  321. b.brand,
  322. b.order_source,
  323. b.order_channel,
  324. b.parent_category_id,
  325. b.parent_category_name,
  326. b.category_id,
  327. b.category_name,
  328. b.goods_name,
  329. b.order_num,
  330. b.settle_order_type,
  331. b.install_id,
  332. b.install_label,
  333. b.install_norm_amount,
  334. b.repair_id,
  335. b.repair_label,
  336. b.repair_amount,
  337. b.repair_rate,
  338. b.repair_settle_amount,
  339. b.other_id,
  340. b.other_type,
  341. b.other_label,
  342. b.other_price,
  343. b.examine_project_id,
  344. b.examine_project,
  345. b.examine_type,
  346. b.settle_num,
  347. b.settle_amount
  348. FROM
  349. pg_settle_pool_worker a LEFT JOIN pg_settle_order b ON a.pool_id = b.pool_id AND a.worker_id = b.worker_id
  350. WHERE
  351. a.pool_id = #{id}
  352. <if test="workerName!=null and workerName!=''">
  353. AND a.worker_name LIKE CONCAT('%',#{workerName},'%')
  354. </if>
  355. <if test="mobile!=null and mobile!=''">
  356. AND a.worker_mobile LIKE CONCAT('%',#{mobile},'%')
  357. </if>
  358. <if test="idcard!=null and idcard!=''">
  359. AND a.worker_idcard LIKE CONCAT('%',#{idcard},'%')
  360. </if>
  361. <if test="orderBaseId!=null and orderBaseId!=''">
  362. AND b.order_base_id LIKE CONCAT('%',#{orderBaseId},'%')
  363. </if>
  364. <if test="customerName!=null and customerName!=''">
  365. AND b.customer_name LIKE CONCAT('%',#{customerName},'%')
  366. </if>
  367. <if test="customerMobile!=null and customerMobile!=''">
  368. AND b.customer_mobile LIKE CONCAT('%',#{customerMobile},'%')
  369. </if>
  370. <if test="orderSmallType!=null and orderSmallType!=''">
  371. AND b.order_small_type = #{orderSmallType}
  372. </if>
  373. <if test="settleOrderType!=null and settleOrderType!=''">
  374. AND b.settle_order_type = #{settleOrderType}
  375. </if>
  376. </select>
  377. <select id="userWaitList" resultType="com.gree.mall.manager.bean.listvo.workorder.UserWaitVO">
  378. SELECT
  379. ${ex.selected}
  380. FROM user_wait a
  381. ${ex.query}
  382. <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
  383. AND (
  384. a.websit_id IN
  385. <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
  386. #{item}
  387. </foreach>
  388. )
  389. </if>
  390. ${ex.orderBy}
  391. </select>
  392. <select id="increOrderSettleList" resultType="com.gree.mall.manager.bean.workorder.IncreOrderVO">
  393. SELECT
  394. ${ex.selected}
  395. FROM pg_incre_order a
  396. ${ex.query}
  397. <if test="isSettleList != null and isSettleList == true">
  398. AND a.settle_status IN ('OVER', 'EXCEPTION')
  399. </if>
  400. <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
  401. AND (
  402. a.websit_id IN
  403. <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
  404. #{item}
  405. </foreach>
  406. )
  407. </if>
  408. <if test="ex.orderBy == null or ex.orderBy ==''">
  409. ORDER BY a.create_time DESC
  410. </if>
  411. ${ex.orderBy}
  412. </select>
  413. <select id="websitOrderSettleCountList"
  414. resultType="com.gree.mall.manager.bean.workorder.WebsitOrderSettleCountVO">
  415. SELECT
  416. a.company_wechat_id,
  417. a.company_wechat_name,
  418. a.websit_id,
  419. a.websit_name,
  420. COUNT(a.id) AS order_num,
  421. SUM(a.amount) AS order_amount,
  422. SUM(a.websit_amount) AS websit_amount
  423. FROM pg_incre_order a
  424. ${ex.query}
  425. AND a.settle_status IN ('OVER', 'EXCEPTION')
  426. <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
  427. AND (
  428. a.websit_id IN
  429. <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
  430. #{item}
  431. </foreach>
  432. )
  433. </if>
  434. GROUP BY
  435. a.company_wechat_id, a.websit_id
  436. </select>
  437. <select id="orderBaseList2" resultType="com.gree.mall.manager.bean.listvo.workorder.OrderBase2VO">
  438. SELECT
  439. ${ex.selected}
  440. FROM pg_order_base a
  441. JOIN pg_order_product b ON a.id = b.order_base_id
  442. JOIN pg_order_settle_norm c ON b.id = c.pg_order_product_id AND c.settle_norm_type IN ('INSTALL','REPAIR')
  443. ${ex.query}
  444. <if test="ex.orderSmallType != null and ex.orderSmallType !=''">
  445. AND a.order_small_type = #{ex.orderSmallType}
  446. </if>
  447. <if test="ex.orderStatus != null and ex.orderStatus.key !='YCD'.toString() and ex.orderStatus.key !='DYY'.toString()">
  448. AND a.order_status = #{ex.orderStatus.key}
  449. </if>
  450. <if test="ex.orderStatus != null and ex.orderStatus.key =='YCD'.toString()">
  451. AND a.is_exception =1
  452. </if>
  453. <if test="ex.orderStatus != null and ex.orderStatus.key =='DYY'.toString()">
  454. AND a.appointment_time IS NULL
  455. </if>
  456. <if test="ex.isYb != null and ex.isYb == true">
  457. AND a.pg_incre_item_id !=''
  458. </if>
  459. <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0 and adminUserType != null and adminUserType == 0">
  460. AND (
  461. a.websit_id IN
  462. <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
  463. #{item}
  464. </foreach>
  465. OR
  466. a.create_websit_id IN
  467. <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
  468. #{item}
  469. </foreach>
  470. )
  471. </if>
  472. ORDER BY a.create_time DESC,id DESC
  473. </select>
  474. <select id="workerOrderSettleCountList"
  475. resultType="com.gree.mall.manager.bean.workorder.WorkerOrderSettleCountVO">
  476. SELECT
  477. a.company_wechat_id,
  478. a.company_wechat_name,
  479. a.worker_id,
  480. a.worker_name,
  481. a.worker_idcard,
  482. a.worker_mobile,
  483. COUNT(a.id) AS order_num,
  484. SUM(a.amount) AS order_amount,
  485. SUM(a.worker_amount) AS worker_amount
  486. FROM pg_incre_order a
  487. ${ex.query}
  488. AND a.settle_status IN ('OVER', 'EXCEPTION')
  489. AND a.worker_id <![CDATA[ <> ]]> ''
  490. <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
  491. AND (
  492. a.websit_id IN
  493. <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
  494. #{item}
  495. </foreach>
  496. )
  497. </if>
  498. GROUP BY
  499. a.company_wechat_id, a.worker_id
  500. </select>
  501. <select id="goodsMaterialList" resultType="com.gree.mall.manager.bean.goods.GoodsMaterialVO">
  502. SELECT
  503. ${ex.selected}
  504. FROM goods_material a
  505. ${ex.query}
  506. <if test="ex.orderBy == null or ex.orderBy ==''">
  507. ORDER BY a.create_time DESC
  508. </if>
  509. ${ex.orderBy}
  510. </select>
  511. <select id="goodsPurchaseList" resultType="com.gree.mall.manager.bean.goods.GoodsPurchaseVO">
  512. SELECT
  513. ${ex.selected}
  514. FROM goods_purchase a
  515. ${ex.query}
  516. <if test="ex.orderBy == null or ex.orderBy ==''">
  517. ORDER BY a.create_time DESC
  518. </if>
  519. ${ex.orderBy}
  520. </select>
  521. <select id="goodsPurchaseItemList" resultType="com.gree.mall.manager.bean.goods.GoodsPurchaseItemVO">
  522. SELECT
  523. ${ex.selected}
  524. FROM goods_purchase a JOIN goods_purchase_item b ON a.id = b.goods_purchase_id
  525. ${ex.query}
  526. <if test="ex.orderBy == null or ex.orderBy ==''">
  527. ORDER BY a.create_time DESC
  528. </if>
  529. ${ex.orderBy}
  530. </select>
  531. <select id="goodsPurchaseCodeList" resultType="com.gree.mall.manager.bean.goods.GoodsPurchaseCodeVO">
  532. SELECT
  533. ${ex.selected}
  534. FROM goods_purchase a
  535. JOIN goods_purchase_item b ON a.id = b.goods_purchase_id
  536. JOIN goods_purchase_code c ON b.id = c.goods_purchase_item_id
  537. ${ex.query}
  538. <if test="ex.orderBy == null or ex.orderBy ==''">
  539. ORDER BY a.create_time DESC, c.id DESC
  540. </if>
  541. ${ex.orderBy}
  542. </select>
  543. <select id="queryOrderInfoList" resultType="com.gree.mall.manager.bean.listvo.OrderInfoVO">
  544. SELECT
  545. ${ex.selected},
  546. if(a.order_status IN ('NOPAY','TIMEOUT'), '待支付', '已支付') 'payStatus'
  547. from order_info a
  548. join order_detail b on a.order_id = b.order_id
  549. ${ex.query}
  550. and a.sale_type = 2
  551. <if test="ex.orderBy == null or ex.orderBy ==''">
  552. ORDER BY a.create_time DESC
  553. </if>
  554. ${ex.orderBy}
  555. </select>
  556. <select id="goodsPurchaseRetList" resultType="com.gree.mall.manager.bean.goods.GoodsPurchaseRetVO">
  557. SELECT
  558. ${ex.selected}
  559. FROM goods_purchase_ret a
  560. ${ex.query}
  561. <if test="ex.orderBy == null or ex.orderBy ==''">
  562. ORDER BY a.create_time DESC
  563. </if>
  564. ${ex.orderBy}
  565. </select>
  566. <select id="goodsPurchaseRetItemList" resultType="com.gree.mall.manager.bean.goods.GoodsPurchaseRetItemVO">
  567. SELECT
  568. ${ex.selected}
  569. FROM goods_purchase_ret a JOIN goods_purchase_ret_item b ON a.id = b.goods_purchase_ret_id
  570. ${ex.query}
  571. <if test="ex.orderBy == null or ex.orderBy ==''">
  572. ORDER BY a.create_time DESC
  573. </if>
  574. ${ex.orderBy}
  575. </select>
  576. <select id="goodsPurchaseRetCodeList" resultType="com.gree.mall.manager.bean.goods.GoodsPurchaseRetCodeVO">
  577. SELECT
  578. ${ex.selected}
  579. FROM goods_purchase_ret a
  580. JOIN goods_purchase_ret_item b ON a.id = b.goods_purchase_ret_id
  581. JOIN goods_purchase_ret_code c ON b.id = c.goods_purchase_ret_item_id
  582. ${ex.query}
  583. <if test="ex.orderBy == null or ex.orderBy ==''">
  584. ORDER BY a.create_time DESC, c.id DESC
  585. </if>
  586. ${ex.orderBy}
  587. </select>
  588. <select id="goodsMaterialStockAccList" resultType="com.gree.mall.manager.bean.listvo.goods.GoodsMaterialStockAccVO">
  589. SELECT
  590. ${ex.selected}
  591. FROM goods_material_stock_acc a
  592. ${ex.query}
  593. <if test="ex.orderBy == null or ex.orderBy ==''">
  594. ORDER BY a.create_time DESC
  595. </if>
  596. ${ex.orderBy}
  597. </select>
  598. <select id="punishOrderList" resultType="com.gree.mall.manager.bean.listvo.order.PunishOrderVO">
  599. SELECT
  600. ${ex.selected}
  601. FROM punish_order a
  602. join punish_order_worker b on a.id = b.punish_order_id
  603. join punish_order_product c on a.id = c.punish_order_id
  604. ${ex.query}
  605. <if test="ex.examineStatus != null">
  606. and a.status = #{ex.examineStatus.key}
  607. </if>
  608. <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
  609. AND a.websit_id IN
  610. <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
  611. #{item}
  612. </foreach>
  613. </if>
  614. <if test="ex.orderBy == null or ex.orderBy ==''">
  615. ORDER BY a.create_time DESC
  616. </if>
  617. ${ex.orderBy}
  618. </select>
  619. <select id="orderOfflineRefundList" resultType="com.gree.mall.manager.bean.order.refund.OrderOfflineRefundVO">
  620. SELECT
  621. ${ex.selected}
  622. from order_offline_refund a
  623. join order_info b on a.order_id = b.order_id
  624. ${ex.query}
  625. ORDER BY a.create_time DESC
  626. </select>
  627. <select id="workerSettleExpenseGatherList" resultType="com.gree.mall.manager.bean.settle.SettleExpenseVO">
  628. SELECT
  629. ${ex.selected}
  630. FROM settle_expense a
  631. ${ex.query}
  632. <if test="ex.orderBy == null or ex.orderBy ==''">
  633. ORDER BY a.create_time DESC
  634. </if>
  635. ${ex.orderBy}
  636. </select>
  637. <select id="workerSettleExpenseList" resultType="com.gree.mall.manager.bean.settle.SettleExpenseItemVO">
  638. SELECT
  639. ${ex.selected}
  640. FROM settle_expense_item a JOIN settle_expense b ON a.settle_expense_id = b.id
  641. ${ex.query}
  642. <if test="workerId != null">
  643. AND (a.worker_name1 = #{workerId} OR a.worker_name2 = #{workerId})
  644. </if>
  645. <if test="ex.orderBy == null or ex.orderBy ==''">
  646. ORDER BY a.create_time DESC
  647. </if>
  648. ${ex.orderBy}
  649. </select>
  650. <select id="settleMonthWagesGatherList" resultType="com.gree.mall.manager.bean.settle.SettleMonthWagesVO">
  651. SELECT
  652. ${ex.selected}
  653. FROM settle_month_wages a
  654. ${ex.query}
  655. <if test="ex.orderBy == null or ex.orderBy ==''">
  656. ORDER BY a.create_time DESC
  657. </if>
  658. ${ex.orderBy}
  659. </select>
  660. <select id="settleMonthWagesList" resultType="com.gree.mall.manager.bean.settle.SettleMonthWagesWorkerVO">
  661. SELECT
  662. ${ex.selected}
  663. FROM settle_month_wages_worker a LEFT JOIN settle_month_wages_detail b ON a.settle_month_wages_detail_id = b.id
  664. ${ex.query}
  665. <if test="ex.orderBy == null or ex.orderBy ==''">
  666. ORDER BY a.worker_id DESC
  667. </if>
  668. ${ex.orderBy}
  669. </select>
  670. <select id="goodsLeaseList" resultType="com.gree.mall.manager.bean.goods.GoodsLeaseBean">
  671. SELECT
  672. a.*
  673. FROM goods_lease a
  674. WHERE
  675. a.del = 0
  676. <if test='companyWechatIds != null and companyWechatIds.size > 0' >
  677. AND a.company_wechat_id in
  678. <foreach collection="companyWechatIds" open="(" close=")" item="companyWechatId" separator=",">
  679. #{companyWechatId}
  680. </foreach>
  681. </if>
  682. <if test="keyword != null and keyword != ''">
  683. AND
  684. (a.id LIKE CONCAT('%', #{keyword},'%') OR a.name LIKE CONCAT('%',#{keyword},'%') OR a.category_name
  685. LIKE CONCAT('%',#{keyword},'%'))
  686. </if>
  687. <if test="startPrice != null and endPrice != null">
  688. AND
  689. a.lease_price BETWEEN #{startPrice} AND #{endPrice}
  690. </if>
  691. <if test="startDeposit != null and endDeposit != null">
  692. AND
  693. a.deposit_price BETWEEN #{startDeposit} AND #{endDeposit}
  694. </if>
  695. <if test="categoryIds != null and categoryIds.size() != 0">
  696. AND
  697. a.category_id IN
  698. <foreach item="item" index="index" collection="categoryIds" open="(" separator="," close=")">
  699. #{item}
  700. </foreach>
  701. </if>
  702. <if test="status != null">
  703. AND
  704. a.status = #{status}
  705. </if>
  706. <choose>
  707. <when test="sortStr == null">
  708. ORDER BY a.sort DESC,a.create_time DESC
  709. </when>
  710. <otherwise>
  711. ORDER BY a.sort DESC,${sortStr},a.create_time DESC
  712. </otherwise>
  713. </choose>
  714. </select>
  715. <select id="leaseOrderList" resultType="com.gree.mall.manager.bean.order.LeaseOrderVO">
  716. SELECT
  717. a.*,
  718. b.category_id,
  719. b.category_name,
  720. b.category_url,
  721. b.goods_lease_id,
  722. b.goods_lease_name,
  723. b.goods_unit,
  724. b.qty,
  725. b.deposit_price,
  726. b.lease_price,
  727. b.start_date,
  728. b.end_date,
  729. b.real_end_date
  730. FROM
  731. lease_order a LEFT JOIN lease_order_item b ON a.id = b.lease_order_id
  732. WHERE
  733. a.pay_status = 1
  734. <if test='companyWechatIds != null and companyWechatIds.size > 0' >
  735. AND a.company_wechat_id in
  736. <foreach collection="companyWechatIds" open="(" close=")" item="companyWechatId" separator=",">
  737. #{companyWechatId}
  738. </foreach>
  739. </if>
  740. <if test="orderId != null and orderId != ''">
  741. AND a.id LIKE CONCAT('%', #{orderId},'%')
  742. </if>
  743. <if test="goodsName != null and goodsName != ''">
  744. AND b.goods_lease_name LIKE CONCAT('%', #{goodsName},'%')
  745. </if>
  746. <if test="userName != null and userName != ''">
  747. AND a.user_name LIKE CONCAT('%', #{userName},'%')
  748. </if>
  749. <if test="userMobile != null and userMobile != ''">
  750. AND a.user_mobile LIKE CONCAT('%', #{userMobile},'%')
  751. </if>
  752. <if test="status != null and status != ''">
  753. AND a.status = #{status}
  754. </if>
  755. <if test="startDate != null and endDate != null">
  756. AND
  757. a.create_time BETWEEN #{startDate} AND #{endDate}
  758. </if>
  759. <if test="startPayDate != null and endPayDate != null">
  760. AND
  761. a.pay_time BETWEEN #{startPayDate} AND #{endPayDate}
  762. </if>
  763. ORDER BY a.create_time DESC
  764. </select>
  765. <select id="goodsLibraryList" resultType="com.gree.mall.manager.bean.listvo.goods.GoodsLibraryVO">
  766. SELECT
  767. ${ex.selected}
  768. FROM goods_library a
  769. join goods_library_spec b on a.goods_library_id = b.goods_library_id
  770. ${ex.query}
  771. group by a.goods_library_id
  772. ORDER BY a.update_time DESC
  773. </select>
  774. <select id="repairSettleBankAccountList"
  775. resultType="com.gree.mall.manager.bean.settle.repair.DailyBankAccountVO">
  776. SELECT
  777. ${ex.selected}
  778. FROM
  779. settle_daily_bank_account a
  780. ${ex.query}
  781. <if test="ex.orderBy == null or ex.orderBy ==''">
  782. ORDER BY a.create_time DESC
  783. </if>
  784. ${ex.orderBy}
  785. </select>
  786. <select id="repairSettleDailyWithholdList"
  787. resultType="com.gree.mall.manager.bean.settle.repair.DailyWithholdVO">
  788. SELECT
  789. ${ex.selected}
  790. FROM
  791. settle_daily_withhold a
  792. ${ex.query}
  793. <if test="ex.orderBy == null or ex.orderBy ==''">
  794. ORDER BY a.create_time DESC
  795. </if>
  796. ${ex.orderBy}
  797. </select>
  798. <select id="repairSettleDailyImportSummaryList"
  799. resultType="com.gree.mall.manager.bean.settle.repair.DailyImportSummaryVO">
  800. SELECT
  801. a.company_wechat_id,
  802. a.company_wechat_name,
  803. a.import_batch_no,
  804. COUNT(DISTINCT a.repair_worker_mobile) AS personNums,
  805. COUNT(1) AS 'orderNums',
  806. SUM(a.total_fee) AS 'totalAmount',
  807. IF(find_in_set('1', group_concat(DISTINCT a.summary_status)) > 0 , 1, 2) AS 'summaryStatus',
  808. import_by ,
  809. import_time ,
  810. group_concat(DISTINCT summary_by) AS 'summaryBy',
  811. summary_time AS 'summaryTime',
  812. group_concat(DISTINCT summary_batch_no) AS 'summaryBatchNo' ,
  813. group_concat(DISTINCT month) AS 'month'
  814. FROM
  815. settle_daily_import_summary_item a
  816. ${ex.query}
  817. GROUP BY
  818. a.company_wechat_id, a.import_batch_no
  819. <if test="ex.orderBy == null or ex.orderBy ==''">
  820. ORDER BY a.create_time DESC
  821. </if>
  822. ${ex.orderBy}
  823. </select>
  824. <select id="repairDetailList"
  825. resultType="com.gree.mall.manager.bean.settle.repair.DailyImportSummaryItemVO">
  826. SELECT
  827. ${ex.selected}
  828. FROM
  829. settle_daily_import_summary_item a
  830. ${ex.query}
  831. <if test="ex.orderBy == null or ex.orderBy ==''">
  832. ORDER BY a.create_time DESC
  833. </if>
  834. ${ex.orderBy}
  835. </select>
  836. <select id="reduceCountList"
  837. resultType="com.gree.mall.manager.bean.settle.repair.DailyIncrDecrCostCountVO">
  838. SELECT
  839. company_wechat_id,
  840. company_wechat_name,
  841. import_batch_no,
  842. count(service_number) personNums,
  843. count(id) orderNums,
  844. sum(cost_amount) totalAmount,
  845. do_status,
  846. import_by,
  847. import_time,
  848. do_by,
  849. do_time,
  850. do_batch_no
  851. FROM
  852. settle_daily_incr_decr_cost a
  853. ${ex.query}
  854. GROUP BY a.company_wechat_id, a.import_batch_no
  855. <if test="ex.orderBy == null or ex.orderBy ==''">
  856. ORDER BY a.create_time DESC
  857. </if>
  858. ${ex.orderBy}
  859. </select>
  860. <select id="repairSettleDailyincrDecrCostList"
  861. resultType="com.gree.mall.manager.bean.settle.repair.DailyIncrDecrCostVO">
  862. SELECT
  863. ${ex.selected}
  864. FROM
  865. settle_daily_incr_decr_cost a
  866. ${ex.query}
  867. <if test="ex.orderBy == null or ex.orderBy ==''">
  868. ORDER BY a.create_time DESC
  869. </if>
  870. ${ex.orderBy}
  871. </select>
  872. <select id="reduceTotalList" resultType="com.gree.mall.manager.bean.settle.repair.DailyReduceCostGatherVO">
  873. SELECT
  874. company_wechat_id,
  875. company_wechat_name,
  876. COUNT(DISTINCT repair_worker_mobile) AS 'personNums',
  877. COUNT(1) AS 'orderNums',
  878. SUM(total_fee) AS 'totalAmount',
  879. import_by ,
  880. import_time ,
  881. import_batch_no,
  882. do_status,
  883. do_by ,
  884. do_time ,
  885. do_batch_no
  886. FROM
  887. settle_daily_reduce_cost a
  888. ${ex.query}
  889. GROUP BY a.company_wechat_id, a.import_batch_no
  890. <if test="ex.orderBy == null or ex.orderBy ==''">
  891. ORDER BY a.create_time DESC
  892. </if>
  893. ${ex.orderBy}
  894. </select>
  895. <select id="reduceList" resultType="com.gree.mall.manager.bean.settle.repair.DailyReduceCostVO">
  896. SELECT
  897. ${ex.selected}
  898. FROM
  899. settle_daily_reduce_cost a
  900. ${ex.query}
  901. <if test="ex.orderBy == null or ex.orderBy ==''">
  902. ORDER BY a.create_time DESC
  903. </if>
  904. ${ex.orderBy}
  905. </select>
  906. <select id="buckleList" resultType="com.gree.mall.manager.bean.settle.repair.WorkerWaitBuckleVO">
  907. SELECT
  908. ${ex.selected}
  909. FROM
  910. settle_daily_remaine_buckle a
  911. JOIN user aa on a.worker_number = aa.worker_number
  912. JOIN settle_daily_bank_account b ON aa.id_card = b.idcard
  913. ${ex.query}
  914. GROUP BY a.company_wechat_id, a.idcard
  915. <if test="ex.orderBy == null or ex.orderBy ==''">
  916. ORDER BY a.create_time DESC
  917. </if>
  918. ${ex.orderBy}
  919. </select>
  920. <select id="transferList"
  921. resultType="com.gree.mall.manager.bean.settle.repair.SettleDailyBankTransferRecordVO">
  922. SELECT
  923. ${ex.selected}
  924. FROM
  925. settle_daily_bank_transfer_record a
  926. ${ex.query}
  927. <if test="companyWechatIds != null and companyWechatIds.size > 0">
  928. AND a.company_wechat_id IN
  929. <foreach item="item" index="index" collection="companyWechatIds" open="(" separator="," close=")">
  930. #{item}
  931. </foreach>
  932. </if>
  933. <if test="ex.orderBy == null or ex.orderBy ==''">
  934. ORDER BY a.create_time DESC
  935. </if>
  936. ${ex.orderBy}
  937. </select>
  938. <select id="repairAllList" resultType="com.gree.mall.manager.bean.settle.repair.AllDailyImportSummaryItemVO">
  939. SELECT
  940. ${ex.selected}
  941. FROM
  942. settle_daily_import_summary_item a
  943. LEFT JOIN settle_daily_reduce_cost sdrc on a.dispatch_order_no = sdrc.dispatch_order_no
  944. LEFT JOIN user aa on a.worker_number = aa.worker_number
  945. LEFT JOIN settle_daily_bank_account b ON aa.id_card = b.idcard
  946. LEFT JOIN settle_daily_issue_summary_record c ON c.id = a.issue_salary_id
  947. ${ex.query}
  948. <if test="companyWechatIds != null and companyWechatIds.size > 0">
  949. AND a.company_wechat_id IN
  950. <foreach item="item" index="index" collection="companyWechatIds" open="(" separator="," close=")">
  951. #{item}
  952. </foreach>
  953. </if>
  954. <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
  955. AND a.websit_number IN
  956. <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
  957. #{item}
  958. </foreach>
  959. </if>
  960. GROUP BY a.id
  961. <if test="ex.orderBy == null or ex.orderBy ==''">
  962. ORDER BY a.create_time, a.id DESC
  963. </if>
  964. ${ex.orderBy}
  965. </select>
  966. <select id="repairAllCount" resultType="java.lang.Integer">
  967. SELECT
  968. COUNT(1)
  969. FROM
  970. settle_daily_import_summary_item a JOIN settle_daily_issue_summary_record c ON c.id = a.issue_salary_id
  971. <if test="companyWechatIds != null and companyWechatIds.size > 0">
  972. AND a.company_wechat_id IN
  973. <foreach item="item" index="index" collection="companyWechatIds" open="(" separator="," close=")">
  974. #{item}
  975. </foreach>
  976. </if>
  977. <if test="adminWebsitIds != null and adminWebsitIds.size > 0">
  978. AND a.websit_number IN
  979. <foreach item="item" index="index" collection="adminWebsitIds" open="(" separator="," close=")">
  980. #{item}
  981. </foreach>
  982. </if>
  983. WHERE
  984. c.status = #{status}
  985. </select>
  986. <select id="companyDelivery" resultType="com.gree.mall.manager.bean.member.UserCompanyDeliveryVO">
  987. SELECT
  988. ${ex.selected}
  989. FROM
  990. user_company_delivery a JOIN user b ON a.user_id = b.user_id
  991. LEFT JOIN user_company_delivery_rela c ON b.user_id = c.user_id AND a.company_wechat_id = c.company_wechat_id
  992. LEFT JOIN admin_company_wechat d ON a.company_wechat_id = d.company_wechat_id
  993. LEFT JOIN storage e ON a.company_wechat_id = e.company_wechat_id AND c.storage_id = e.storage_id
  994. ${ex.query}
  995. AND b.type = 'WORKER'
  996. <if test="ex.orderBy == null or ex.orderBy ==''">
  997. ORDER BY b.create_time DESC
  998. </if>
  999. ${ex.orderBy}
  1000. </select>
  1001. <select id="companyCredit" resultType="com.gree.mall.manager.bean.member.UserCompanyCreditBean">
  1002. SELECT
  1003. uca.*,
  1004. a.nick_name,
  1005. a.mobile
  1006. FROM
  1007. user a JOIN user_company_credit uca ON a.user_id = uca.user_id
  1008. WHERE
  1009. a.type = 'WORKER'
  1010. AND uca.company_wechat_id = #{companyWechatId}
  1011. <if test="nickName != null and nickName != ''">
  1012. AND a.nick_name LIKE CONCAT('%', #{nickName},'%')
  1013. </if>
  1014. <if test="mobile != null and mobile != ''">
  1015. AND a.mobile LIKE CONCAT('%', #{mobile},'%')
  1016. </if>
  1017. </select>
  1018. <select id="adminCompanyPayConfigList"
  1019. resultType="com.gree.mall.manager.bean.admin.AdminCompanyPayConfigVO">
  1020. SELECT
  1021. ${ex.selected}
  1022. FROM
  1023. admin_company_wechat_pay_config a
  1024. ${ex.query}
  1025. AND a.del = 0
  1026. <if test="ex.orderBy == null or ex.orderBy ==''">
  1027. ORDER BY a.create_time DESC
  1028. </if>
  1029. ${ex.orderBy}
  1030. </select>
  1031. <select id="orderPickTimeConfigList2" resultType="com.gree.mall.manager.bean.order.OrderPickTimeConfigVO">
  1032. SELECT
  1033. ${ex.selected},
  1034. b.storage_name
  1035. FROM order_pick_time_config a LEFT JOIN storage b ON a.storage_id = b.storage_id
  1036. ${ex.query}
  1037. <if test="ex.orderBy == null or ex.orderBy ==''">
  1038. ORDER BY a.id DESC
  1039. </if>
  1040. ${ex.orderBy}
  1041. </select>
  1042. <select id="userCompanyCreditBillPage"
  1043. resultType="com.gree.mall.manager.bean.user.UserCompanyCreditBillVO">
  1044. SELECT
  1045. ${ex.selected},
  1046. b.nick_name
  1047. FROM user_company_credit_bill a LEFT JOIN user b ON a.user_id = b.user_id
  1048. ${ex.query}
  1049. <if test="ex.orderBy == null or ex.orderBy ==''">
  1050. ORDER BY a.bill_id DESC
  1051. </if>
  1052. ${ex.orderBy}
  1053. </select>
  1054. <select id="userCompanyCreditBillItemPage"
  1055. resultType="com.gree.mall.manager.bean.user.UserCompanyCreditBillItemVO">
  1056. SELECT
  1057. ${ex.selected},
  1058. b.nick_name
  1059. FROM user_company_credit_bill_item a LEFT JOIN user b ON a.user_id = b.user_id
  1060. ${ex.query}
  1061. <if test="ex.orderBy == null or ex.orderBy ==''">
  1062. ORDER BY a.id DESC
  1063. </if>
  1064. ${ex.orderBy}
  1065. </select>
  1066. <select id="goodsPriceChangePage" resultType="com.gree.mall.manager.bean.goods.GoodsPriceChangeVO">
  1067. SELECT
  1068. ${ex.selected}
  1069. FROM goods_price_change a LEFT JOIN goods b ON a.goods_id = b.goods_id
  1070. LEFT JOIN goods_spec c ON a.goods_spec_id = c.goods_spec_id
  1071. ${ex.query}
  1072. GROUP BY a.sheet_id
  1073. <if test="ex.orderBy == null or ex.orderBy ==''">
  1074. ORDER BY a.create_time DESC
  1075. </if>
  1076. ${ex.orderBy}
  1077. </select>
  1078. </mapper>