|
@@ -1141,7 +1141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND u.company_name like concat('%', #{companyName}, '%')
|
|
|
</if>
|
|
|
<if test="searchKey != null and searchKey != ''">
|
|
|
- AND (u.realname like concat('%', #{searchKey}, '%') or o.order_sn = #{searchKey} or u.id_card = #{searchKey} or g.goods_name like concat('%', #{searchKey}, '%'))
|
|
|
+ AND (u.realname like concat('%', #{searchKey}, '%') or o.order_sn = #{searchKey} or AES_DECRYPT(UNHEX(u.id_card),'base20230213zzkj') = #{searchKey} or g.goods_name like concat('%', #{searchKey}, '%'))
|
|
|
</if>
|
|
|
<if test="orderGoodsIds != null ">
|
|
|
AND og.order_goods_id in
|
|
@@ -1158,4 +1158,76 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
ORDER BY o.order_id DESC
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getUserStudyCondition" parameterType="com.zhongzheng.modules.order.bo.UserStudyConditionBo" resultType="com.zhongzheng.modules.order.vo.UserStudyConditionVo">
|
|
|
+ SELECT
|
|
|
+ o.order_sn,
|
|
|
+ FROM_UNIXTIME( og.create_time, '%Y-%m-%d %H:%i:%s' ) AS orderTime,
|
|
|
+ u.realname AS userName,
|
|
|
+ AES_DECRYPT(UNHEX(u.id_card),'base20230213zzkj') AS userCard,
|
|
|
+ AES_DECRYPT(UNHEX(u.telphone),'base20230213zzkj') AS userPhone,
|
|
|
+ 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 majorName,
|
|
|
+ cg.class_name AS className,
|
|
|
+ CASE
|
|
|
+ WHEN cg.class_status = 1 THEN '已开班'
|
|
|
+ WHEN cg.class_status = 0 THEN '未开班'
|
|
|
+ ELSE '其他' END AS classStatus,
|
|
|
+ FROM_UNIXTIME( cg.class_end_time, '%Y-%m-%d %H:%i:%s' ) AS classEndTime,
|
|
|
+ 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
|
|
|
+ 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
|
|
|
+ 1=1
|
|
|
+ AND og.pay_status != 1
|
|
|
+ AND og.refund_status != 2
|
|
|
+ AND o.`status` = 1
|
|
|
+ AND og.`status` = 1
|
|
|
+ AND cgu.`status` = 1
|
|
|
+ <if test="tenantId != null and tenantId != ''">
|
|
|
+ AND o.tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
+ <if test="userCard != null and userCard != ''">
|
|
|
+ AND AES_DECRYPT(UNHEX(u.id_card),'base20230213zzkj') = #{userCard}
|
|
|
+ </if>
|
|
|
+ <if test="userName != null and userName != ''">
|
|
|
+ AND u.realname = #{userName}
|
|
|
+ </if>
|
|
|
+ <if test="companyName != null and companyName != ''">
|
|
|
+ AND u.company_name = #{companyName}
|
|
|
+ </if>
|
|
|
+ <if test="businessName != null and businessName != ''">
|
|
|
+ AND INSTR(CONCAT(cet.education_name,cb.business_name,cpt.project_name),#{businessName})
|
|
|
+ </if>
|
|
|
+ <if test="majorName != null and majorName != ''">
|
|
|
+ AND m.category_name = #{majorName}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|