|
@@ -70,13 +70,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
SUM(order_status != 6 AND order_status != 5) AS delivery_num,
|
|
SUM(order_status != 6 AND order_status != 5) AS delivery_num,
|
|
|
SUM(order_status = 5) AS proper_num
|
|
SUM(order_status = 5) AS proper_num
|
|
|
FROM biz_waybill_order d
|
|
FROM biz_waybill_order d
|
|
|
- WHERE d.create_time >=#{startTime} AND d.create_time <![CDATA[<=]]> #{endTime}
|
|
|
|
|
|
|
+ WHERE DATE_FORMAT(d.create_time, '%Y-%m-%d') >=#{startTime} AND DATE_FORMAT(d.create_time, '%Y-%m-%d') <![CDATA[<=]]> #{endTime}
|
|
|
<if test="orderType != null and orderType != ''">
|
|
<if test="orderType != null and orderType != ''">
|
|
|
and d.order_type = #{orderType}
|
|
and d.order_type = #{orderType}
|
|
|
</if>
|
|
</if>
|
|
|
- <!-- <if test="deptId != null and deptId != ''">
|
|
|
|
|
|
|
+ <if test="deptId != null and deptId != ''">
|
|
|
and d.dept_id = #{deptId}
|
|
and d.dept_id = #{deptId}
|
|
|
- </if>-->
|
|
|
|
|
|
|
+ </if>
|
|
|
<!-- 数据范围过滤 -->
|
|
<!-- 数据范围过滤 -->
|
|
|
${params.dataScope}
|
|
${params.dataScope}
|
|
|
|
|
|
|
@@ -174,26 +174,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
lng,
|
|
lng,
|
|
|
lat,count(1) num
|
|
lat,count(1) num
|
|
|
FROM
|
|
FROM
|
|
|
- biz_waybill_order a
|
|
|
|
|
- LEFT JOIN sys_city b ON a.receiver_province = b.NAME
|
|
|
|
|
|
|
+ biz_waybill_order d
|
|
|
|
|
+ LEFT JOIN sys_city b ON d.receiver_province = b.NAME
|
|
|
WHERE
|
|
WHERE
|
|
|
b.LEVEL = 0
|
|
b.LEVEL = 0
|
|
|
- and a.order_status != 6
|
|
|
|
|
|
|
+ and d.order_status != 6
|
|
|
<if test="orderType != null and orderType != ''">
|
|
<if test="orderType != null and orderType != ''">
|
|
|
- and a.order_type = #{orderType}
|
|
|
|
|
|
|
+ and d.order_type = #{orderType}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="startDate != null and startDate != ''">
|
|
|
|
|
- and DATE_FORMAT(a.create_time, '%Y-%m-%d') >= #{startDate}
|
|
|
|
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
|
|
+ and DATE_FORMAT( d.create_time, '%Y-%m-%d') >= #{startTime}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="endDate != null and endDate != ''">
|
|
|
|
|
- and DATE_FORMAT(a.create_time, '%Y-%m-%d')<![CDATA[<=]]> #{endDate}
|
|
|
|
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
|
|
+ and DATE_FORMAT( d.create_time, '%Y-%m-%d')<![CDATA[<=]]> #{endTime}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="deptId != null and deptId != ''">
|
|
<if test="deptId != null and deptId != ''">
|
|
|
- and a.dept_id = #{deptId}
|
|
|
|
|
|
|
+ and d.dept_id = #{deptId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="searchProvince != null and searchProvince != ''">
|
|
<if test="searchProvince != null and searchProvince != ''">
|
|
|
- and a.sender_province = #{searchProvince}
|
|
|
|
|
|
|
+ and d.sender_province = #{searchProvince}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ ${params.dataScope}
|
|
|
group by receiver_province
|
|
group by receiver_province
|
|
|
</select>
|
|
</select>
|
|
|
<!-- 物流轨迹省份查询流入-->
|
|
<!-- 物流轨迹省份查询流入-->
|
|
@@ -203,26 +204,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
lng,
|
|
lng,
|
|
|
lat ,count(1) num
|
|
lat ,count(1) num
|
|
|
FROM
|
|
FROM
|
|
|
- biz_waybill_order a
|
|
|
|
|
- LEFT JOIN sys_city b ON a.sender_province = b.NAME
|
|
|
|
|
|
|
+ biz_waybill_order d
|
|
|
|
|
+ LEFT JOIN sys_city b ON d.sender_province = b.NAME
|
|
|
WHERE
|
|
WHERE
|
|
|
b.LEVEL = 0
|
|
b.LEVEL = 0
|
|
|
- and a.order_status != 6
|
|
|
|
|
|
|
+ and d.order_status != 6
|
|
|
<if test="orderType != null and orderType != ''">
|
|
<if test="orderType != null and orderType != ''">
|
|
|
- and a.order_type = #{orderType}
|
|
|
|
|
|
|
+ and d.order_type = #{orderType}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="startDate != null and startDate != ''">
|
|
|
|
|
- and DATE_FORMAT(a.create_time, '%Y-%m-%d') >= #{startDate}
|
|
|
|
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
|
|
+ and DATE_FORMAT(d.create_time, '%Y-%m-%d') >= #{startTime}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="endDate != null and endDate != ''">
|
|
|
|
|
- and DATE_FORMAT(a.create_time, '%Y-%m-%d')<![CDATA[<=]]> #{endDate}
|
|
|
|
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
|
|
+ and DATE_FORMAT(d.create_time, '%Y-%m-%d')<![CDATA[<=]]> #{endTime}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="deptId != null and deptId != ''">
|
|
<if test="deptId != null and deptId != ''">
|
|
|
- and a.dept_id = #{deptId}
|
|
|
|
|
|
|
+ and d.dept_id = #{deptId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="searchProvince != null and searchProvince != ''">
|
|
<if test="searchProvince != null and searchProvince != ''">
|
|
|
- and a.receiver_province = #{searchProvince}
|
|
|
|
|
|
|
+ and d.receiver_province = #{searchProvince}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ ${params.dataScope}
|
|
|
group by sender_province
|
|
group by sender_province
|
|
|
|
|
|
|
|
</select>
|
|
</select>
|
|
@@ -281,11 +283,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="orderType != null and orderType != ''">
|
|
<if test="orderType != null and orderType != ''">
|
|
|
and d.order_type = #{orderType}
|
|
and d.order_type = #{orderType}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="startDate != null and startDate != ''">
|
|
|
|
|
- and DATE_FORMAT(d.create_time, '%Y-%m-%d') >= #{startDate}
|
|
|
|
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
|
|
+ and DATE_FORMAT(d.create_time, '%Y-%m-%d') >= #{startTime}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="endDate != null and endDate != ''">
|
|
|
|
|
- and DATE_FORMAT(d.create_time, '%Y-%m-%d')<![CDATA[<=]]> #{endDate}
|
|
|
|
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
|
|
+ and DATE_FORMAT(d.create_time, '%Y-%m-%d')<![CDATA[<=]]> #{endTime}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="deptId != null and deptId != ''">
|
|
<if test="deptId != null and deptId != ''">
|
|
|
and d.dept_id = #{deptId}
|
|
and d.dept_id = #{deptId}
|
|
@@ -371,11 +373,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="orderType != null and orderType != ''">
|
|
<if test="orderType != null and orderType != ''">
|
|
|
and order_type = #{orderType}
|
|
and order_type = #{orderType}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="startDate != null and startDate != ''">
|
|
|
|
|
- and DATE_FORMAT(create_time, '%Y-%m-%d') >= #{startDate}
|
|
|
|
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
|
|
+ and DATE_FORMAT(create_time, '%Y-%m-%d') >= #{startTime}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="endDate != null and endDate != ''">
|
|
|
|
|
- and DATE_FORMAT(create_time, '%Y-%m-%d')<![CDATA[<=]]> #{endDate}
|
|
|
|
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
|
|
+ and DATE_FORMAT(create_time, '%Y-%m-%d')<![CDATA[<=]]> #{endTime}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="deptId != null and deptId != ''">
|
|
<if test="deptId != null and deptId != ''">
|
|
|
and dept_id = #{deptId}
|
|
and dept_id = #{deptId}
|
|
@@ -383,6 +385,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
GROUP BY
|
|
GROUP BY
|
|
|
dept_id
|
|
dept_id
|
|
|
) q ON w.dept_id = q.dept_id
|
|
) q ON w.dept_id = q.dept_id
|
|
|
|
|
+
|
|
|
|
|
+ where w.del_flag='0'
|
|
|
|
|
+ and w.status='0'
|
|
|
ORDER BY
|
|
ORDER BY
|
|
|
num DESC
|
|
num DESC
|
|
|
) t,
|
|
) t,
|
|
@@ -400,8 +405,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
t1.rate_amount,
|
|
t1.rate_amount,
|
|
|
IFNULL(t2.rate_amount, 0) AS last_month_amount,
|
|
IFNULL(t2.rate_amount, 0) AS last_month_amount,
|
|
|
CASE
|
|
CASE
|
|
|
- WHEN IFNULL(t2.rate_amount, 0) = 0 THEN 0
|
|
|
|
|
- ELSE ROUND((t1.rate_amount - t2.rate_amount) / t2.rate_amount * 100, 2)
|
|
|
|
|
|
|
+ WHEN IFNULL(t2.rate_amount, 0) = 0 and IFNULL(t1.rate_amount, 0) = 0 then 0
|
|
|
|
|
+ WHEN IFNULL(t2.rate_amount, 0) = 0 and IFNULL(t1.rate_amount, 0) !=0 then 100
|
|
|
|
|
+ ELSE ROUND((t1.rate_amount - t2.rate_amount) / t2.rate_amount * 100 , 2)
|
|
|
END AS growth_rate
|
|
END AS growth_rate
|
|
|
FROM (
|
|
FROM (
|
|
|
SELECT
|
|
SELECT
|
|
@@ -416,12 +422,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN (
|
|
LEFT JOIN (
|
|
|
SELECT
|
|
SELECT
|
|
|
SUM(IFNULL(a.adjust_amount, a.rate_amount)) rate_amount,
|
|
SUM(IFNULL(a.adjust_amount, a.rate_amount)) rate_amount,
|
|
|
- DATE_FORMAT(b.create_time, '%Y-%m') AS month
|
|
|
|
|
|
|
+ DATE_FORMAT(d.create_time, '%Y-%m') AS month
|
|
|
FROM biz_waybill_cost_details a
|
|
FROM biz_waybill_cost_details a
|
|
|
- LEFT JOIN biz_waybill_order b ON a.external_waybill_no = b.external_waybill_no
|
|
|
|
|
- WHERE b.order_status != 6
|
|
|
|
|
- AND b.dept_id = #{deptId}
|
|
|
|
|
- GROUP BY DATE_FORMAT(b.create_time, '%Y-%m')
|
|
|
|
|
|
|
+ LEFT JOIN biz_waybill_order d ON a.external_waybill_no = d.external_waybill_no
|
|
|
|
|
+ WHERE d.order_status != 6
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <if test="orderType != null and orderType != ''">
|
|
|
|
|
+ and d.order_type = #{orderType}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
|
|
+ and DATE_FORMAT(d.create_time, '%Y-%m-%d') >= #{startDate}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
|
|
+ and DATE_FORMAT(d.create_time, '%Y-%m-%d')<![CDATA[<=]]> #{endDate}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="deptId != null and deptId != ''">
|
|
|
|
|
+ AND d.dept_id = #{deptId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!-- 数据范围过滤 -->
|
|
|
|
|
+ ${params.dataScope}
|
|
|
|
|
+ GROUP BY DATE_FORMAT(d.create_time, '%Y-%m')
|
|
|
) data ON months.month = data.month
|
|
) data ON months.month = data.month
|
|
|
) t1
|
|
) t1
|
|
|
LEFT JOIN (
|
|
LEFT JOIN (
|
|
@@ -437,12 +458,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN (
|
|
LEFT JOIN (
|
|
|
SELECT
|
|
SELECT
|
|
|
SUM(IFNULL(a.adjust_amount, a.rate_amount)) rate_amount,
|
|
SUM(IFNULL(a.adjust_amount, a.rate_amount)) rate_amount,
|
|
|
- DATE_FORMAT(b.create_time, '%Y-%m') AS month
|
|
|
|
|
|
|
+ DATE_FORMAT(d.create_time, '%Y-%m') AS month
|
|
|
FROM biz_waybill_cost_details a
|
|
FROM biz_waybill_cost_details a
|
|
|
- LEFT JOIN biz_waybill_order b ON a.external_waybill_no = b.external_waybill_no
|
|
|
|
|
- WHERE b.order_status != 6
|
|
|
|
|
- AND b.dept_id = #{deptId}
|
|
|
|
|
- GROUP BY DATE_FORMAT(b.create_time, '%Y-%m')
|
|
|
|
|
|
|
+ LEFT JOIN biz_waybill_order d ON a.external_waybill_no = d.external_waybill_no
|
|
|
|
|
+ WHERE d.order_status != 6
|
|
|
|
|
+ <if test="orderType != null and orderType != ''">
|
|
|
|
|
+ and d.order_type = #{orderType}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
|
|
+ and DATE_FORMAT(d.create_time, '%Y-%m-%d') >= #{startDate}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
|
|
+ and DATE_FORMAT(d.create_time, '%Y-%m-%d')<![CDATA[<=]]> #{endDate}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="deptId != null and deptId != ''">
|
|
|
|
|
+ AND d.dept_id = #{deptId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <!-- 数据范围过滤 -->
|
|
|
|
|
+ ${params.dataScope}
|
|
|
|
|
+ GROUP BY DATE_FORMAT(d.create_time, '%Y-%m')
|
|
|
) data ON months.month = data.month
|
|
) data ON months.month = data.month
|
|
|
) t2 ON t1.month = DATE_FORMAT(STR_TO_DATE(CONCAT(t2.month, '-01'), '%Y-%m-%d') + INTERVAL 1 MONTH, '%Y-%m')
|
|
) t2 ON t1.month = DATE_FORMAT(STR_TO_DATE(CONCAT(t2.month, '-01'), '%Y-%m-%d') + INTERVAL 1 MONTH, '%Y-%m')
|
|
|
ORDER BY t1.month;
|
|
ORDER BY t1.month;
|