CustomMapper.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  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,SUM(close_deal=1) closeDealNum FROM custom
  370. WHERE company_id=#{companyId} and is_delete=0
  371. <if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
  372. and DATE_FORMAT(create_time,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
  373. </if>
  374. <if test="userId!=null and userId!=''">
  375. and incharger_id=#{userId}
  376. </if>
  377. <if test="list!=null and list.size()>0">
  378. and incharger_id in
  379. <foreach collection="list" separator="," open="(" close=")" item="item">
  380. #{item}
  381. </foreach>
  382. </if>
  383. </select>
  384. <select id="getListByPin" resultType="com.management.platform.entity.Custom">
  385. select
  386. c.id,
  387. c.contacts_name,
  388. c.custom_name,
  389. c.email,
  390. c.tel_phone,
  391. c.company_phone,
  392. c.custom_desc,
  393. c.incharger_id,
  394. c.address,
  395. c.create_time,
  396. c.customer_level_id,
  397. (select name from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
  398. c.customer_industry_id,
  399. (select name from sys_dict where customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
  400. c.custom_source_id,
  401. (select name from sys_dict where custom_source_id = id) customSourceValue,
  402. c.incharger_id,
  403. (select `name` from `user` where id = incharger_id) inchargerName,
  404. c.creator_id,
  405. c.create_time,
  406. (select `name` from `user` where id = creator_id) creatorName,c.need_pin,c.pin_time
  407. from custom c
  408. left join sys_dict sd on c.customer_level_id = sd.id
  409. where c.company_id = #{companyId}
  410. and c.is_delete =#{isDelete}
  411. <if test="inchargerId != null and inchargerId != '' ">
  412. and c.incharger_id =#{inchargerId}
  413. </if>
  414. <if test="startTime != null and endTime != null ">
  415. and c.create_time BETWEEN #{startTime} and #{endTime}
  416. </if>
  417. <if test="customName != null and customName != '' ">
  418. and c.custom_name LIKE CONCAT('%', #{customName}, '%')
  419. </if>
  420. <if test="email != null and email != '' ">
  421. and c.email LIKE CONCAT('%', #{email}, '%')
  422. </if>
  423. <if test="companyPhone != null and companyPhone != '' ">
  424. and c.company_phone LIKE CONCAT('%', #{companyPhone}, '%')
  425. </if>
  426. <if test="customerLevelId != null ">
  427. and c.customer_level_id = #{customerLevelId}
  428. </if>
  429. <if test="customSourceId != null ">
  430. and c.custom_source_id = #{customSourceId}
  431. </if>
  432. <if test="customerIndustryId != null ">
  433. and c.customer_industry_id = #{customerIndustryId}
  434. </if>
  435. ORDER BY c.need_pin desc,c.pin_time desc
  436. <choose>
  437. <when test="isDesc == null ">
  438. ,c.id DESC
  439. </when>
  440. <when test="isDesc == 0">
  441. ,sd.seq ASC, c.id DESC
  442. </when>
  443. <when test="isDesc == 1">
  444. ,sd.seq DESC, c.id DESC
  445. </when>
  446. <otherwise>
  447. ,c.id DESC
  448. </otherwise>
  449. </choose>
  450. <if test="pageFrom != null ">
  451. Limit #{pageIndex},#{pageFrom}
  452. </if>
  453. </select>
  454. <select id="getList1ByPin" resultType="com.management.platform.entity.Custom">
  455. select c.id,
  456. c.custom_name,
  457. c.email,
  458. c.tel_phone,
  459. c.contacts_name,
  460. c.company_phone,
  461. c.custom_desc,
  462. c.address,
  463. c.create_time,
  464. c.customer_level_id,
  465. (select name from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
  466. c.customer_industry_id,
  467. (select name from sys_dict where customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
  468. c.custom_source_id,
  469. (select name from sys_dict where custom_source_id = id ) customSourceValue,
  470. c.incharger_id,
  471. (select `name` from `user` where id = incharger_id) inchargerName,
  472. c.creator_id,
  473. c.create_time,
  474. (select `name` from `user` where id = creator_id) creatorName,c.need_pin,c.pin_time
  475. from custom c
  476. left join sys_dict sd on c.customer_level_id = sd.id
  477. where
  478. (c.incharger_id in
  479. (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERE id = #{userId}))
  480. or c.incharger_id is null)
  481. and c.company_id = #{companyId}
  482. and c.is_delete =#{isDelete}
  483. <if test="inchargerId != null and inchargerId != '' ">
  484. and c.incharger_id =#{inchargerId}
  485. </if>
  486. <if test="startTime != null and endTime != null ">
  487. and c.create_time BETWEEN #{startTime} and #{endTime}
  488. </if>
  489. <if test="customName != null and customName != '' ">
  490. and c.custom_name LIKE CONCAT('%', #{customName}, '%')
  491. </if>
  492. <if test="email != null and email != '' ">
  493. and c.email LIKE CONCAT('%', #{email}, '%')
  494. </if>
  495. <if test="companyPhone != null ">
  496. and c.company_phone LIKE CONCAT('%', #{companyPhone}, '%')
  497. </if>
  498. <if test="customerLevelId != null ">
  499. and c.customer_level_id = #{customerLevelId}
  500. </if>
  501. <if test="customSourceId != null ">
  502. and c.custom_source_id = #{customSourceId}
  503. </if>
  504. <if test="customerIndustryId != null ">
  505. and c.customer_industry_id = #{customerIndustryId}
  506. </if>
  507. ORDER BY c.need_pin desc,c.pin_time desc
  508. <choose>
  509. <when test="isDesc == null ">
  510. ,c.id DESC
  511. </when>
  512. <when test="isDesc == 0">
  513. ,sd.seq ASC, c.id DESC
  514. </when>
  515. <when test="isDesc == 1">
  516. ,sd.seq DESC, c.id DESC
  517. </when>
  518. <otherwise>
  519. ,c.id DESC
  520. </otherwise>
  521. </choose>
  522. <if test="pageFrom != null ">
  523. Limit #{pageIndex},#{pageFrom}
  524. </if>
  525. </select>
  526. <select id="getList2ByPin" resultType="com.management.platform.entity.Custom">
  527. select id,
  528. custom_name,
  529. email,
  530. contacts_name
  531. tel_phone,contacts_name,
  532. company_phone,
  533. custom_desc,
  534. contacts_name
  535. incharger_id,
  536. address,
  537. create_time,
  538. customer_level_id,
  539. (select name from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
  540. customer_industry_id,
  541. (select name from sys_dict where customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
  542. custom_source_id,
  543. (select name from sys_dict where custom_source_id = id ) customSourceValue,
  544. incharger_id,
  545. (select `name` from `user` where id = incharger_id) inchargerName,
  546. creator_id,
  547. (select `name` from `user` where id = creator_id) creatorName,c.need_pin,c.pin_time
  548. from custom
  549. where company_id = #{companyId}
  550. and is_delete =#{isDelete}
  551. and (incharger_id = #{userId}
  552. or incharger_id is null)
  553. <if test="inchargerId != null and inchargerId != '' ">
  554. and incharger_id =#{inchargerId}
  555. </if>
  556. <if test="startTime != null and endTime != null ">
  557. and create_time BETWEEN #{startTime} and #{endTime}
  558. </if>
  559. <if test="customName != null and customName != '' ">
  560. and custom_name LIKE CONCAT('%', #{customName}, '%')
  561. </if>
  562. <if test="email != null and email != '' ">
  563. and email LIKE CONCAT('%', #{email}, '%')
  564. </if>
  565. <if test="companyPhone != null ">
  566. and company_phone LIKE CONCAT('%', #{companyPhone}, '%')
  567. </if>
  568. <if test="customerLevelId != null ">
  569. and customer_level_id = #{customerLevelId}
  570. </if>
  571. <if test="customSourceId != null ">
  572. and custom_source_id = #{customSourceId}
  573. </if>
  574. <if test="customerIndustryId != null ">
  575. and customer_industry_id = #{customerIndustryId}
  576. </if>
  577. ORDER BY need_pin desc,pin_time desc,id desc
  578. <if test="pageFrom != null ">
  579. Limit #{pageIndex},#{pageFrom}
  580. </if>
  581. </select>
  582. </mapper>