<?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.miaxis.newgzpt.mapper.GzptSchActivationMapper">


    <insert id="saveSchActivation" parameterType="com.miaxis.newgzpt.domain.GzptSchActivation">

        insert into gzpt_sch_activation (ID, DQBH, DQMC, JXBH, JXMC, USER_ID, STU_ID, CRTIME,SYNC,IS_DEL)
        VALUES (seq_gzpt_sch_activation.nextval,
                                             #{dqbh,jdbcType=VARCHAR},
                                             #{dqmc,jdbcType=VARCHAR},
                                             #{jxbh,jdbcType=VARCHAR},
                                             #{jxmc,jdbcType=VARCHAR},
                                             #{userId},
                                             #{stuId},
                                             sysdate,
                                             0,
                                             0)
    </insert>


    <update id="upDelSchActivationByStuId" >
        update gzpt_sch_activation
        set SYNC = 0, IS_DEL = #{state}
        where STU_ID = #{stuId}
    </update>





    <select id="getSchActivation" resultType="com.miaxis.newgzpt.domain.GzptSchActivation">
        select * from GZPT_SCH_ACTIVATION where STU_ID = #{stuId}
    </select>


    <delete id="delSchActivationByStuId" parameterType="Long">
        delete GZPT_SCH_ACTIVATION where STU_ID = #{stuId}
    </delete>


</mapper>
