<?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.SzVSchoolTeacherMapper"> <resultMap id="BaseResultMap" type="com.sincere.common.dto.smartCampus.SzVSchoolTeacher"> <result column="school_id" jdbcType="INTEGER" property="schoolId"/> <result column="class_id" jdbcType="INTEGER" property="classId"/> <result column="teacher_id" jdbcType="INTEGER" property="teacherId"/> <result column="user_id" jdbcType="VARCHAR" property="userId"/> <result column="name" jdbcType="VARCHAR" property="name"/> <result column="face" jdbcType="VARCHAR" property="face"/> <result column="num" jdbcType="VARCHAR" property="num"/> <result column="teacher_num" jdbcType="VARCHAR" property="teacherNum"/> <result column="teacher_mobile" jdbcType="VARCHAR" property="teacherMobile"/> <result column="mobile" jdbcType="VARCHAR" property="mobile"/> <result column="class_state" jdbcType="INTEGER" property="classState"/> <result column="role_state" jdbcType="INTEGER" property="roleState"/> <result column="IsKaoQin" jdbcType="INTEGER" property="iskaoqin"/> <result column="OpenId" jdbcType="VARCHAR" property="openid"/> <result column="pass" jdbcType="VARCHAR" property="pass"/> <result column="DingUserId" jdbcType="VARCHAR" property="dinguserid"/> <result column="QiYeHaoUserId" jdbcType="VARCHAR" property="qiyehaouserid"/> </resultMap> <select id="selectBySchool" parameterType="java.lang.Integer" resultMap="BaseResultMap"> select * from SZ_V_School_Teacher where school_id = #{schoolId} </select> <select id="selectByTeacherId" parameterType="java.lang.Integer" resultMap="BaseResultMap"> select top 1 * from SZ_V_School_Teacher where teacher_id = #{teacherId} </select> <insert id="insert" parameterType="com.sincere.common.dto.smartCampus.SzVSchoolTeacher"> insert into SZ_V_School_Teacher (school_id, class_id, teacher_id, user_id, name, face, num, teacher_num, teacher_mobile, mobile, class_state, role_state, IsKaoQin, OpenId, pass, DingUserId, QiYeHaoUserId) values (#{schoolId,jdbcType=INTEGER}, #{classId,jdbcType=INTEGER}, #{teacherId,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{face,jdbcType=VARCHAR}, #{num,jdbcType=VARCHAR}, #{teacherNum,jdbcType=VARCHAR}, #{teacherMobile,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{classState,jdbcType=INTEGER}, #{roleState,jdbcType=INTEGER}, #{iskaoqin,jdbcType=INTEGER}, #{openid,jdbcType=VARCHAR}, #{pass,jdbcType=VARCHAR}, #{dinguserid,jdbcType=VARCHAR}, #{qiyehaouserid,jdbcType=VARCHAR}) </insert> <insert id="insertSelective" parameterType="com.sincere.common.dto.smartCampus.SzVSchoolTeacher"> insert into SZ_V_School_Teacher <trim prefix="(" suffix=")" suffixOverrides=","> <if test="schoolId != null"> school_id, </if> <if test="classId != null"> class_id, </if> <if test="teacherId != null"> teacher_id, </if> <if test="userId != null"> user_id, </if> <if test="name != null"> name, </if> <if test="face != null"> face, </if> <if test="num != null"> num, </if> <if test="teacherNum != null"> teacher_num, </if> <if test="teacherMobile != null"> teacher_mobile, </if> <if test="mobile != null"> mobile, </if> <if test="classState != null"> class_state, </if> <if test="roleState != null"> role_state, </if> <if test="iskaoqin != null"> IsKaoQin, </if> <if test="openid != null"> OpenId, </if> <if test="pass != null"> pass, </if> <if test="dinguserid != null"> DingUserId, </if> <if test="qiyehaouserid != null"> QiYeHaoUserId, </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="teacherId != null"> #{teacherId,jdbcType=INTEGER}, </if> <if test="userId != null"> #{userId,jdbcType=VARCHAR}, </if> <if test="name != null"> #{name,jdbcType=VARCHAR}, </if> <if test="face != null"> #{face,jdbcType=VARCHAR}, </if> <if test="num != null"> #{num,jdbcType=VARCHAR}, </if> <if test="teacherNum != null"> #{teacherNum,jdbcType=VARCHAR}, </if> <if test="teacherMobile != null"> #{teacherMobile,jdbcType=VARCHAR}, </if> <if test="mobile != null"> #{mobile,jdbcType=VARCHAR}, </if> <if test="classState != null"> #{classState,jdbcType=INTEGER}, </if> <if test="roleState != null"> #{roleState,jdbcType=INTEGER}, </if> <if test="iskaoqin != null"> #{iskaoqin,jdbcType=INTEGER}, </if> <if test="openid != null"> #{openid,jdbcType=VARCHAR}, </if> <if test="pass != null"> #{pass,jdbcType=VARCHAR}, </if> <if test="dinguserid != null"> #{dinguserid,jdbcType=VARCHAR}, </if> <if test="qiyehaouserid != null"> #{qiyehaouserid,jdbcType=VARCHAR}, </if> </trim> </insert> </mapper>