|
@@ -170,6 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="reason" column="reason"/>
|
|
<result property="reason" column="reason"/>
|
|
|
<result property="projectName" column="project_name"/>
|
|
<result property="projectName" column="project_name"/>
|
|
|
<result property="businessName" column="business_name"/>
|
|
<result property="businessName" column="business_name"/>
|
|
|
|
|
+ <result property="educationName" column="education_name"/>
|
|
|
<result property="sevenYear" column="seven_year"/>
|
|
<result property="sevenYear" column="seven_year"/>
|
|
|
<result property="orgId" column="org_id"/>
|
|
<result property="orgId" column="org_id"/>
|
|
|
|
|
|
|
@@ -182,6 +183,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="expendBefore" column="expend_before"/>
|
|
<result property="expendBefore" column="expend_before"/>
|
|
|
<result property="periodPlushMsg" column="official_status_msg"/>
|
|
<result property="periodPlushMsg" column="official_status_msg"/>
|
|
|
<result property="officialStatusMsg" column="period_plush_msg"/>
|
|
<result property="officialStatusMsg" column="period_plush_msg"/>
|
|
|
|
|
+ <result property="companyName" column="company_name"/>
|
|
|
|
|
+ <result property="gradeName" column="class_name"/>
|
|
|
|
|
+ <result property="endTime" column="end_time"/>
|
|
|
|
|
+ <result property="profileStatus" column="profile_status"/>
|
|
|
|
|
+ <result property="classStatus" column="class_status"/>
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -562,6 +568,167 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
order by user_info_status desc ,user_status desc ,cgu.id desc
|
|
order by user_info_status desc ,user_status desc ,cgu.id desc
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
+ <select id="listGradeAll" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultMap="ClassGradeStudentVo">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ cgu.id,
|
|
|
|
|
+ cgu.official_status_time,
|
|
|
|
|
+ cgu.official_status_num,
|
|
|
|
|
+ u.user_account,
|
|
|
|
|
+ u.user_id,
|
|
|
|
|
+ u.company_name,
|
|
|
|
|
+ cgu.`status`,
|
|
|
|
|
+ u.realname,
|
|
|
|
|
+ og.goods_id,
|
|
|
|
|
+ u.id_card,
|
|
|
|
|
+ cgu.grade_id,
|
|
|
|
|
+ u.telphone,
|
|
|
|
|
+ g.class_hours,
|
|
|
|
|
+ cgu.period_status,
|
|
|
|
|
+ cgu.finish_status,
|
|
|
|
|
+ cgu.period_plush,
|
|
|
|
|
+ g.study_start_time,
|
|
|
|
|
+ g.study_end_time,
|
|
|
|
|
+ cg.class_start_time,
|
|
|
|
|
+ cg.class_end_time,
|
|
|
|
|
+ cg.class_status,
|
|
|
|
|
+ cg.interface_push_id,
|
|
|
|
|
+ cgu.official_status,
|
|
|
|
|
+ cgu.official_status_msg,
|
|
|
|
|
+ cgu.period_plush_msg,
|
|
|
|
|
+ cgu.learn_status,
|
|
|
|
|
+ cgu.period_wait_time as end_time,
|
|
|
|
|
+ (case WHEN (select COUNT(uu.id) FROM user_update uu where cgu.user_id = uu.user_id and uu.status = 2) >0 then 1 ELSE 0 end) as user_status,
|
|
|
|
|
+ (SELECT COUNT(m.id) FROM course_menu_exam m LEFT JOIN goods_course c on m.course_id=c.course_id where c.goods_id=og.goods_id and m.type in (1,3) ) as exam_num,
|
|
|
|
|
+ (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr where ubr.`status`=1 and ubr.type in (1,3) and ubr.user_id = u.user_id and ubr.grade_id = cgu.grade_id and ubr.order_goods_id = cgu.order_goods_id and ubr.report_status=1 and ubr.current_status = 1) as record_num,
|
|
|
|
|
+ (og.study_count) as study_count,
|
|
|
|
|
+ og.order_goods_id,
|
|
|
|
|
+ og.rebuy_order_goods_id,
|
|
|
|
|
+ og.service_start_time,
|
|
|
|
|
+ og.service_end_time,
|
|
|
|
|
+ g.goods_name,
|
|
|
|
|
+ og.order_sn,
|
|
|
|
|
+ og.seven_year,
|
|
|
|
|
+ m.category_name,
|
|
|
|
|
+ g.major_id,
|
|
|
|
|
+ u.province,
|
|
|
|
|
+ cg.class_name,
|
|
|
|
|
+ cgu.reason,
|
|
|
|
|
+ cgu.tenant_id as org_id,
|
|
|
|
|
+ cb.business_name,
|
|
|
|
|
+ cpt.project_name,
|
|
|
|
|
+ (SELECT IFNULL(SUM(usr.study_duration),0) from user_study_record usr where usr.user_id = cgu.user_id and usr.grade_id = cgu.grade_id) as user_study_duration,
|
|
|
|
|
+ (SELECT count(*) from class_grade_user cgu where cgu.order_goods_id = og.order_goods_id) as use_study_count,
|
|
|
|
|
+ ueg.exam_number,
|
|
|
|
|
+ ueg.do_number,
|
|
|
|
|
+ ueg.expend_number,
|
|
|
|
|
+ ueg.expend_before,
|
|
|
|
|
+ up.`status` as profile_status,
|
|
|
|
|
+ cet.education_name
|
|
|
|
|
+ FROM
|
|
|
|
|
+ class_grade_user cgu
|
|
|
|
|
+ LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
|
|
|
|
|
+ LEFT JOIN `user` u ON u.user_id = cgu.user_id
|
|
|
|
|
+ LEFT JOIN order_goods og on cgu.order_goods_id = og.order_goods_id
|
|
|
|
|
+ LEFT JOIN goods g on og.goods_id = g.goods_id
|
|
|
|
|
+ LEFT JOIN major m ON g.major_id = m.id
|
|
|
|
|
+ LEFT JOIN course_business cb ON g.business_id = cb.id
|
|
|
|
|
+ LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
|
|
|
|
|
+ LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
|
|
|
|
|
+ LEFT JOIN user_exam_goods ueg ON ueg.order_goods_id = og.order_goods_id
|
|
|
|
|
+ LEFT JOIN user_profile up on cgu.order_goods_id = up.order_goods_id and up.type_status=1 and up.current_status = 1
|
|
|
|
|
+ where 1=1 and cgu.`status` = 1
|
|
|
|
|
+ <if test="sevenCode != null and sevenCode !='' ">
|
|
|
|
|
+ AND cg.seven_code = #{sevenCode}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="gradeId != null and gradeId !='' and (sevenCode == null or sevenCode =='')">
|
|
|
|
|
+ and cgu.grade_id = #{gradeId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="choice != null and choice == 1 ">
|
|
|
|
|
+ and (SELECT COUNT(cge.grade_id) FROM class_grade cge LEFT JOIN class_grade_user cgur on cge.grade_id = cgur.grade_id where cgu.user_id =cgur.user_id and cgur.order_goods_id = cgu.order_goods_id AND (unix_timestamp(now()) < cge.class_end_time or cge.class_start_time is null) and cge.`status`=1 and cgur.`status` =1)= 0 and cgu.period_status=0
|
|
|
|
|
+ AND (SELECT COUNT(cgde.grade_id) FROM class_grade cgde where cgde.grade_id = cg.grade_id and (unix_timestamp(now()) < cgde.class_end_time or cgde.class_start_time is null)) =0
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="choice != null and choice == 2 ">
|
|
|
|
|
+ and (SELECT COUNT(cge.grade_id) FROM class_grade cge LEFT JOIN class_grade_user cgur on cge.grade_id = cgur.grade_id where cgu.user_id =cgur.user_id and cgur.order_goods_id = cgu.order_goods_id AND (unix_timestamp(now()) < cge.class_end_time or cge.class_start_time is null)
|
|
|
|
|
+ and cge.`status`=1 and cgur.`status` =1)> 0
|
|
|
|
|
+ AND (SELECT COUNT(cgde.grade_id) FROM class_grade cgde where cgde.grade_id = cg.grade_id and (unix_timestamp(now()) < cgde.class_end_time or cgde.class_start_time is null)) =0
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="studyCountMore != null and studyCountMore == 2 ">
|
|
|
|
|
+ AND og.study_count > 0 AND cgu.change_grade = 0 AND (cg.status = 0 or unix_timestamp(now()) > cg.class_end_time)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="studyCountMore != null and studyCountMore == 1 ">
|
|
|
|
|
+ AND og.study_count > 0 AND cgu.change_grade = 1
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="studyCountMore != null and studyCountMore == 0 ">
|
|
|
|
|
+ AND og.study_count = 0
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="officialStatus != null and officialStatus == 1 ">
|
|
|
|
|
+ AND cgu.official_status = 1
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="officialStatus != null and officialStatus == 0 ">
|
|
|
|
|
+ AND (cgu.official_status is NULL or cgu.official_status=0)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="periodPlush != null and periodPlush == 1 ">
|
|
|
|
|
+ AND cgu.period_plush = 1
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="periodPlush != null and periodPlush == 0 ">
|
|
|
|
|
+ AND (cgu.period_plush is NULL or cgu.period_plush=0)
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="searchKey != null and searchKey != ''">
|
|
|
|
|
+ AND (cg.class_name like concat('%', #{searchKey}, '%') or u.realname like concat('%', #{searchKey}, '%') or u.company_name like concat('%', #{searchKey}, '%'))
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="telphone != null and telphone != ''">
|
|
|
|
|
+ AND (u.telphone like concat('%', #{telphone,typeHandler=com.zhongzheng.common.type.EncryptHandler}, '%'))
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="idCard != null and idCard != ''">
|
|
|
|
|
+ AND u.id_card like concat('%', #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="idCards != null and idCards.size() != 0">
|
|
|
|
|
+ AND u.id_card IN
|
|
|
|
|
+ <foreach collection="idCards" item="item" index="index" open="(" close=")" separator=",">
|
|
|
|
|
+ #{item,typeHandler=com.zhongzheng.common.type.EncryptHandler}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="orderSn != null and orderSn != ''">
|
|
|
|
|
+ AND og.order_sn = #{orderSn}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="goodsName != null and goodsName != ''">
|
|
|
|
|
+ AND g.goods_name like concat('%', #{goodsName}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="searchStartTime != null and searchStartTime != ''">
|
|
|
|
|
+ AND cgu.create_time > #{searchStartTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="searchEndTime != null and searchEndTime != ''">
|
|
|
|
|
+ AND cgu.create_time < #{searchEndTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="finishStatus != null">
|
|
|
|
|
+ AND cgu.finish_status = #{finishStatus}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="learnStatus != null">
|
|
|
|
|
+ AND cgu.learn_status = #{learnStatus}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="projectId != null and projectId != ''">
|
|
|
|
|
+ AND g.project_id = #{projectId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="businessId != null and businessId != ''">
|
|
|
|
|
+ AND g.business_id = #{businessId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="educationTypeId != null and educationTypeId != ''">
|
|
|
|
|
+ AND g.education_type_id = #{educationTypeId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="majorId != null and majorId != ''">
|
|
|
|
|
+ AND m.id = #{majorId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="hasInterface != null and hasInterface == 0">
|
|
|
|
|
+ AND cg.interface_account_id is null AND cg.no_interface_account_id is null
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="hasInterface != null and hasInterface == 1">
|
|
|
|
|
+ AND cg.interface_account_id is not null
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="hasInterface != null and hasInterface == 2">
|
|
|
|
|
+ AND cg.no_interface_account_id is not null
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
<select id="listGradeInform" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeQueryBo" resultMap="ClassGradeUserListVo">
|
|
<select id="listGradeInform" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeQueryBo" resultMap="ClassGradeUserListVo">
|
|
|
SELECT
|
|
SELECT
|
|
|
g.*,
|
|
g.*,
|
|
@@ -1141,6 +1308,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
g.class_start_time,
|
|
g.class_start_time,
|
|
|
g.class_end_time,
|
|
g.class_end_time,
|
|
|
g.learning_status,
|
|
g.learning_status,
|
|
|
|
|
+ g.remark,
|
|
|
|
|
+ g.status,
|
|
|
(SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.grade_id and a.status =1) as student_num,
|
|
(SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.grade_id and a.status =1) as student_num,
|
|
|
(
|
|
(
|
|
|
SELECT
|
|
SELECT
|
|
@@ -1186,14 +1355,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND u.realname like concat('%', #{userName}, '%')
|
|
AND u.realname like concat('%', #{userName}, '%')
|
|
|
) >0
|
|
) >0
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="classStatus != null ">
|
|
|
|
|
- AND g.class_status = #{classStatus}
|
|
|
|
|
|
|
+ AND g.status != -1
|
|
|
|
|
+ <if test="classStatus != null and classStatus==0">
|
|
|
|
|
+ AND (g.class_status = #{classStatus} or g.class_status is null )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="classStatus != null and classStatus==1">
|
|
|
|
|
+ AND g.class_status = 1 and g.class_end_time >= unix_timestamp(now())
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="classStatus != null and classStatus == 2 ">
|
|
|
|
|
+ AND g.class_status = 1 and unix_timestamp(now()) > g.class_end_time
|
|
|
</if>
|
|
</if>
|
|
|
<if test="atFull != null and atFull !='' ">
|
|
<if test="atFull != null and atFull !='' ">
|
|
|
AND (SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.grade_id and a.status =1) < g.student_upper
|
|
AND (SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.grade_id and a.status =1) < g.student_upper
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="classStartTime != null and classStartTime != '' and classEndTime != null and classEndTime != ''">
|
|
|
|
|
- AND (#{classStartTime} BETWEEN g.class_start_time and g.class_end_time or #{classEndTime} BETWEEN g.class_start_time and g.class_end_time)
|
|
|
|
|
|
|
+ <if test="classStartTime != null and classStartTime != '' ">
|
|
|
|
|
+ AND g.class_start_time >=#{classStartTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="classEndTime != null and classEndTime != '' ">
|
|
|
|
|
+ AND #{classEndTime} >= g.class_end_time
|
|
|
</if>
|
|
</if>
|
|
|
<if test="pastDue != null or pastDue != null ">
|
|
<if test="pastDue != null or pastDue != null ">
|
|
|
AND ((unix_timestamp(now())+10*24*3600) < g.class_end_time or g.class_start_time is null)
|
|
AND ((unix_timestamp(now())+10*24*3600) < g.class_end_time or g.class_start_time is null)
|
|
@@ -1220,6 +1399,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
g.class_start_time,
|
|
g.class_start_time,
|
|
|
g.class_end_time,
|
|
g.class_end_time,
|
|
|
g.learning_status,
|
|
g.learning_status,
|
|
|
|
|
+ g.remark,
|
|
|
|
|
+ g.status,
|
|
|
(SELECT COUNT(c.id) FROM class_grade_user c where a.grade_id = c.grade_id and c.status =1) as student_num,
|
|
(SELECT COUNT(c.id) FROM class_grade_user c where a.grade_id = c.grade_id and c.status =1) as student_num,
|
|
|
(
|
|
(
|
|
|
SELECT
|
|
SELECT
|
|
@@ -1249,6 +1430,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN course_business cb ON d.business_id = cb.id
|
|
LEFT JOIN course_business cb ON d.business_id = cb.id
|
|
|
WHERE
|
|
WHERE
|
|
|
1 = 1
|
|
1 = 1
|
|
|
|
|
+ AND g.status != -1
|
|
|
<if test="status != null and status.size()!=0 ">
|
|
<if test="status != null and status.size()!=0 ">
|
|
|
AND g.status in
|
|
AND g.status in
|
|
|
<foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
|
|
<foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
|
|
@@ -1267,14 +1449,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND d.goods_name like concat('%', #{searchKey}, '%')
|
|
AND d.goods_name like concat('%', #{searchKey}, '%')
|
|
|
) >0)
|
|
) >0)
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="classStatus != null ">
|
|
|
|
|
- AND g.class_status = #{classStatus}
|
|
|
|
|
|
|
+ <if test="classStatus != null and classStatus==0">
|
|
|
|
|
+ AND (g.class_status = #{classStatus} or g.class_status is null )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="classStatus != null and classStatus==1">
|
|
|
|
|
+ AND g.class_status = 1 and g.class_end_time >= unix_timestamp(now())
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="classStatus != null and classStatus == 2 ">
|
|
|
|
|
+ AND g.class_status = 1 and unix_timestamp(now()) > g.class_end_time
|
|
|
</if>
|
|
</if>
|
|
|
<if test="atFull != null and atFull !='' ">
|
|
<if test="atFull != null and atFull !='' ">
|
|
|
AND (SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.grade_id and a.status =1) < g.student_upper
|
|
AND (SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.grade_id and a.status =1) < g.student_upper
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="classStartTime != null and classStartTime != '' and classEndTime != null and classEndTime != ''">
|
|
|
|
|
- AND (#{classStartTime} BETWEEN g.class_start_time and g.class_end_time or #{classEndTime} BETWEEN g.class_start_time and g.class_end_time)
|
|
|
|
|
|
|
+ <if test="classStartTime != null and classStartTime != '' ">
|
|
|
|
|
+ AND g.class_start_time >=#{classStartTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="classEndTime != null and classEndTime != '' ">
|
|
|
|
|
+ AND #{classEndTime} >= g.class_end_time
|
|
|
</if>
|
|
</if>
|
|
|
<if test="pastDue != null or pastDue != null ">
|
|
<if test="pastDue != null or pastDue != null ">
|
|
|
AND ((unix_timestamp(now())+10*24*3600) < g.class_end_time or g.class_start_time is null)
|
|
AND ((unix_timestamp(now())+10*24*3600) < g.class_end_time or g.class_start_time is null)
|