|
@@ -92,7 +92,7 @@
|
|
|
a.province_code as keyId
|
|
|
FROM
|
|
|
region a
|
|
|
- join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
|
|
|
+ join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
|
|
|
<if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
AND b.company_wechat_id IN
|
|
|
<foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
@@ -113,13 +113,6 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
|
|
|
- <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>
|
|
|
LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
|
|
|
<if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
AND f.company_wechat_id IN
|
|
@@ -145,7 +138,7 @@
|
|
|
<if test="streetCode != null and streetCode !=''">
|
|
|
AND a.id = #{streetCode}
|
|
|
</if>
|
|
|
- <if test="dictCode != null and dictCode.size > 0">
|
|
|
+ <if test="sales != null and sales.size > 0">
|
|
|
AND b.dict_code IN
|
|
|
<foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
|
|
|
#{item}
|
|
@@ -163,12 +156,6 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="orderSourceId != null and orderSourceId.size > 0">
|
|
|
- AND e.dict_code in
|
|
|
- <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
|
|
|
group by a.province_code
|
|
|
</select>
|
|
@@ -178,7 +165,7 @@
|
|
|
a.city_code as keyId
|
|
|
FROM
|
|
|
region a
|
|
|
- join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
|
|
|
+ join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
|
|
|
<if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
AND b.company_wechat_id IN
|
|
|
<foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
@@ -199,13 +186,7 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
|
|
|
- <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>
|
|
|
+
|
|
|
LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
|
|
|
<if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
AND f.company_wechat_id IN
|
|
@@ -231,7 +212,7 @@
|
|
|
<if test="streetCode != null and streetCode !=''">
|
|
|
AND a.id = #{streetCode}
|
|
|
</if>
|
|
|
- <if test="dictCode != null and dictCode.size > 0">
|
|
|
+ <if test="sales != null and sales.size > 0">
|
|
|
AND b.dict_code IN
|
|
|
<foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
|
|
|
#{item}
|
|
@@ -249,12 +230,7 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="orderSourceId != null and orderSourceId.size > 0">
|
|
|
- AND e.dict_code in
|
|
|
- <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
+
|
|
|
|
|
|
group by a.city_code
|
|
|
</select>
|
|
@@ -264,7 +240,7 @@
|
|
|
a.area_code as keyId
|
|
|
FROM
|
|
|
region a
|
|
|
- join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
|
|
|
+ join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
|
|
|
<if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
AND b.company_wechat_id IN
|
|
|
<foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
@@ -285,13 +261,7 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
|
|
|
- <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>
|
|
|
+
|
|
|
LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
|
|
|
<if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
AND f.company_wechat_id IN
|
|
@@ -317,7 +287,7 @@
|
|
|
<if test="streetCode != null and streetCode !=''">
|
|
|
AND a.id = #{streetCode}
|
|
|
</if>
|
|
|
- <if test="dictCode != null and dictCode.size > 0">
|
|
|
+ <if test="sales != null and sales.size > 0">
|
|
|
AND b.dict_code IN
|
|
|
<foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
|
|
|
#{item}
|
|
@@ -335,13 +305,6 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="orderSourceId != null and orderSourceId.size > 0">
|
|
|
- AND e.dict_code in
|
|
|
- <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
-
|
|
|
group by a.area_code
|
|
|
</select>
|
|
|
<select id="sList" resultType="com.gree.mall.manager.bean.workorder.DispatchCherVO">
|
|
@@ -350,7 +313,7 @@
|
|
|
a.id as keyId
|
|
|
FROM
|
|
|
region a
|
|
|
- join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
|
|
|
+ join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
|
|
|
<if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
AND b.company_wechat_id IN
|
|
|
<foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
@@ -371,13 +334,7 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
|
|
|
- <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>
|
|
|
+
|
|
|
LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
|
|
|
<if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
AND f.company_wechat_id IN
|
|
@@ -403,7 +360,7 @@
|
|
|
<if test="streetCode != null and streetCode !=''">
|
|
|
AND a.id = #{streetCode}
|
|
|
</if>
|
|
|
- <if test="dictCode != null and dictCode.size > 0">
|
|
|
+ <if test="sales != null and sales.size > 0">
|
|
|
AND b.dict_code IN
|
|
|
<foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
|
|
|
#{item}
|
|
@@ -421,12 +378,6 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="orderSourceId != null and orderSourceId.size > 0">
|
|
|
- AND e.dict_code in
|
|
|
- <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
|
|
|
group by a.id
|
|
|
</select>
|
|
@@ -457,13 +408,7 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
|
|
|
- <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>
|
|
|
+
|
|
|
LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
|
|
|
<if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
AND f.company_wechat_id IN
|
|
@@ -522,7 +467,7 @@
|
|
|
c.id as keyId
|
|
|
FROM
|
|
|
region a
|
|
|
- join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
|
|
|
+ join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
|
|
|
<if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
AND b.company_wechat_id IN
|
|
|
<foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
@@ -543,13 +488,7 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
|
|
|
- <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>
|
|
|
+
|
|
|
LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
|
|
|
<if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
AND f.company_wechat_id IN
|
|
@@ -575,7 +514,7 @@
|
|
|
<if test="streetCode != null and streetCode !=''">
|
|
|
AND a.id = #{streetCode}
|
|
|
</if>
|
|
|
- <if test="dictCode != null and dictCode.size > 0">
|
|
|
+ <if test="sales != null and sales.size > 0">
|
|
|
AND b.dict_code IN
|
|
|
<foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
|
|
|
#{item}
|
|
@@ -593,12 +532,7 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="orderSourceId != null and orderSourceId.size > 0">
|
|
|
- AND e.dict_code in
|
|
|
- <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
+
|
|
|
|
|
|
group by c.id
|
|
|
</select>
|
|
@@ -608,7 +542,7 @@
|
|
|
d.category_id as keyId
|
|
|
FROM
|
|
|
region a
|
|
|
- join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
|
|
|
+ join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
|
|
|
<if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
AND b.company_wechat_id IN
|
|
|
<foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
@@ -629,13 +563,7 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
|
|
|
- <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>
|
|
|
+
|
|
|
LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
|
|
|
<if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
AND f.company_wechat_id IN
|
|
@@ -661,7 +589,7 @@
|
|
|
<if test="streetCode != null and streetCode !=''">
|
|
|
AND a.id = #{streetCode}
|
|
|
</if>
|
|
|
- <if test="dictCode != null and dictCode.size > 0">
|
|
|
+ <if test="sales != null and sales.size > 0">
|
|
|
AND b.dict_code IN
|
|
|
<foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
|
|
|
#{item}
|
|
@@ -679,22 +607,17 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="orderSourceId != null and orderSourceId.size > 0">
|
|
|
- AND e.dict_code in
|
|
|
- <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </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
|
|
|
+ b.dict_value as valueName,
|
|
|
+ b.dict_code as keyId
|
|
|
FROM
|
|
|
region a
|
|
|
- join sys_dict_company b on b.dict_type = 'ORDER_CHANNEL' and b.del = 0
|
|
|
+ join sys_dict_company b on b.dict_type = 'SALES_TYPE' and b.dict_code >= 100 and b.del = 0
|
|
|
<if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
AND b.company_wechat_id IN
|
|
|
<foreach item="item" index="index" collection="adminCompanyIds" open="(" separator="," close=")">
|
|
@@ -715,13 +638,7 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- join sys_dict_company e on e.dict_type = 'WORKER_ORDER_SOURCE' and e.del = 0
|
|
|
- <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>
|
|
|
+
|
|
|
LEFT JOIN websit_dispatch f on a.id = f.street_code and b.dict_code = f.dict_code and c.id = f.order_small_id and d.category_id = f.category_id and e.dict_code = f.order_source_id
|
|
|
<if test="adminCompanyIds != null and adminCompanyIds.size > 0">
|
|
|
AND f.company_wechat_id IN
|
|
@@ -747,7 +664,7 @@
|
|
|
<if test="streetCode != null and streetCode !=''">
|
|
|
AND a.id = #{streetCode}
|
|
|
</if>
|
|
|
- <if test="dictCode != null and dictCode.size > 0">
|
|
|
+ <if test="sales != null and sales.size > 0">
|
|
|
AND b.dict_code IN
|
|
|
<foreach item="item" index="index" collection="dictCode" open="(" separator="," close=")">
|
|
|
#{item}
|
|
@@ -765,12 +682,7 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="orderSourceId != null and orderSourceId.size > 0">
|
|
|
- AND e.dict_code in
|
|
|
- <foreach item="item" index="index" collection="orderSourceId" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
+
|
|
|
|
|
|
group by e.dict_code
|
|
|
</select>
|