<?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.srs.comprehensive.mapper.InfoStudentMapper">

    <resultMap type="com.srs.comprehensive.domain.InfoStudent" id="InfoStudentMap">
        <result property="id" column="id" jdbcType="INTEGER"/>
        <result property="stuNo" column="stu_no" jdbcType="VARCHAR"/>
        <result property="name" column="name" jdbcType="VARCHAR"/>
        <result property="gender" column="gender" jdbcType="VARCHAR"/>
        <result property="birthday" column="birthday" jdbcType="TIMESTAMP"/>
        <result property="classId" column="class_id" jdbcType="INTEGER"/>
        <result property="phone" column="phone" jdbcType="VARCHAR"/>
        <result property="addr" column="addr" jdbcType="VARCHAR"/>
        <result property="idCard" column="id_card" jdbcType="VARCHAR"/>
        <result property="roomId" column="room_id" jdbcType="INTEGER"/>
        <result property="writeTime" column="write_time" jdbcType="TIMESTAMP"/>
        <result property="readTime" column="read_time" jdbcType="TIMESTAMP"/>
        <result property="dataStatus" column="data_status" jdbcType="VARCHAR"/>
        <result property="chmodStatus" column="chmod_status" jdbcType="VARCHAR"/>
        <result property="classCode" column="class_code" jdbcType="VARCHAR"/>

    </resultMap>

    <!--查询所有-->
    <select id="queryAll" resultMap="InfoStudentMap">
        select *
        from xgxt_iwh.info_student where data_status ='1' and chmod_status  ='1'

    </select>


    <!--通过主键修改数据-->
    <update id="update">
        update xgxt_iwh.info_student
        <set>
            <if test="writeTime != null">
                write_time = #{writeTime},
            </if>
            <if test="readTime != null">
                read_time = #{readTime},
            </if>
            <if test="dataStatus != null and dataStatus != ''">
                data_status = #{dataStatus},
            </if>
            <if test="chmodStatus != null and chmodStatus != ''">
                chmod_status = #{chmodStatus},
            </if>
        </set>
        where id = #{id}
    </update>


</mapper>


