<?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.ruoyi.system.mapper.CjStudentBindMapper">
|
|
<resultMap type="CjStudentBind" id="CjStudentBindResult">
|
<result property="id" column="id" />
|
<result property="studentId" column="student_id" />
|
<result property="openidHash" column="openid_hash" />
|
<result property="bindChannel" column="bind_channel" />
|
<result property="bindTime" column="bind_time" />
|
<result property="lastLoginTime" column="last_login_time" />
|
<result property="status" column="status" />
|
<result property="remark" column="remark" />
|
</resultMap>
|
|
<sql id="selectCjStudentBindVo">
|
select id, student_id, openid_hash, bind_channel, bind_time, last_login_time, status, remark from cj_student_bind
|
</sql>
|
|
<select id="selectCjStudentBindList" parameterType="CjStudentBind" resultMap="CjStudentBindResult">
|
<include refid="selectCjStudentBindVo"/>
|
<where>
|
<if test="studentId != null "> and student_id = #{studentId}</if>
|
<if test="openidHash != null and openidHash != ''"> and openid_hash = #{openidHash}</if>
|
<if test="bindChannel != null and bindChannel != ''"> and bind_channel = #{bindChannel}</if>
|
<if test="bindTime != null "> and bind_time = #{bindTime}</if>
|
<if test="lastLoginTime != null "> and last_login_time = #{lastLoginTime}</if>
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
</where>
|
</select>
|
|
<select id="selectCjStudentBindById" parameterType="Long" resultMap="CjStudentBindResult">
|
<include refid="selectCjStudentBindVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertCjStudentBind" parameterType="CjStudentBind" useGeneratedKeys="true" keyProperty="id">
|
insert into cj_student_bind
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="studentId != null">student_id,</if>
|
<if test="openidHash != null and openidHash != ''">openid_hash,</if>
|
<if test="bindChannel != null">bind_channel,</if>
|
<if test="bindTime != null">bind_time,</if>
|
<if test="lastLoginTime != null">last_login_time,</if>
|
<if test="status != null">status,</if>
|
<if test="remark != null">remark,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="studentId != null">#{studentId},</if>
|
<if test="openidHash != null and openidHash != ''">#{openidHash},</if>
|
<if test="bindChannel != null">#{bindChannel},</if>
|
<if test="bindTime != null">#{bindTime},</if>
|
<if test="lastLoginTime != null">#{lastLoginTime},</if>
|
<if test="status != null">#{status},</if>
|
<if test="remark != null">#{remark},</if>
|
</trim>
|
</insert>
|
|
<update id="updateCjStudentBind" parameterType="CjStudentBind">
|
update cj_student_bind
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="studentId != null">student_id = #{studentId},</if>
|
<if test="openidHash != null and openidHash != ''">openid_hash = #{openidHash},</if>
|
<if test="bindChannel != null">bind_channel = #{bindChannel},</if>
|
<if test="bindTime != null">bind_time = #{bindTime},</if>
|
<if test="lastLoginTime != null">last_login_time = #{lastLoginTime},</if>
|
<if test="status != null">status = #{status},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteCjStudentBindById" parameterType="Long">
|
delete from cj_student_bind where id = #{id}
|
</delete>
|
|
<delete id="deleteCjStudentBindByIds" parameterType="String">
|
delete from cj_student_bind where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
<select id="countByStudentIds" resultType="int">
|
select count(1) from cj_student_bind where student_id in
|
<foreach item="studentId" collection="array" open="(" separator="," close=")">
|
#{studentId}
|
</foreach>
|
</select>
|
</mapper>
|