IncreMapper.xml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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.workorder.IncreMapper">
  4. <select id="list" resultType="com.gree.mall.manager.bean.workorder.IncreVO">
  5. SELECT
  6. ${ex.selected}
  7. FROM pg_incre a
  8. ${ex.query}
  9. <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
  10. AND a.company_wechat_id IN
  11. <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
  12. #{item}
  13. </foreach>
  14. </if>
  15. <if test="ex.orderBy == null or ex.orderBy ==''">
  16. ORDER BY a.create_time DESC
  17. </if>
  18. ${ex.orderBy}
  19. </select>
  20. <select id="listDispatch" resultType="com.gree.mall.manager.bean.workorder.DispatchVO">
  21. SELECT
  22. a.province_name,
  23. a.pid,
  24. a.city_name,
  25. a.city_code,
  26. a.area_name,
  27. a.area_code,
  28. a.name as streetName,
  29. a.id as streetCode,
  30. b.dict_value,
  31. b.dict_code,
  32. c.order_small_type_text,
  33. c.id as orderSmallId,
  34. d.name as categoryName,
  35. d.category_id,
  36. e.dict_value as order_source,
  37. e.dict_code as order_source_id
  38. FROM
  39. region a
  40. join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
  41. <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
  42. AND b.company_wechat_id IN
  43. <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
  44. #{item}
  45. </foreach>
  46. </if>
  47. join order_small_type c
  48. <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
  49. on c.company_wechat_id IN
  50. <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
  51. #{item}
  52. </foreach>
  53. </if>
  54. join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
  55. <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
  56. AND d.company_wechat_id IN
  57. <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
  58. #{item}
  59. </foreach>
  60. </if>
  61. join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
  62. <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
  63. AND e.company_wechat_id IN
  64. <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
  65. #{item}
  66. </foreach>
  67. </if>
  68. where
  69. a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
  70. AND a.`level` = 4
  71. </select>
  72. </mapper>