|
@@ -735,34 +735,115 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</foreach>
|
|
|
</select>
|
|
|
|
|
|
+<!-- <select id="exportNew" resultType="com.zhongzheng.modules.order.vo.OrderExportNewVo"-->
|
|
|
+<!-- parameterType="com.zhongzheng.modules.order.bo.OrderExportNewBo">-->
|
|
|
+<!-- SELECT-->
|
|
|
+<!-- FROM_UNIXTIME( og.create_time, '%Y-%m-%d %H:%i:%s' ) AS orderTime,-->
|
|
|
+<!-- u.realname AS realname,-->
|
|
|
+<!-- AES_DECRYPT( UNHEX( u.id_card ), 'base20230213zzkj' ) AS idCard,-->
|
|
|
+<!-- AES_DECRYPT( UNHEX( u.telphone ), 'base20230213zzkj' ) AS telphone,-->
|
|
|
+<!-- u.company_name AS companyName,-->
|
|
|
+<!-- m.category_name AS majorName,-->
|
|
|
+<!-- g.seven_year AS goodsYear,-->
|
|
|
+<!-- CASE-->
|
|
|
+<!-- WHEN og.`status` = 1 THEN-->
|
|
|
+<!-- '否'-->
|
|
|
+<!-- WHEN og.`status` = 0 THEN-->
|
|
|
+<!-- '是' ELSE '其他'-->
|
|
|
+<!-- END AS orderStatus-->
|
|
|
+<!-- FROM-->
|
|
|
+<!-- order_goods og-->
|
|
|
+<!-- LEFT JOIN `order` o ON og.order_sn = o.order_sn-->
|
|
|
+<!-- LEFT JOIN `user` u ON o.user_id = u.user_id-->
|
|
|
+<!-- LEFT JOIN goods g ON og.goods_id = g.goods_id-->
|
|
|
+<!-- LEFT JOIN major m ON g.major_id = m.id-->
|
|
|
+<!-- WHERE-->
|
|
|
+<!-- og.refund_status != 2-->
|
|
|
+<!-- AND og.pay_status != 1-->
|
|
|
+<!-- <if test="orderSn != null and orderSn != ''">-->
|
|
|
+<!-- AND o.order_sn = #{orderSn}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="orderStartTime != null and orderStartTime != ''">-->
|
|
|
+<!-- AND og.create_time <![CDATA[ >= ]]> #{orderStartTime}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="orderEndTime != null and orderEndTime != ''">-->
|
|
|
+<!-- AND og.create_time <![CDATA[ <= ]]> #{orderEndTime}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="educationTypeId != null and educationTypeId != ''">-->
|
|
|
+<!-- AND g.education_type_id = #{educationTypeId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="businessId != null and businessId != ''">-->
|
|
|
+<!-- AND g.business_id = #{businessId}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- <if test="companyName != null and companyName != ''">-->
|
|
|
+<!-- AND u.company_name = #{companyName}-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- </select>-->
|
|
|
+
|
|
|
<select id="exportNew" resultType="com.zhongzheng.modules.order.vo.OrderExportNewVo"
|
|
|
parameterType="com.zhongzheng.modules.order.bo.OrderExportNewBo">
|
|
|
SELECT
|
|
|
- FROM_UNIXTIME( og.create_time, '%Y-%m-%d %H:%i:%s' ) AS orderTime,
|
|
|
- u.realname AS realname,
|
|
|
- AES_DECRYPT( UNHEX( u.id_card ), 'base20230213zzkj' ) AS idCard,
|
|
|
- AES_DECRYPT( UNHEX( u.telphone ), 'base20230213zzkj' ) AS telphone,
|
|
|
- u.company_name AS companyName,
|
|
|
- m.category_name AS majorName,
|
|
|
- g.seven_year AS goodsYear,
|
|
|
- CASE
|
|
|
- WHEN og.`status` = 1 THEN
|
|
|
- '否'
|
|
|
- WHEN og.`status` = 0 THEN
|
|
|
- '是' ELSE '其他'
|
|
|
- END AS orderStatus
|
|
|
+ o.order_sn,
|
|
|
+ FROM_UNIXTIME( og.create_time, '%Y-%m-%d %H:%i:%s' ) AS orderTime,
|
|
|
+ u.realname,
|
|
|
+ AES_DECRYPT(UNHEX(u.id_card),'base20230213zzkj') AS idCard,
|
|
|
+ AES_DECRYPT(UNHEX(u.telphone),'base20230213zzkj') AS telphone,
|
|
|
+ u.company_name AS companyName,
|
|
|
+ g.goods_name AS goodsName,
|
|
|
+ g.seven_year AS sevenYear,
|
|
|
+ CONCAT(cet.education_name,cb.business_name,cpt.project_name) AS businessName,
|
|
|
+ m.category_name AS categoryName,
|
|
|
+ cg.class_name AS className,
|
|
|
+ CASE
|
|
|
+ WHEN cg.class_status = 1 THEN '已开班'
|
|
|
+ WHEN cg.class_status = 0 THEN '未开班'
|
|
|
+ ELSE '其他' END AS classStart,
|
|
|
+ FROM_UNIXTIME( cg.class_end_time, '%Y-%m-%d %H:%i:%s' ) AS classEndTime,
|
|
|
+ CASE
|
|
|
+ WHEN o.order_status = 0 THEN '待支付'
|
|
|
+ WHEN o.order_status = 1 THEN '已支付'
|
|
|
+ WHEN o.order_status = -1 OR o.order_status = -2 THEN '已关闭'
|
|
|
+ WHEN o.order_status = 3 OR o.order_status = 4 THEN '已退款'
|
|
|
+ ELSE '其他' END AS orderStatus,
|
|
|
+ CONCAT((
|
|
|
+ ((SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr where ubr.`status`=1 and ubr.report_status=1 and ubr.grade_id = og.grade_id and ubr.order_goods_id = og.order_goods_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) +
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ COUNT( DISTINCT course_id, module_id, chapter_id, section_id )
|
|
|
FROM
|
|
|
- order_goods og
|
|
|
- LEFT JOIN `order` o ON og.order_sn = o.order_sn
|
|
|
- LEFT JOIN `user` u ON o.user_id = u.user_id
|
|
|
+ user_study_record
|
|
|
+ WHERE
|
|
|
+ current_status = 1
|
|
|
+ AND grade_id = og.grade_id
|
|
|
+ AND order_goods_id = og.order_goods_id
|
|
|
+ AND user_id = o.user_id
|
|
|
+ AND status = 1
|
|
|
+ AND goods_id = og.goods_id
|
|
|
+ ))),"/",og.course_num + og.exam_num) AS studySchedule
|
|
|
+ FROM
|
|
|
+ `order` o
|
|
|
+ LEFT JOIN order_goods og ON o.order_sn = og.order_sn
|
|
|
LEFT JOIN goods g ON og.goods_id = g.goods_id
|
|
|
+ LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
|
|
|
+ LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
|
|
|
+ LEFT JOIN course_business cb ON g.business_id = cb.id
|
|
|
LEFT JOIN major m ON g.major_id = m.id
|
|
|
+ LEFT JOIN `user` u ON o.user_id = u.user_id
|
|
|
+ LEFT JOIN class_grade_user cgu ON og.order_goods_id = cgu.order_goods_id
|
|
|
+ LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
|
|
|
WHERE
|
|
|
- og.refund_status != 2
|
|
|
- AND og.pay_status != 1
|
|
|
+ 1=1
|
|
|
+ AND og.`status` = 1
|
|
|
+ AND o.input_order_sn IS NULL
|
|
|
<if test="orderSn != null and orderSn != ''">
|
|
|
AND o.order_sn = #{orderSn}
|
|
|
</if>
|
|
|
+ <if test="orderSnList != null and orderSnList.size()!=0">
|
|
|
+ AND o.order_sn in
|
|
|
+ <foreach collection="orderSnList" item="item" index="index" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
<if test="orderStartTime != null and orderStartTime != ''">
|
|
|
AND og.create_time <![CDATA[ >= ]]> #{orderStartTime}
|
|
|
</if>
|
|
@@ -778,6 +859,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="companyName != null and companyName != ''">
|
|
|
AND u.company_name = #{companyName}
|
|
|
</if>
|
|
|
+ ORDER BY og.create_time DESC
|
|
|
</select>
|
|
|
|
|
|
<select id="getSevenOrder" parameterType="com.zhongzheng.modules.order.bo.RepetitionOrderBo"
|