|
@@ -5,7 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<mapper namespace="com.zhongzheng.modules.grade.mapper.ClassGradeMapper">
|
|
|
|
|
|
<resultMap type="com.zhongzheng.modules.grade.domain.ClassGrade" id="ClassGradeResult">
|
|
|
- <result property="classId" column="class_id"/>
|
|
|
+ <result property="gradeId" column="grade_id"/>
|
|
|
<result property="classStatus" column="class_status"/>
|
|
|
<result property="officialName" column="official_name"/>
|
|
|
<result property="className" column="class_name"/>
|
|
@@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeVo" id="ClassGradeVoResult">
|
|
|
- <result property="classId" column="class_id"/>
|
|
|
+ <result property="gradeId" column="grade_id"/>
|
|
|
<result property="classStatus" column="class_status"/>
|
|
|
<result property="officialName" column="official_name"/>
|
|
|
<result property="className" column="class_name"/>
|
|
@@ -97,6 +97,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="templateType" column="template_type"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeStudentVo" id="ClassGradeStudentVo">
|
|
|
+ <result property="userId" column="user_id"/>
|
|
|
+ <result property="gradeId" column="grade_id"/>
|
|
|
+ <result property="studentCode" column="student_code"/>
|
|
|
+ <result property="realName" column="realname"/>
|
|
|
+ <result property="idCard" column="id_card"/>
|
|
|
+ <result property="telPhone" column="telphone"/>
|
|
|
+ <result property="userStatus" column="user_status"/>
|
|
|
+ <result property="status" column="status"/>
|
|
|
+ <result property="classHours" column="class_hours"/>
|
|
|
+ <result property="periodStatus" column="period_status"/>
|
|
|
+ <result property="finishStatus" column="finish_status"/>
|
|
|
+ <result property="officialStatus" column="official_status"/>
|
|
|
+ <result property="learnStatus" column="learn_status"/>
|
|
|
+ <result property="studyNum" column="study_num"/>
|
|
|
+ <result property="secAllNum" column="sec_all_num"/>
|
|
|
+ <result property="examNum" column="exam_num"/>
|
|
|
+ <result property="recordNum" column="record_num"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
<select id="queryList" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeQueryBo" resultMap="ClassGradeVoResult">
|
|
|
SELECT
|
|
|
g.*,
|
|
@@ -106,7 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
(SELECT nick_name FROM sys_user u where g.sys_user_id = u.user_id) as nick_name,
|
|
|
(SELECT area_name FROM apply_areas a where a.area_id = g.areas_id) as area_name,
|
|
|
(SELECT area_name FROM apply_areas a where a.area_id = g.city_id) as city_name,
|
|
|
- (SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.class_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
|
|
|
FROM
|
|
|
class_grade g
|
|
|
where 1=1
|
|
@@ -116,8 +136,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="classId != null and classId !=0 ">
|
|
|
- AND g.class_id = #{classId}
|
|
|
+ <if test="gradeId != null and gradeId !=0 ">
|
|
|
+ AND g.grade_id = #{gradeId}
|
|
|
</if>
|
|
|
<if test="className != null and className !='' ">
|
|
|
AND g.class_name like concat('%', #{className}, '%')
|
|
@@ -134,7 +154,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN goods d ON s.goods_id = d.goods_id
|
|
|
WHERE
|
|
|
1 = 1
|
|
|
- AND g.class_id = s.grade_id
|
|
|
+ AND g.grade_id = s.grade_id
|
|
|
AND d.education_type_id =#{educationTypeId}
|
|
|
) >0
|
|
|
</if>
|
|
@@ -147,7 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN goods d ON s.goods_id = d.goods_id
|
|
|
WHERE
|
|
|
1 = 1
|
|
|
- AND g.class_id = s.grade_id
|
|
|
+ AND g.grade_id = s.grade_id
|
|
|
AND d.business_id =#{businessId}
|
|
|
) >0
|
|
|
</if>
|
|
@@ -160,7 +180,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN goods d ON s.goods_id = d.goods_id
|
|
|
WHERE
|
|
|
1 = 1
|
|
|
- AND g.class_id = s.grade_id
|
|
|
+ AND g.grade_id = s.grade_id
|
|
|
AND d.school_id =#{schoolId}
|
|
|
) >0
|
|
|
</if>
|
|
@@ -173,7 +193,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN goods d ON s.goods_id = d.goods_id
|
|
|
WHERE
|
|
|
1 = 1
|
|
|
- AND g.class_id = s.grade_id
|
|
|
+ AND g.grade_id = s.grade_id
|
|
|
AND d.major_id =#{majorId}
|
|
|
) >0
|
|
|
</if>
|
|
@@ -202,7 +222,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN class_grade_goods o ON o.goods_id = g.goods_id
|
|
|
WHERE
|
|
|
1 = 1
|
|
|
- AND o.grade_id =#{classId}
|
|
|
+ AND o.grade_id =#{gradeId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="listGrade" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeQueryBo" resultMap="ClassGradeStudentVo">
|
|
|
+ SELECT
|
|
|
+ u.student_code,
|
|
|
+ u.user_id,
|
|
|
+ cgu.`status`,
|
|
|
+ u.realname,
|
|
|
+ u.id_card,
|
|
|
+ cgu.grade_id,
|
|
|
+ u.telphone,
|
|
|
+ (case WHEN (select COUNT(uu.id) FROM user_update uu where cgu.user_id = uu.user_id) >0 then 1 ELSE 0 end) as user_status,
|
|
|
+ (SELECT g.class_hours FROM goods g LEFT JOIN class_grade_goods cgg on cgg.goods_id = g.goods_id where cg.grade_id = cgg.grade_id) as class_hours,
|
|
|
+ cgu.period_status,
|
|
|
+ cgu.finish_status,
|
|
|
+ (SELECT g.study_start_time FROM goods g LEFT JOIN class_grade_goods cgg on cgg.goods_id = g.goods_id where cg.grade_id = cgg.grade_id) as study_start_time,
|
|
|
+ (SELECT g.study_end_time FROM goods g LEFT JOIN class_grade_goods cgg on cgg.goods_id = g.goods_id where cg.grade_id = cgg.grade_id) as study_end_time,
|
|
|
+ cg.class_start_time,
|
|
|
+ cg.class_end_time,
|
|
|
+ cgu.official_status,
|
|
|
+ cgu.learn_status
|
|
|
+ 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
|
|
|
+ where 1=1
|
|
|
+ and cgu.`status` =1
|
|
|
+ <if test="gradeId != null and gradeId !='' ">
|
|
|
+ and cgu.grade_id = #{gradeId}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
|