<?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="org.dromara.system.mapper.StudentLiveOldMapper">

    <resultMap type="org.dromara.system.domain.vo.StudentLiveOldVo" id="StudentLiveOldResult">
        <result property="liveId"    column="live_id"    />
        <result property="studentId"    column="student_id"    />
        <result property="name"    column="name"    />
        <result property="sex"    column="sex"    />
        <result property="age"    column="age"    />
        <result property="school"    column="school"    />
        <result property="studentNumber"    column="student_number"    />
        <result property="idCard"    column="id_card"    />
        <result property="height"    column="height"    />
        <result property="weight"    column="weight"    />
        <result property="createType"    column="create_type"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="remark"    column="remark"    />
    </resultMap>

    <sql id="selectStudentLiveOldVo">
        select live_id, student_id, name, sex, age, school, student_number, id_card, height, weight,create_type, create_by, create_time, update_by, update_time, remark from student_live_old
    </sql>

    <select id="selectStudentLiveOldListEcharts" resultMap="StudentLiveOldResult">
        <include refid="selectStudentLiveOldVo"/>
        <where>
            <if test="studentId != null "> and student_id = #{studentId}</if>
            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
            <if test="sex != null  and sex != ''"> and sex = #{sex}</if>
            <if test="age != null  and age != ''"> and age = #{age}</if>
            <if test="school != null  and school != ''"> and school = #{school}</if>
            <if test="studentNumber != null  and studentNumber != ''"> and student_number = #{studentNumber}</if>
            <if test="idCard != null  and idCard != ''"> and id_card = #{idCard}</if>
            <if test="height != null  and height != ''"> and height = #{height}</if>
            <if test="weight != null  and weight != ''"> and weight = #{weight}</if>
            <if test="createType != null and createType != ''"> and create_type = #{createType}</if>
        </where>
        order by create_time asc
    </select>
    <select id="selectVoMapperPage" resultMap="StudentLiveOldResult">
        <include refid="selectStudentLiveOldVo"/>
        ${ew.getCustomSqlSegment}
    </select>
    <select id="selectVoMapperList" resultMap="StudentLiveOldResult">
        <include refid="selectStudentLiveOldVo"/>
        ${ew.getCustomSqlSegment}
    </select>
    <select id="selectVoMapperById" resultMap="StudentLiveOldResult">
        <include refid="selectStudentLiveOldVo"/>
        where live_id = #{liveId}
    </select>
</mapper>
