CustomMapper.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  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.management.platform.mapper.CustomMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.management.platform.entity.Custom">
  6. <id column="id" property="id" />
  7. <result column="company_id" property="companyId" />
  8. <result column="custom_name" property="customName" />
  9. <result column="custom_source_id" property="customSourceId" />
  10. <result column="customer_industry_id" property="customerIndustryId" />
  11. <result column="customer_level_id" property="customerLevelId" />
  12. <result column="email" property="email" />
  13. <result column="owner_id" property="ownerId" />
  14. <result column="custom_code" property="customCode" />
  15. <result column="tel_phone" property="telPhone" />
  16. <result column="fax" property="fax" />
  17. <result column="country_billing" property="countryBilling" />
  18. <result column="province_billing" property="provinceBilling" />
  19. <result column="city_billing" property="cityBilling" />
  20. <result column="street_billing" property="streetBilling" />
  21. <result column="country_delivery" property="countryDelivery" />
  22. <result column="province_delivery" property="provinceDelivery" />
  23. <result column="city_delivery" property="cityDelivery" />
  24. <result column="street_delivery" property="streetDelivery" />
  25. <result column="create_time" property="createTime" />
  26. <result column="plate1" property="plate1" />
  27. <result column="plate2" property="plate2" />
  28. <result column="plate3" property="plate3" />
  29. <result column="plate4" property="plate4" />
  30. <result column="plate5" property="plate5" />
  31. <result column="creator_id" property="creatorId" />
  32. <result column="custom_desc" property="customDesc" />
  33. <result column="is_delete" property="isDelete" />
  34. <result column="company_phone" property="companyPhone" />
  35. <result column="incharger_id" property="inchargerId" />
  36. <result column="address" property="address" />
  37. <result column="close_deal" property="closeDeal" />
  38. </resultMap>
  39. <!-- 通用查询结果列 -->
  40. <sql id="Base_Column_List">
  41. id, company_id, custom_name, custom_source_id, customer_industry_id, customer_level_id, email, owner_id, custom_code, tel_phone, fax, country_billing, province_billing, city_billing, street_billing, country_delivery, province_delivery, city_delivery, street_delivery, create_time, plate1, plate2, plate3, plate4, plate5, creator_id, custom_desc, is_delete, company_phone, incharger_id, address, close_deal
  42. </sql>
  43. <select id="getList" resultType="com.management.platform.entity.Custom">
  44. select
  45. c.id,
  46. c.contacts_name,
  47. c.custom_name,
  48. c.email,
  49. c.tel_phone,
  50. c.company_phone,
  51. c.custom_desc,
  52. c.incharger_id,
  53. c.address,
  54. c.create_time,
  55. c.customer_level_id,
  56. (select name from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
  57. c.customer_industry_id,
  58. (select name from sys_dict where customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
  59. c.custom_source_id,
  60. (select name from sys_dict where custom_source_id = id) customSourceValue,
  61. c.incharger_id,
  62. (select `name` from `user` where id = incharger_id) inchargerName,
  63. c.creator_id,
  64. c.create_time,
  65. (select `name` from `user` where id = creator_id) creatorName
  66. from custom c
  67. left join sys_dict sd on c.customer_level_id = sd.id
  68. where c.company_id = #{companyId}
  69. and c.is_delete =#{isDelete}
  70. <if test="inchargerId != null and inchargerId != '' ">
  71. and c.incharger_id =#{inchargerId}
  72. </if>
  73. <if test="startTime != null and endTime != null ">
  74. and c.create_time BETWEEN #{startTime} and #{endTime}
  75. </if>
  76. <if test="customName != null and customName != '' ">
  77. and c.custom_name LIKE CONCAT('%', #{customName}, '%')
  78. </if>
  79. <if test="email != null and email != '' ">
  80. and c.email LIKE CONCAT('%', #{email}, '%')
  81. </if>
  82. <if test="companyPhone != null and companyPhone != '' ">
  83. and c.company_phone LIKE CONCAT('%', #{companyPhone}, '%')
  84. </if>
  85. <if test="customerLevelId != null ">
  86. and c.customer_level_id = #{customerLevelId}
  87. </if>
  88. <if test="customSourceId != null ">
  89. and c.custom_source_id = #{customSourceId}
  90. </if>
  91. <if test="customerIndustryId != null ">
  92. and c.customer_industry_id = #{customerIndustryId}
  93. </if>
  94. ORDER BY
  95. <choose>
  96. <when test="isDesc == null ">
  97. c.id DESC
  98. </when>
  99. <when test="isDesc == 0">
  100. sd.seq ASC, c.id DESC
  101. </when>
  102. <when test="isDesc == 1">
  103. sd.seq DESC, c.id DESC
  104. </when>
  105. <otherwise>
  106. c.id DESC
  107. </otherwise>
  108. </choose>
  109. <if test="pageFrom != null ">
  110. Limit #{pageIndex},#{pageFrom}
  111. </if>
  112. </select>
  113. <select id="getTotal" resultType="java.lang.Integer">
  114. select count(id)
  115. from custom
  116. where company_id = #{companyId}
  117. and is_delete =#{isDelete}
  118. <if test="inchargerId != null and inchargerId != '' ">
  119. and incharger_id =#{inchargerId}
  120. </if>
  121. <if test="startTime != null and endTime != null ">
  122. and create_time BETWEEN #{startTime} and #{endTime}
  123. </if>
  124. <if test="customName != null and customName != '' ">
  125. and custom_name = #{customName}
  126. </if>
  127. <if test="email != null and email != '' ">
  128. and email = #{email}
  129. </if>
  130. <if test="companyPhone != null ">
  131. and company_phone LIKE CONCAT('%', #{companyPhone}, '%')
  132. </if>
  133. <if test="customerLevelId != null ">
  134. and customer_level_id = #{customerLevelId}
  135. </if>
  136. <if test="customSourceId != null ">
  137. and custom_source_id = #{customSourceId}
  138. </if>
  139. <if test="customerIndustryId != null ">
  140. and customer_industry_id = #{customerIndustryId}
  141. </if>
  142. </select>
  143. <select id="getList1" resultType="com.management.platform.entity.Custom">
  144. select c.id,
  145. c.custom_name,
  146. c.email,
  147. c.tel_phone,
  148. c.contacts_name,
  149. c.company_phone,
  150. c.custom_desc,
  151. c.address,
  152. c.create_time,
  153. c.customer_level_id,
  154. (select name from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
  155. c.customer_industry_id,
  156. (select name from sys_dict where customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
  157. c.custom_source_id,
  158. (select name from sys_dict where custom_source_id = id ) customSourceValue,
  159. c.incharger_id,
  160. (select `name` from `user` where id = incharger_id) inchargerName,
  161. c.creator_id,
  162. c.create_time,
  163. (select `name` from `user` where id = creator_id) creatorName
  164. from custom c
  165. left join sys_dict sd on c.customer_level_id = sd.id
  166. where
  167. (c.incharger_id in
  168. (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERE id = #{userId}))
  169. or c.incharger_id is null)
  170. and c.company_id = #{companyId}
  171. and c.is_delete =#{isDelete}
  172. <if test="inchargerId != null and inchargerId != '' ">
  173. and c.incharger_id =#{inchargerId}
  174. </if>
  175. <if test="startTime != null and endTime != null ">
  176. and c.create_time BETWEEN #{startTime} and #{endTime}
  177. </if>
  178. <if test="customName != null and customName != '' ">
  179. and c.custom_name LIKE CONCAT('%', #{customName}, '%')
  180. </if>
  181. <if test="email != null and email != '' ">
  182. and c.email LIKE CONCAT('%', #{email}, '%')
  183. </if>
  184. <if test="companyPhone != null ">
  185. and c.company_phone LIKE CONCAT('%', #{companyPhone}, '%')
  186. </if>
  187. <if test="customerLevelId != null ">
  188. and c.customer_level_id = #{customerLevelId}
  189. </if>
  190. <if test="customSourceId != null ">
  191. and c.custom_source_id = #{customSourceId}
  192. </if>
  193. <if test="customerIndustryId != null ">
  194. and c.customer_industry_id = #{customerIndustryId}
  195. </if>
  196. ORDER BY
  197. <choose>
  198. <when test="isDesc == null ">
  199. c.id DESC
  200. </when>
  201. <when test="isDesc == 0">
  202. sd.seq ASC, c.id DESC
  203. </when>
  204. <when test="isDesc == 1">
  205. sd.seq DESC, c.id DESC
  206. </when>
  207. <otherwise>
  208. c.id DESC
  209. </otherwise>
  210. </choose>
  211. <if test="pageFrom != null ">
  212. Limit #{pageIndex},#{pageFrom}
  213. </if>
  214. </select>
  215. <select id="getTotal1" resultType="java.lang.Integer">
  216. select count(id)
  217. from custom
  218. where company_id = #{companyId}
  219. and is_delete =#{isDelete}
  220. and incharger_id in
  221. (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
  222. or incharger_id is null
  223. <if test="inchargerId != null and inchargerId != '' ">
  224. and incharger_id =#{inchargerId}
  225. </if>
  226. <if test="startTime != null and endTime != null ">
  227. and create_time BETWEEN #{startTime} and #{endTime}
  228. </if>
  229. <if test="customName != null and customName != '' ">
  230. and custom_name = #{customName}
  231. </if>
  232. <if test="email != null and email != '' ">
  233. and email = #{email}
  234. </if>
  235. <if test="companyPhone != null ">
  236. and company_phone LIKE CONCAT('%', #{companyPhone}, '%')
  237. </if>
  238. <if test="customerLevelId != null ">
  239. and customer_level_id = #{customerLevelId}
  240. </if>
  241. <if test="customSourceId != null ">
  242. and custom_source_id = #{customSourceId}
  243. </if>
  244. <if test="customerIndustryId != null ">
  245. and customer_industry_id = #{customerIndustryId}
  246. </if>
  247. </select>
  248. <select id="getList2" resultType="com.management.platform.entity.Custom">
  249. select id,
  250. custom_name,
  251. email,
  252. contacts_name
  253. tel_phone,contacts_name,
  254. company_phone,
  255. custom_desc,
  256. contacts_name
  257. incharger_id,
  258. address,
  259. create_time,
  260. customer_level_id,
  261. (select name from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
  262. customer_industry_id,
  263. (select name from sys_dict where customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
  264. custom_source_id,
  265. (select name from sys_dict where custom_source_id = id ) customSourceValue,
  266. incharger_id,
  267. (select `name` from `user` where id = incharger_id) inchargerName,
  268. creator_id,
  269. (select `name` from `user` where id = creator_id) creatorName
  270. from custom
  271. where company_id = #{companyId}
  272. and is_delete =#{isDelete}
  273. and (incharger_id = #{userId}
  274. or incharger_id is null)
  275. <if test="inchargerId != null and inchargerId != '' ">
  276. and incharger_id =#{inchargerId}
  277. </if>
  278. <if test="startTime != null and endTime != null ">
  279. and create_time BETWEEN #{startTime} and #{endTime}
  280. </if>
  281. <if test="customName != null and customName != '' ">
  282. and custom_name LIKE CONCAT('%', #{customName}, '%')
  283. </if>
  284. <if test="email != null and email != '' ">
  285. and email LIKE CONCAT('%', #{email}, '%')
  286. </if>
  287. <if test="companyPhone != null ">
  288. and company_phone LIKE CONCAT('%', #{companyPhone}, '%')
  289. </if>
  290. <if test="customerLevelId != null ">
  291. and customer_level_id = #{customerLevelId}
  292. </if>
  293. <if test="customSourceId != null ">
  294. and custom_source_id = #{customSourceId}
  295. </if>
  296. <if test="customerIndustryId != null ">
  297. and customer_industry_id = #{customerIndustryId}
  298. </if>
  299. ORDER BY id desc
  300. <if test="pageFrom != null ">
  301. Limit #{pageIndex},#{pageFrom}
  302. </if>
  303. </select>
  304. <select id="getTotal2" resultType="java.lang.Integer">
  305. select count(id)
  306. from custom
  307. where company_id = #{companyId}
  308. and is_delete = #{isDelete}
  309. and incharger_id = #{userId}
  310. or incharger_id is null
  311. <if test="inchargerId != null and inchargerId != '' ">
  312. and incharger_id =#{inchargerId}
  313. </if>
  314. <if test="startTime != null and endTime != null ">
  315. and create_time BETWEEN #{startTime} and #{endTime}
  316. </if>
  317. <if test="customName != null and customName != '' ">
  318. and custom_name = #{customName}
  319. </if>
  320. <if test="email != null and email != '' ">
  321. and email = #{email}
  322. </if>
  323. <if test="companyPhone != null ">
  324. and company_phone LIKE CONCAT('%', #{companyPhone}, '%')
  325. </if>
  326. <if test="customerLevelId != null ">
  327. and customer_level_id = #{customerLevelId}
  328. </if>
  329. <if test="customSourceId != null ">
  330. and custom_source_id = #{customSourceId}
  331. </if>
  332. <if test="customerIndustryId != null ">
  333. and customer_industry_id = #{customerIndustryId}
  334. </if>
  335. </select>
  336. <select id="getInfo" resultType="com.management.platform.entity.Custom">
  337. select id,
  338. custom_name,
  339. contacts_name,
  340. custom_source_id,
  341. customer_industry_id,
  342. customer_level_id,
  343. email,
  344. tel_phone,
  345. company_phone,
  346. address,
  347. custom_code,
  348. incharger_id,
  349. tel_phone,
  350. fax,
  351. create_time,
  352. plate1,
  353. plate2,
  354. plate3,
  355. plate4,
  356. plate5,
  357. creator_id,
  358. custom_desc,
  359. is_delete,
  360. (select `name` from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
  361. (select `name` from sys_dict where customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
  362. (select `name` from sys_dict where custom_source_id = id ) customSourceValue,
  363. (select `name` from `user` where id = incharger_id) inchargerName,
  364. (select `name` from `user` where id = creator_id) creatorName
  365. from custom
  366. where id = #{id}
  367. </select>
  368. <select id="getDataSummary" resultType="java.util.Map">
  369. SELECT COUNT(*) newNum
  370. <!-- ,SUM(close_deal=1) closeDealNum -->
  371. FROM custom
  372. WHERE company_id=#{companyId} and is_delete=0
  373. <if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
  374. and DATE_FORMAT(create_time,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
  375. </if>
  376. <if test="userId!=null and userId!=''">
  377. and incharger_id=#{userId}
  378. </if>
  379. <if test="list!=null and list.size()>0">
  380. and incharger_id in
  381. <foreach collection="list" separator="," open="(" close=")" item="item">
  382. #{item}
  383. </foreach>
  384. </if>
  385. </select>
  386. <select id="getListByPin" resultType="com.management.platform.entity.Custom">
  387. select
  388. c.id,
  389. c.contacts_name,
  390. c.custom_name,
  391. c.email,
  392. c.tel_phone,
  393. c.company_phone,
  394. c.custom_desc,
  395. c.incharger_id,
  396. c.address,
  397. c.create_time,
  398. c.customer_level_id,
  399. (select name from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
  400. c.customer_industry_id,
  401. (select name from sys_dict where customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
  402. c.custom_source_id,
  403. (select name from sys_dict where custom_source_id = id) customSourceValue,
  404. c.incharger_id,
  405. (select `name` from `user` where id = incharger_id) inchargerName,
  406. c.creator_id,
  407. c.create_time,
  408. (select `name` from `user` where id = creator_id) creatorName,c.need_pin,c.pin_time
  409. from custom c
  410. left join sys_dict sd on c.customer_level_id = sd.id
  411. where c.company_id = #{companyId}
  412. and c.is_delete =#{isDelete}
  413. <if test="inchargerId != null and inchargerId != '' ">
  414. and c.incharger_id =#{inchargerId}
  415. </if>
  416. <if test="startTime != null and endTime != null ">
  417. and c.create_time BETWEEN #{startTime} and #{endTime}
  418. </if>
  419. <if test="customName != null and customName != '' ">
  420. and c.custom_name LIKE CONCAT('%', #{customName}, '%')
  421. </if>
  422. <if test="email != null and email != '' ">
  423. and c.email LIKE CONCAT('%', #{email}, '%')
  424. </if>
  425. <if test="companyPhone != null and companyPhone != '' ">
  426. and c.company_phone LIKE CONCAT('%', #{companyPhone}, '%')
  427. </if>
  428. <if test="customerLevelId != null ">
  429. and c.customer_level_id = #{customerLevelId}
  430. </if>
  431. <if test="customSourceId != null ">
  432. and c.custom_source_id = #{customSourceId}
  433. </if>
  434. <if test="customerIndustryId != null ">
  435. and c.customer_industry_id = #{customerIndustryId}
  436. </if>
  437. ORDER BY c.need_pin desc,c.pin_time desc
  438. <choose>
  439. <when test="isDesc == null ">
  440. ,c.id DESC
  441. </when>
  442. <when test="isDesc == 0">
  443. ,sd.seq ASC, c.id DESC
  444. </when>
  445. <when test="isDesc == 1">
  446. ,sd.seq DESC, c.id DESC
  447. </when>
  448. <otherwise>
  449. ,c.id DESC
  450. </otherwise>
  451. </choose>
  452. <if test="pageFrom != null ">
  453. Limit #{pageIndex},#{pageFrom}
  454. </if>
  455. </select>
  456. <select id="getList1ByPin" resultType="com.management.platform.entity.Custom">
  457. select c.id,
  458. c.custom_name,
  459. c.email,
  460. c.tel_phone,
  461. c.contacts_name,
  462. c.company_phone,
  463. c.custom_desc,
  464. c.address,
  465. c.create_time,
  466. c.customer_level_id,
  467. (select name from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
  468. c.customer_industry_id,
  469. (select name from sys_dict where customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
  470. c.custom_source_id,
  471. (select name from sys_dict where custom_source_id = id ) customSourceValue,
  472. c.incharger_id,
  473. (select `name` from `user` where id = incharger_id) inchargerName,
  474. c.creator_id,
  475. c.create_time,
  476. (select `name` from `user` where id = creator_id) creatorName,c.need_pin,c.pin_time
  477. from custom c
  478. left join sys_dict sd on c.customer_level_id = sd.id
  479. where
  480. (c.incharger_id in
  481. (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERE id = #{userId}))
  482. or c.incharger_id is null)
  483. and c.company_id = #{companyId}
  484. and c.is_delete =#{isDelete}
  485. <if test="inchargerId != null and inchargerId != '' ">
  486. and c.incharger_id =#{inchargerId}
  487. </if>
  488. <if test="startTime != null and endTime != null ">
  489. and c.create_time BETWEEN #{startTime} and #{endTime}
  490. </if>
  491. <if test="customName != null and customName != '' ">
  492. and c.custom_name LIKE CONCAT('%', #{customName}, '%')
  493. </if>
  494. <if test="email != null and email != '' ">
  495. and c.email LIKE CONCAT('%', #{email}, '%')
  496. </if>
  497. <if test="companyPhone != null ">
  498. and c.company_phone LIKE CONCAT('%', #{companyPhone}, '%')
  499. </if>
  500. <if test="customerLevelId != null ">
  501. and c.customer_level_id = #{customerLevelId}
  502. </if>
  503. <if test="customSourceId != null ">
  504. and c.custom_source_id = #{customSourceId}
  505. </if>
  506. <if test="customerIndustryId != null ">
  507. and c.customer_industry_id = #{customerIndustryId}
  508. </if>
  509. ORDER BY c.need_pin desc,c.pin_time desc
  510. <choose>
  511. <when test="isDesc == null ">
  512. ,c.id DESC
  513. </when>
  514. <when test="isDesc == 0">
  515. ,sd.seq ASC, c.id DESC
  516. </when>
  517. <when test="isDesc == 1">
  518. ,sd.seq DESC, c.id DESC
  519. </when>
  520. <otherwise>
  521. ,c.id DESC
  522. </otherwise>
  523. </choose>
  524. <if test="pageFrom != null ">
  525. Limit #{pageIndex},#{pageFrom}
  526. </if>
  527. </select>
  528. <select id="getList2ByPin" resultType="com.management.platform.entity.Custom">
  529. select id,
  530. custom_name,
  531. email,
  532. contacts_name
  533. tel_phone,contacts_name,
  534. company_phone,
  535. custom_desc,
  536. contacts_name
  537. incharger_id,
  538. address,
  539. create_time,
  540. customer_level_id,
  541. (select name from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
  542. customer_industry_id,
  543. (select name from sys_dict where customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
  544. custom_source_id,
  545. (select name from sys_dict where custom_source_id = id ) customSourceValue,
  546. incharger_id,
  547. (select `name` from `user` where id = incharger_id) inchargerName,
  548. creator_id,
  549. (select `name` from `user` where id = creator_id) creatorName,need_pin,pin_time
  550. from custom
  551. where company_id = #{companyId}
  552. and is_delete =#{isDelete}
  553. and (incharger_id = #{userId}
  554. or incharger_id is null)
  555. <if test="inchargerId != null and inchargerId != '' ">
  556. and incharger_id =#{inchargerId}
  557. </if>
  558. <if test="startTime != null and endTime != null ">
  559. and create_time BETWEEN #{startTime} and #{endTime}
  560. </if>
  561. <if test="customName != null and customName != '' ">
  562. and custom_name LIKE CONCAT('%', #{customName}, '%')
  563. </if>
  564. <if test="email != null and email != '' ">
  565. and email LIKE CONCAT('%', #{email}, '%')
  566. </if>
  567. <if test="companyPhone != null ">
  568. and company_phone LIKE CONCAT('%', #{companyPhone}, '%')
  569. </if>
  570. <if test="customerLevelId != null ">
  571. and customer_level_id = #{customerLevelId}
  572. </if>
  573. <if test="customSourceId != null ">
  574. and custom_source_id = #{customSourceId}
  575. </if>
  576. <if test="customerIndustryId != null ">
  577. and customer_industry_id = #{customerIndustryId}
  578. </if>
  579. ORDER BY need_pin desc,pin_time desc,id desc
  580. <if test="pageFrom != null ">
  581. Limit #{pageIndex},#{pageFrom}
  582. </if>
  583. </select>
  584. </mapper>