kongzy
2024-07-05 14821e28286d773ad5ff2c13510e39c5eb117daf
exam-system/src/main/resources/mapper/system/ExPhaseStudentMapper.xml
@@ -12,10 +12,16 @@
        <result property="phaseName"     column="phase_name"     />
        <result property="createName"     column="create_name"     />
        <result property="period"     column="period"     />
        <association property="course" javaType="com.gkhy.exam.system.domain.ExCourse" resultMap="courseResult" />
        <collection property="totalProgress" ofType="java.math.BigDecimal" select="getTotalProgress" column="{phaseId=phase_id,studentId=student_id}"/>
        <collection property="startTime" ofType="java.time.LocalDateTime" select="getStartTime" column="{phaseId=phase_id,studentId=student_id}"/>
    </resultMap>
    <resultMap id="courseResult" type="com.gkhy.exam.system.domain.ExCourse">
        <id     property="id"       column="course_id"        />
        <result property="name"     column="course_name"      />
        <result property="logo"     column="course_logo"      />
    </resultMap>
    <insert id="batchInsert" parameterType="java.util.List">
        insert into ex_phase_student(phase_id,student_id) values
@@ -43,11 +49,11 @@
    </select>
    <select id="selectPhaseStudentList" resultMap="ExPhaseStudentResult">
        select a.*,b.phone as student_phone,b.name as student_name,c.name as phase_name,d.period,e.name as create_name from ex_phase_student a
        select a.*,b.phone as student_phone,b.name as student_name,c.name as phase_name,d.period,e.name as create_name,d.id as course_id,d.logo as course_logo,d.name as course_name from ex_phase_student a
        left join ex_student b on a.student_id=b.id
        left join ex_course_phase c on c.id=a.phase_id
        left join ex_course d on d.id=c.couser_id
        left join sys_user e e.id=a.create_id
        left join ex_course d on d.id=c.course_id
        left join sys_user e on e.id=a.create_id
        <where>
            and c.del_flag=0 and b.del_flag=0
            <if test="phaseId!=null">
@@ -56,8 +62,8 @@
            <if test="studentName!=null and studentName!=''">
                and b.name like concat('%',#{studentName},'%')
            </if>
            <if test="phone!=null and phone!=''">
                and b.phone like concat('%',#{phone},'%')
            <if test="studentPhone!=null and studentPhone!=''">
                and b.phone like concat('%',#{studentPhone},'%')
            </if>
            <if test="studentId!=null">
                and a.student_id=#{studentId}