|
@@ -22,7 +22,7 @@
|
|
|
<select id="listDispatch" resultType="com.gree.mall.manager.bean.workorder.DispatchVO">
|
|
|
SELECT
|
|
|
a.province_name,
|
|
|
- a.pid,
|
|
|
+ a.province_code,
|
|
|
a.city_name,
|
|
|
a.city_code,
|
|
|
a.area_name,
|
|
@@ -67,10 +67,555 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- where
|
|
|
+ ${ex.query}
|
|
|
+ and
|
|
|
+ a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
|
|
|
+ AND a.`level` = 4
|
|
|
+
|
|
|
+
|
|
|
+ </select>
|
|
|
+ <select id="listDispatchWebsit" resultType="com.gree.mall.manager.bean.workorder.WebsitDispatchVO">
|
|
|
+ SELECT
|
|
|
+ ${ex.selected}
|
|
|
+ FROM websit_dispatch a
|
|
|
+ ${ex.query}
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND a.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="ex.orderBy == null or ex.orderBy ==''">
|
|
|
+ ORDER BY a.create_time DESC
|
|
|
+ </if>
|
|
|
+ ${ex.orderBy}
|
|
|
+ </select>
|
|
|
+ <select id="pList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
|
|
|
+ SELECT
|
|
|
+ a.province_name as valueName,
|
|
|
+ a.province_code as keyId
|
|
|
+ FROM
|
|
|
+ region a
|
|
|
+ join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND b.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join order_small_type c
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ on c.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND d.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND e.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ where 1=1
|
|
|
+ and
|
|
|
+ a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
|
|
|
+ AND a.`level` = 4
|
|
|
+
|
|
|
+ <if test="pId != null and pId !=''">
|
|
|
+ AND a.pid == #{pId}
|
|
|
+ </if>
|
|
|
+ <if test="cityCode != null and cityCode !=''">
|
|
|
+ AND a.city_code == #{cityCode}
|
|
|
+ </if>
|
|
|
+ <if test="areaCode != null and areaCode !=''">
|
|
|
+ AND a.area_code == #{areaCode}
|
|
|
+ </if>
|
|
|
+ <if test="streetCode != null and streetCode !=''">
|
|
|
+ AND a.id == #{streetCode}
|
|
|
+ </if>
|
|
|
+ <if test="dictCode != null and dictCode !=''">
|
|
|
+ AND b.dict_code == #{dictCode}
|
|
|
+ </if>
|
|
|
+ <if test="orderSmallId != null and orderSmallId !=''">
|
|
|
+ AND c.id== #{orderSmallId}
|
|
|
+ </if>
|
|
|
+ <if test="categoryId != null and categoryId !=''">
|
|
|
+ AND d.category_id == #{categoryId}
|
|
|
+ </if>
|
|
|
+ <if test="orderSourceId != null and orderSourceId !=''">
|
|
|
+ AND e.dict_code == #{orderSourceId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ group by a.province_code
|
|
|
+ </select>
|
|
|
+ <select id="cList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
|
|
|
+ SELECT
|
|
|
+ a.city_name as valueName,
|
|
|
+ a.city_code as keyId
|
|
|
+ FROM
|
|
|
+ region a
|
|
|
+ join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND b.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join order_small_type c
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ on c.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND d.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND e.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ where 1=1
|
|
|
+ and
|
|
|
+ a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
|
|
|
+ AND a.`level` = 4
|
|
|
+
|
|
|
+ <if test="pId != null and pId !=''">
|
|
|
+ AND a.pid == #{pId}
|
|
|
+ </if>
|
|
|
+ <if test="cityCode != null and cityCode !=''">
|
|
|
+ AND a.city_code == #{cityCode}
|
|
|
+ </if>
|
|
|
+ <if test="areaCode != null and areaCode !=''">
|
|
|
+ AND a.area_code == #{areaCode}
|
|
|
+ </if>
|
|
|
+ <if test="streetCode != null and streetCode !=''">
|
|
|
+ AND a.id == #{streetCode}
|
|
|
+ </if>
|
|
|
+ <if test="dictCode != null and dictCode !=''">
|
|
|
+ AND b.dict_code == #{dictCode}
|
|
|
+ </if>
|
|
|
+ <if test="orderSmallId != null and orderSmallId !=''">
|
|
|
+ AND c.id== #{orderSmallId}
|
|
|
+ </if>
|
|
|
+ <if test="categoryId != null and categoryId !=''">
|
|
|
+ AND d.category_id == #{categoryId}
|
|
|
+ </if>
|
|
|
+ <if test="orderSourceId != null and orderSourceId !=''">
|
|
|
+ AND e.dict_code == #{orderSourceId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ group by a.city_code
|
|
|
+ </select>
|
|
|
+ <select id="aList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
|
|
|
+ SELECT
|
|
|
+ a.area_name as valueName,
|
|
|
+ a.area_code as keyId
|
|
|
+ FROM
|
|
|
+ region a
|
|
|
+ join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND b.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join order_small_type c
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ on c.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND d.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND e.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ where 1=1
|
|
|
+ and
|
|
|
+ a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
|
|
|
+ AND a.`level` = 4
|
|
|
+
|
|
|
+ <if test="pId != null and pId !=''">
|
|
|
+ AND a.pid == #{pId}
|
|
|
+ </if>
|
|
|
+ <if test="cityCode != null and cityCode !=''">
|
|
|
+ AND a.city_code == #{cityCode}
|
|
|
+ </if>
|
|
|
+ <if test="areaCode != null and areaCode !=''">
|
|
|
+ AND a.area_code == #{areaCode}
|
|
|
+ </if>
|
|
|
+ <if test="streetCode != null and streetCode !=''">
|
|
|
+ AND a.id == #{streetCode}
|
|
|
+ </if>
|
|
|
+ <if test="dictCode != null and dictCode !=''">
|
|
|
+ AND b.dict_code == #{dictCode}
|
|
|
+ </if>
|
|
|
+ <if test="orderSmallId != null and orderSmallId !=''">
|
|
|
+ AND c.id== #{orderSmallId}
|
|
|
+ </if>
|
|
|
+ <if test="categoryId != null and categoryId !=''">
|
|
|
+ AND d.category_id == #{categoryId}
|
|
|
+ </if>
|
|
|
+ <if test="orderSourceId != null and orderSourceId !=''">
|
|
|
+ AND e.dict_code == #{orderSourceId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ group by a.area_code
|
|
|
+ </select>
|
|
|
+ <select id="sList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
|
|
|
+ SELECT
|
|
|
+ a.name as valueName,
|
|
|
+ a.id as keyId
|
|
|
+ FROM
|
|
|
+ region a
|
|
|
+ join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND b.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join order_small_type c
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ on c.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND d.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND e.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ where 1=1
|
|
|
+ and
|
|
|
a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
|
|
|
AND a.`level` = 4
|
|
|
|
|
|
+ <if test="pId != null and pId !=''">
|
|
|
+ AND a.pid == #{pId}
|
|
|
+ </if>
|
|
|
+ <if test="cityCode != null and cityCode !=''">
|
|
|
+ AND a.city_code == #{cityCode}
|
|
|
+ </if>
|
|
|
+ <if test="areaCode != null and areaCode !=''">
|
|
|
+ AND a.area_code == #{areaCode}
|
|
|
+ </if>
|
|
|
+ <if test="streetCode != null and streetCode !=''">
|
|
|
+ AND a.id == #{streetCode}
|
|
|
+ </if>
|
|
|
+ <if test="dictCode != null and dictCode !=''">
|
|
|
+ AND b.dict_code == #{dictCode}
|
|
|
+ </if>
|
|
|
+ <if test="orderSmallId != null and orderSmallId !=''">
|
|
|
+ AND c.id== #{orderSmallId}
|
|
|
+ </if>
|
|
|
+ <if test="categoryId != null and categoryId !=''">
|
|
|
+ AND d.category_id == #{categoryId}
|
|
|
+ </if>
|
|
|
+ <if test="orderSourceId != null and orderSourceId !=''">
|
|
|
+ AND e.dict_code == #{orderSourceId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ group by a.id
|
|
|
+ </select>
|
|
|
+ <select id="channel" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
|
|
|
+ SELECT
|
|
|
+ b.dict_value as valueName,
|
|
|
+ b.dict_code as keyId
|
|
|
+ FROM
|
|
|
+ region a
|
|
|
+ join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND b.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join order_small_type c
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ on c.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND d.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND e.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ where 1=1
|
|
|
+ and
|
|
|
+ a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
|
|
|
+ AND a.`level` = 4
|
|
|
+
|
|
|
+ <if test="pId != null and pId !=''">
|
|
|
+ AND a.pid == #{pId}
|
|
|
+ </if>
|
|
|
+ <if test="cityCode != null and cityCode !=''">
|
|
|
+ AND a.city_code == #{cityCode}
|
|
|
+ </if>
|
|
|
+ <if test="areaCode != null and areaCode !=''">
|
|
|
+ AND a.area_code == #{areaCode}
|
|
|
+ </if>
|
|
|
+ <if test="streetCode != null and streetCode !=''">
|
|
|
+ AND a.id == #{streetCode}
|
|
|
+ </if>
|
|
|
+ <if test="dictCode != null and dictCode !=''">
|
|
|
+ AND b.dict_code == #{dictCode}
|
|
|
+ </if>
|
|
|
+ <if test="orderSmallId != null and orderSmallId !=''">
|
|
|
+ AND c.id== #{orderSmallId}
|
|
|
+ </if>
|
|
|
+ <if test="categoryId != null and categoryId !=''">
|
|
|
+ AND d.category_id == #{categoryId}
|
|
|
+ </if>
|
|
|
+ <if test="orderSourceId != null and orderSourceId !=''">
|
|
|
+ AND e.dict_code == #{orderSourceId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ group by b.dict_code
|
|
|
+ </select>
|
|
|
+ <select id="smallList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
|
|
|
+ SELECT
|
|
|
+ c.order_small_type_text as valueName,
|
|
|
+ c.id as keyId
|
|
|
+ FROM
|
|
|
+ region a
|
|
|
+ join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND b.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join order_small_type c
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ on c.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND d.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND e.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ where 1=1
|
|
|
+ and
|
|
|
+ a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
|
|
|
+ AND a.`level` = 4
|
|
|
+
|
|
|
+ <if test="pId != null and pId !=''">
|
|
|
+ AND a.pid == #{pId}
|
|
|
+ </if>
|
|
|
+ <if test="cityCode != null and cityCode !=''">
|
|
|
+ AND a.city_code == #{cityCode}
|
|
|
+ </if>
|
|
|
+ <if test="areaCode != null and areaCode !=''">
|
|
|
+ AND a.area_code == #{areaCode}
|
|
|
+ </if>
|
|
|
+ <if test="streetCode != null and streetCode !=''">
|
|
|
+ AND a.id == #{streetCode}
|
|
|
+ </if>
|
|
|
+ <if test="dictCode != null and dictCode !=''">
|
|
|
+ AND b.dict_code == #{dictCode}
|
|
|
+ </if>
|
|
|
+ <if test="orderSmallId != null and orderSmallId !=''">
|
|
|
+ AND c.id== #{orderSmallId}
|
|
|
+ </if>
|
|
|
+ <if test="categoryId != null and categoryId !=''">
|
|
|
+ AND d.category_id == #{categoryId}
|
|
|
+ </if>
|
|
|
+ <if test="orderSourceId != null and orderSourceId !=''">
|
|
|
+ AND e.dict_code == #{orderSourceId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ group by c.id
|
|
|
+ </select>
|
|
|
+ <select id="categoryList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
|
|
|
+ SELECT
|
|
|
+ d.name as valueName,
|
|
|
+ d.category_id as keyId
|
|
|
+ FROM
|
|
|
+ region a
|
|
|
+ join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND b.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join order_small_type c
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ on c.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND d.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND e.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ where 1=1
|
|
|
+ and
|
|
|
+ a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
|
|
|
+ AND a.`level` = 4
|
|
|
+
|
|
|
+ <if test="pId != null and pId !=''">
|
|
|
+ AND a.pid == #{pId}
|
|
|
+ </if>
|
|
|
+ <if test="cityCode != null and cityCode !=''">
|
|
|
+ AND a.city_code == #{cityCode}
|
|
|
+ </if>
|
|
|
+ <if test="areaCode != null and areaCode !=''">
|
|
|
+ AND a.area_code == #{areaCode}
|
|
|
+ </if>
|
|
|
+ <if test="streetCode != null and streetCode !=''">
|
|
|
+ AND a.id == #{streetCode}
|
|
|
+ </if>
|
|
|
+ <if test="dictCode != null and dictCode !=''">
|
|
|
+ AND b.dict_code == #{dictCode}
|
|
|
+ </if>
|
|
|
+ <if test="orderSmallId != null and orderSmallId !=''">
|
|
|
+ AND c.id== #{orderSmallId}
|
|
|
+ </if>
|
|
|
+ <if test="categoryId != null and categoryId !=''">
|
|
|
+ AND d.category_id == #{categoryId}
|
|
|
+ </if>
|
|
|
+ <if test="orderSourceId != null and orderSourceId !=''">
|
|
|
+ AND e.dict_code == #{orderSourceId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ group by d.category_id
|
|
|
+ </select>
|
|
|
+ <select id="sourceList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
|
|
|
+ SELECT
|
|
|
+ e.dict_value as valueName,
|
|
|
+ e.dict_code as keyId
|
|
|
+ FROM
|
|
|
+ region a
|
|
|
+ join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL'
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND b.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join order_small_type c
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ on c.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join goods_category d on d.type = 2 and d.del =0 and d.`level` = 1
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND d.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE'
|
|
|
+ <if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
+ AND e.company_wechat_id IN
|
|
|
+ <foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ where 1=1
|
|
|
+ and
|
|
|
+ a.city_name IN ( '广州市', '清远市', '韶关市', '佛山市', '肇庆市', '云浮市' )
|
|
|
+ AND a.`level` = 4
|
|
|
+
|
|
|
+ <if test="pId != null and pId !=''">
|
|
|
+ AND a.pid == #{pId}
|
|
|
+ </if>
|
|
|
+ <if test="cityCode != null and cityCode !=''">
|
|
|
+ AND a.city_code == #{cityCode}
|
|
|
+ </if>
|
|
|
+ <if test="areaCode != null and areaCode !=''">
|
|
|
+ AND a.area_code == #{areaCode}
|
|
|
+ </if>
|
|
|
+ <if test="streetCode != null and streetCode !=''">
|
|
|
+ AND a.id == #{streetCode}
|
|
|
+ </if>
|
|
|
+ <if test="dictCode != null and dictCode !=''">
|
|
|
+ AND b.dict_code == #{dictCode}
|
|
|
+ </if>
|
|
|
+ <if test="orderSmallId != null and orderSmallId !=''">
|
|
|
+ AND c.id== #{orderSmallId}
|
|
|
+ </if>
|
|
|
+ <if test="categoryId != null and categoryId !=''">
|
|
|
+ AND d.category_id == #{categoryId}
|
|
|
+ </if>
|
|
|
+ <if test="orderSourceId != null and orderSourceId !=''">
|
|
|
+ AND e.dict_code == #{orderSourceId}
|
|
|
+ </if>
|
|
|
|
|
|
+ group by e.dict_code
|
|
|
</select>
|
|
|
</mapper>
|