|
@@ -46,25 +46,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="selectList" parameterType="com.zhongzheng.modules.order.bo.OrderInputQueryBo" resultMap="OrderInputVoResult">
|
|
|
- SELECT
|
|
|
- oi.input_order_sn,
|
|
|
- count( DISTINCT o.user_id ) user_num,
|
|
|
- count( DISTINCT og.goods_id ) goods_num,
|
|
|
- any_value ( cet.education_name ) education_name,
|
|
|
- any_value ( cpt.project_name ) project_name,
|
|
|
- any_value ( cb.business_name ) business_name,
|
|
|
- sum( og.goods_received ) goods_received,
|
|
|
- sum( o.order_price ) order_price,
|
|
|
- sum( o.pay_price ) pay_price,
|
|
|
- any_value ( oi.create_username ) create_username,
|
|
|
- any_value ( oi.create_time ) create_time
|
|
|
+ SELECT u.input_order_sn,
|
|
|
+ any_value (u.user_num ) user_num,
|
|
|
+ count( DISTINCT og.goods_id ) goods_num,
|
|
|
+ any_value ( cet.education_name ) education_name,
|
|
|
+ any_value ( cpt.project_name ) project_name,
|
|
|
+ any_value ( cb.business_name ) business_name,
|
|
|
+ sum( og.goods_received ) goods_received,
|
|
|
+ any_value (u.order_price ) order_price,
|
|
|
+ any_value (u.pay_price) pay_price,
|
|
|
+ any_value ( u.create_username ) create_username,
|
|
|
+ any_value ( u.create_time ) create_time FROM (SELECT
|
|
|
+ oi.*,
|
|
|
+ count( DISTINCT o.user_id ) user_num,
|
|
|
+ sum( o.order_price ) order_price,
|
|
|
+ sum( o.pay_price ) pay_price,
|
|
|
+ o.order_sn
|
|
|
FROM
|
|
|
- order_input oi
|
|
|
- LEFT JOIN `order` o ON oi.input_order_sn = o.input_order_sn
|
|
|
- LEFT JOIN order_goods og ON o.order_sn = og.order_sn
|
|
|
- LEFT JOIN course_education_type cet ON oi.education_type_id = cet.id
|
|
|
- LEFT JOIN course_project_type cpt ON oi.project_id = cpt.id
|
|
|
- LEFT JOIN course_business cb ON oi.business_id = cb.id
|
|
|
+ order_input oi
|
|
|
+ LEFT JOIN `order` o ON oi.input_order_sn = o.input_order_sn
|
|
|
where 1=1
|
|
|
<if test="businessId != null and businessId != ''">
|
|
|
AND oi.business_id = #{businessId}
|
|
@@ -78,8 +78,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
AND #{endTime} >= oi.create_time
|
|
|
</if>
|
|
|
+ GROUP BY oi.id,o.order_sn)u LEFT JOIN order_goods og ON u.order_sn = og.order_sn
|
|
|
+ LEFT JOIN course_education_type cet ON u.education_type_id = cet.id
|
|
|
+ LEFT JOIN course_project_type cpt ON u.project_id = cpt.id
|
|
|
+ LEFT JOIN course_business cb ON u.business_id = cb.id
|
|
|
+ where 1=1
|
|
|
GROUP BY
|
|
|
- oi.input_order_sn
|
|
|
+ u.input_order_sn
|
|
|
ORDER BY create_time DESC
|
|
|
</select>
|
|
|
|