<?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.stureg.mapper.CheckPhoneMapper">
    <resultMap type="CheckPhone" id="CheckPhoneResult">
        <result property="id" column="id"/>
        <result property="XSXM" column="XSXM"/>
        <result property="KSH" column="KSH"/>
        <result property="SFZH" column="SFZH"/>
        <result property="SJH" column="SJH"/>
        <result property="XB" column="XB"/>
        <result property="isChangeSJHM" column="is_change_SJHM"/>
    </resultMap>

    <sql id="selectCheckPhoneVo">
        select id,XSXM,KSH,SFZH,SJH,XB,is_change_SJHM from  srs_stu_reg
    </sql>

    <select id="selectCheckPhoneById"  parameterType="Long" resultMap="CheckPhoneResult">
        <include refid="selectCheckPhoneVo"/>
        where id = #{id}
    </select>

    <select id="getOwnInfoByKsh" parameterType="String" resultMap="CheckPhoneResult">
        <include refid="selectCheckPhoneVo"/>
        where KSH = #{ksh}
    </select>

    <update id="updateCheckPhoneById" parameterType="CheckPhone">
        update srs_stu_reg
        <trim prefix="SET" suffixOverrides=",">
            <if test="SJH != null">SJH = #{SJH},</if>
            <if test="isChangeSJHM != null">is_change_SJHM = #{isChangeSJHM},</if>
        </trim>
        where id = #{id}
    </update>

</mapper>
