SzVSchoolStudentMapper.xml 8.16 KB
<?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.sincere.smartSearch.mapper.SzVSchoolStudentMapper">
    <resultMap id="BaseResultMap" type="com.sincere.common.dto.smartCampus.SzVSchoolStudent">
        <result column="school_id" jdbcType="INTEGER" property="schoolId"/>
        <result column="class_id" jdbcType="INTEGER" property="classId"/>
        <result column="student_id" jdbcType="INTEGER" property="studentId"/>
        <result column="user_id" jdbcType="VARCHAR" property="userId"/>
        <result column="student_num" jdbcType="VARCHAR" property="studentNum"/>
        <result column="name" jdbcType="VARCHAR" property="name"/>
        <result column="num" jdbcType="VARCHAR" property="num"/>
        <result column="photo" jdbcType="VARCHAR" property="photo"/>
        <result column="ismonitor" jdbcType="INTEGER" property="ismonitor"/>
        <result column="class_state" jdbcType="INTEGER" property="classState"/>
        <result column="role_state" jdbcType="INTEGER" property="roleState"/>
        <result column="modifystate" jdbcType="CHAR" property="modifystate"/>
        <result column="mobile" jdbcType="VARCHAR" property="mobile"/>
        <result column="class_name" jdbcType="VARCHAR" property="className"/>
        <result column="student_type" jdbcType="INTEGER" property="studentType"/>
        <result column="matrikelnummer" jdbcType="VARCHAR" property="matrikelnummer"/>
        <result column="studentcode" jdbcType="VARCHAR" property="studentcode"/>
        <result column="sex" jdbcType="VARCHAR" property="sex"/>
        <result column="ParentMobile" jdbcType="VARCHAR" property="parentmobile"/>
        <result column="othername" jdbcType="VARCHAR" property="othername"/>
        <result column="activetime" jdbcType="TIMESTAMP" property="activetime"/>
        <result column="active" jdbcType="INTEGER" property="active"/>
        <result column="pass" jdbcType="VARCHAR" property="pass"/>
    </resultMap>

    <select id="selectBySchool" parameterType="java.lang.Integer" resultMap="BaseResultMap">
        select * from SZ_V_School_Student where school_id = #{schoolId}
    </select>

    <select id="selectByStudentId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
        select top 1 * from SZ_V_School_Student where student_id = #{studentId}
    </select>

    <insert id="insert" parameterType="com.sincere.common.dto.smartCampus.SzVSchoolStudent">
        insert into SZ_V_School_Student (school_id, class_id, student_id,
        user_id, student_num, name,
        num, photo, ismonitor,
        class_state, role_state, modifystate,
        mobile, class_name, student_type,
        matrikelnummer, studentcode, sex,
        ParentMobile, othername, activetime,
        active, pass)
        values (#{schoolId,jdbcType=INTEGER}, #{classId,jdbcType=INTEGER}, #{studentId,jdbcType=INTEGER},
        #{userId,jdbcType=VARCHAR}, #{studentNum,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
        #{num,jdbcType=VARCHAR}, #{photo,jdbcType=VARCHAR}, #{ismonitor,jdbcType=INTEGER},
        #{classState,jdbcType=INTEGER}, #{roleState,jdbcType=INTEGER}, #{modifystate,jdbcType=CHAR},
        #{mobile,jdbcType=VARCHAR}, #{className,jdbcType=VARCHAR}, #{studentType,jdbcType=INTEGER},
        #{matrikelnummer,jdbcType=VARCHAR}, #{studentcode,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR},
        #{parentmobile,jdbcType=VARCHAR}, #{othername,jdbcType=VARCHAR}, #{activetime,jdbcType=TIMESTAMP},
        #{active,jdbcType=INTEGER}, #{pass,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.sincere.common.dto.smartCampus.SzVSchoolStudent">
        insert into SZ_V_School_Student
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="schoolId != null">
                school_id,
            </if>
            <if test="classId != null">
                class_id,
            </if>
            <if test="studentId != null">
                student_id,
            </if>
            <if test="userId != null">
                user_id,
            </if>
            <if test="studentNum != null">
                student_num,
            </if>
            <if test="name != null">
                name,
            </if>
            <if test="num != null">
                num,
            </if>
            <if test="photo != null">
                photo,
            </if>
            <if test="ismonitor != null">
                ismonitor,
            </if>
            <if test="classState != null">
                class_state,
            </if>
            <if test="roleState != null">
                role_state,
            </if>
            <if test="modifystate != null">
                modifystate,
            </if>
            <if test="mobile != null">
                mobile,
            </if>
            <if test="className != null">
                class_name,
            </if>
            <if test="studentType != null">
                student_type,
            </if>
            <if test="matrikelnummer != null">
                matrikelnummer,
            </if>
            <if test="studentcode != null">
                studentcode,
            </if>
            <if test="sex != null">
                sex,
            </if>
            <if test="parentmobile != null">
                ParentMobile,
            </if>
            <if test="othername != null">
                othername,
            </if>
            <if test="activetime != null">
                activetime,
            </if>
            <if test="active != null">
                active,
            </if>
            <if test="pass != null">
                pass,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="schoolId != null">
                #{schoolId,jdbcType=INTEGER},
            </if>
            <if test="classId != null">
                #{classId,jdbcType=INTEGER},
            </if>
            <if test="studentId != null">
                #{studentId,jdbcType=INTEGER},
            </if>
            <if test="userId != null">
                #{userId,jdbcType=VARCHAR},
            </if>
            <if test="studentNum != null">
                #{studentNum,jdbcType=VARCHAR},
            </if>
            <if test="name != null">
                #{name,jdbcType=VARCHAR},
            </if>
            <if test="num != null">
                #{num,jdbcType=VARCHAR},
            </if>
            <if test="photo != null">
                #{photo,jdbcType=VARCHAR},
            </if>
            <if test="ismonitor != null">
                #{ismonitor,jdbcType=INTEGER},
            </if>
            <if test="classState != null">
                #{classState,jdbcType=INTEGER},
            </if>
            <if test="roleState != null">
                #{roleState,jdbcType=INTEGER},
            </if>
            <if test="modifystate != null">
                #{modifystate,jdbcType=CHAR},
            </if>
            <if test="mobile != null">
                #{mobile,jdbcType=VARCHAR},
            </if>
            <if test="className != null">
                #{className,jdbcType=VARCHAR},
            </if>
            <if test="studentType != null">
                #{studentType,jdbcType=INTEGER},
            </if>
            <if test="matrikelnummer != null">
                #{matrikelnummer,jdbcType=VARCHAR},
            </if>
            <if test="studentcode != null">
                #{studentcode,jdbcType=VARCHAR},
            </if>
            <if test="sex != null">
                #{sex,jdbcType=VARCHAR},
            </if>
            <if test="parentmobile != null">
                #{parentmobile,jdbcType=VARCHAR},
            </if>
            <if test="othername != null">
                #{othername,jdbcType=VARCHAR},
            </if>
            <if test="activetime != null">
                #{activetime,jdbcType=TIMESTAMP},
            </if>
            <if test="active != null">
                #{active,jdbcType=INTEGER},
            </if>
            <if test="pass != null">
                #{pass,jdbcType=VARCHAR},
            </if>
        </trim>
    </insert>
</mapper>