1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.yunzhi.demo.mapper.TaTestLogMapper">
-
- <select id="getTestLogWithStudent" resultType="com.yunzhi.demo.vo.StudentTestLog">
- SELECT
- b.student_id,
- b.name,
- b.sex,
- b.phone,
- b.e_mail,
- a.school_id,
- b.school_batch,
- b.specialty_id,
- a.student_no,
- b.person_id,
- b.status,
- b.create_date,
- b.update_date,
- a.`name` as test_name,
- a.serial_no,
- a.attchment,
- c.`name` as school_name,
- d.`name` as specialty_name
- FROM
- ta_test_log a
- LEFT JOIN ta_student b on a.student_no = b.student_no
- LEFT JOIN td_school c on a.school_id = c.school_id
- LEFT JOIN td_specialty d on b.specialty_id = d.specialty_id
- WHERE
- a.`status` > - 1
- <if test="studentNo != null and studentNo != ''">
- AND a.student_no LIKE CONCAT( '%', #{studentNo}, '%' )
- </if>
- <if test="schoolId != null and schoolId != ''">
- AND a.school_id = #{schoolId}
- </if>
- <if test="specialtyId != null and specialtyId != ''">
- AND b.specialty_id = #{specialtyId}
- </if>
- ORDER BY
- a.create_date DESC
- </select>
- </mapper>
|