|
|
@@ -17,7 +17,130 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="projectId" column="project_id"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <resultMap type="com.zhongzheng.modules.order.vo.OrderInputVo" id="OrderInputVoResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="inputOrderSn" column="input_order_sn"/>
|
|
|
+ <result property="createUsername" column="create_username"/>
|
|
|
+ <result property="status" column="status"/>
|
|
|
+ <result property="createSysUserId" column="create_sys_user_id"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="educationTypeId" column="education_type_id"/>
|
|
|
+ <result property="businessId" column="business_id"/>
|
|
|
+ <result property="projectId" column="project_id"/>
|
|
|
+ <result property="educationName" column="education_name"/>
|
|
|
+ <result property="projectName" column="project_name"/>
|
|
|
+ <result property="businessName" column="business_name"/>
|
|
|
+ <result property="userNum" column="user_num"/>
|
|
|
+ <result property="goodsNum" column="goods_num"/>
|
|
|
+ <result property="goodsReceived" column="goods_received"/>
|
|
|
+ <result property="orderPrice" column="order_price"/>
|
|
|
+ <result property="payPrice" column="pay_price"/>
|
|
|
+ <result property="realname" column="realname"/>
|
|
|
+ <result property="idCard" column="id_card"/>
|
|
|
+ <result property="goodsId" column="goods_id"/>
|
|
|
+ <result property="goodsName" column="goods_name"/>
|
|
|
+ <result property="orderSn" column="order_sn"/>
|
|
|
+ <result property="userId" column="user_id"/>
|
|
|
+ </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
|
|
|
+ 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
|
|
|
+ where 1=1
|
|
|
+ <if test="businessId != null and businessId != ''">
|
|
|
+ AND oi.business_id = #{businessId}
|
|
|
+ </if>
|
|
|
+ <if test="searchKey != null and searchKey != ''">
|
|
|
+ AND (oi.create_username like concat('%', #{searchKey}, '%') or oi.input_order_sn = #{searchKey})
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ AND oi.create_time >= #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ AND #{endTime} >= oi.create_time
|
|
|
+ </if>
|
|
|
+ GROUP BY
|
|
|
+ oi.input_order_sn
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="getInfo" 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,
|
|
|
+ any_value ( oi.project_id ) project_id,
|
|
|
+ any_value ( oi.business_id ) business_id,
|
|
|
+ any_value ( oi.education_type_id ) education_type_id
|
|
|
+ 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
|
|
|
+ where 1=1
|
|
|
+ AND oi.input_order_sn = #{inputOrderSn}
|
|
|
+ GROUP BY
|
|
|
+ oi.input_order_sn
|
|
|
+ </select>
|
|
|
|
|
|
+ <select id="getUserList" parameterType="com.zhongzheng.modules.order.bo.OrderInputQueryBo" resultMap="OrderInputVoResult">
|
|
|
+ SELECT
|
|
|
+ o.user_id,
|
|
|
+ u.realname,
|
|
|
+ u.id_card
|
|
|
+ FROM
|
|
|
+ order_input oi
|
|
|
+ LEFT JOIN `order` o ON oi.input_order_sn = o.input_order_sn
|
|
|
+ LEFT JOIN `user` u ON o.user_id = u.user_id
|
|
|
+ WHERE
|
|
|
+ 1 = 1
|
|
|
+ AND oi.input_order_sn = #{inputOrderSn}
|
|
|
+ GROUP BY
|
|
|
+ o.user_id
|
|
|
+ </select>
|
|
|
|
|
|
+ <select id="getUserGoodsList" parameterType="com.zhongzheng.modules.order.bo.OrderInputQueryBo" resultMap="OrderInputVoResult">
|
|
|
+ SELECT
|
|
|
+ o.user_id,
|
|
|
+ g.goods_id,
|
|
|
+ g.goods_name,
|
|
|
+ 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 goods g ON og.goods_id = g.goods_id
|
|
|
+ WHERE
|
|
|
+ 1 = 1
|
|
|
+ AND oi.input_order_sn = #{inputOrderSn}
|
|
|
+ and o.user_id = #{userId}
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|