Commit d79e7805 by sdif

机构品牌数据统计区分

parent 4bd3a612
......@@ -148,7 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join company on company.id = employees.company_id
WHERE employees.`status` = 1 or employees.`status` = 2
<if test="dataViewBo.userId != null">
and company.id = #{dataViewBo.userId}
and company.uid = #{dataViewBo.userId}
</if>
<if test="dataViewBo.condition == 2">
and employees.create_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) -- 近7天
......
......@@ -98,15 +98,20 @@
</if>
</select>
<select id="selectOrderQuantity" resultType="com.pz.system.domain.vo.DataOrderVo">
SELECT count(*) as dataSum FROM total_order WHERE `status` != 0 and refund_amount = 0
SELECT count(total_order.id) as dataSum FROM total_order left join employees on employees.id = total_order.em_id
left join company on company.id = employees.company_id
WHERE total_order.`status` != 0 and total_order.refund_amount = 0 and total_order.em_id !=0
<if test="dataViewBo.userId != null">
and company.uid = #{dataViewBo.userId}
</if>
<if test="dataViewBo.condition == 2">
and finish_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) -- 近7天
and total_order.finish_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) -- 近7天
</if>
<if test="dataViewBo.condition == 3">
and finish_time >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) -- 近30天
and total_order.finish_time >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) -- 近30天
</if>
<if test="dataViewBo.condition == 1">
and DATE(finish_time) = CURDATE()
and DATE(total_order.finish_time) = CURDATE()
</if>
</select>
......@@ -145,7 +150,7 @@
SELECT IFNULL(ROUND(SUM(employees_divide.divide_price), 2),0) as dataSum FROM
employees_divide
left join total_order on total_order.order_sn = employees_divide.order_id WHERE total_order.`status` = 2 and
refund_amount = 0
refund_amount = 0 and company_id = #{dataViewBo.userId}
<if test="dataViewBo.condition == 2">
and employees_divide.create_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) -- 近7天
</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment