|
@@ -0,0 +1,138 @@
|
|
|
|
+<?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.StudentLiveOldMapper">
|
|
|
|
+
|
|
|
|
+ <resultMap type="StudentLiveOld" id="StudentLiveOldResult">
|
|
|
|
+ <result property="liveId" column="live_id" />
|
|
|
|
+ <result property="studentId" column="student_id" />
|
|
|
|
+ <result property="name" column="name" />
|
|
|
|
+ <result property="sex" column="sex" />
|
|
|
|
+ <result property="age" column="age" />
|
|
|
|
+ <result property="school" column="school" />
|
|
|
|
+ <result property="studentNumber" column="student_number" />
|
|
|
|
+ <result property="idCard" column="id_card" />
|
|
|
|
+ <result property="height" column="height" />
|
|
|
|
+ <result property="weight" column="weight" />
|
|
|
|
+ <result property="createType" column="create_type" />
|
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
|
+ <result property="remark" column="remark" />
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <sql id="selectStudentLiveOldVo">
|
|
|
|
+ select live_id, student_id, name, sex, age, school, student_number, id_card, height, weight,create_type, create_by, create_time, update_by, update_time, remark from student_live_old
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
|
|
+ <select id="selectStudentLiveOldList" parameterType="StudentLiveOld" resultMap="StudentLiveOldResult">
|
|
|
|
+ <include refid="selectStudentLiveOldVo"/>
|
|
|
|
+ <where>
|
|
|
|
+ <if test="studentId != null "> and student_id = #{studentId}</if>
|
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
|
+ <if test="sex != null and sex != ''"> and sex = #{sex}</if>
|
|
|
|
+ <if test="age != null and age != ''"> and age = #{age}</if>
|
|
|
|
+ <if test="school != null and school != ''"> and school = #{school}</if>
|
|
|
|
+ <if test="studentNumber != null and studentNumber != ''"> and student_number = #{studentNumber}</if>
|
|
|
|
+ <if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if>
|
|
|
|
+ <if test="height != null and height != ''"> and height = #{height}</if>
|
|
|
|
+ <if test="weight != null and weight != ''"> and weight = #{weight}</if>
|
|
|
|
+ <if test="createType != null and createType != ''"> and create_type = #{createType}</if>
|
|
|
|
+ </where>
|
|
|
|
+ order by create_time desc
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="selectStudentLiveOldByLiveId" parameterType="Long" resultMap="StudentLiveOldResult">
|
|
|
|
+ <include refid="selectStudentLiveOldVo"/>
|
|
|
|
+ where live_id = #{liveId}
|
|
|
|
+ </select>
|
|
|
|
+ <select id="selectStudentLiveOldListEcharts" resultMap="StudentLiveOldResult">
|
|
|
|
+ <include refid="selectStudentLiveOldVo"/>
|
|
|
|
+ <where>
|
|
|
|
+ <if test="studentId != null "> and student_id = #{studentId}</if>
|
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
|
+ <if test="sex != null and sex != ''"> and sex = #{sex}</if>
|
|
|
|
+ <if test="age != null and age != ''"> and age = #{age}</if>
|
|
|
|
+ <if test="school != null and school != ''"> and school = #{school}</if>
|
|
|
|
+ <if test="studentNumber != null and studentNumber != ''"> and student_number = #{studentNumber}</if>
|
|
|
|
+ <if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if>
|
|
|
|
+ <if test="height != null and height != ''"> and height = #{height}</if>
|
|
|
|
+ <if test="weight != null and weight != ''"> and weight = #{weight}</if>
|
|
|
|
+ <if test="createType != null and createType != ''"> and create_type = #{createType}</if>
|
|
|
|
+ </where>
|
|
|
|
+ order by create_time asc
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <insert id="insertStudentLiveOld" parameterType="StudentLiveOld" useGeneratedKeys="true" keyProperty="liveId">
|
|
|
|
+ insert into student_live_old
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="studentId != null">student_id,</if>
|
|
|
|
+ <if test="name != null">name,</if>
|
|
|
|
+ <if test="sex != null">sex,</if>
|
|
|
|
+ <if test="age != null">age,</if>
|
|
|
|
+ <if test="school != null">school,</if>
|
|
|
|
+ <if test="studentNumber != null">student_number,</if>
|
|
|
|
+ <if test="idCard != null">id_card,</if>
|
|
|
|
+ <if test="height != null">height,</if>
|
|
|
|
+ <if test="weight != null">weight,</if>
|
|
|
|
+ <if test="createType != null">create_type,</if>
|
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="studentId != null">#{studentId},</if>
|
|
|
|
+ <if test="name != null">#{name},</if>
|
|
|
|
+ <if test="sex != null">#{sex},</if>
|
|
|
|
+ <if test="age != null">#{age},</if>
|
|
|
|
+ <if test="school != null">#{school},</if>
|
|
|
|
+ <if test="studentNumber != null">#{studentNumber},</if>
|
|
|
|
+ <if test="idCard != null">#{idCard},</if>
|
|
|
|
+ <if test="height != null">#{height},</if>
|
|
|
|
+ <if test="weight != null">#{weight},</if>
|
|
|
|
+ <if test="createType != null"> #{createType},</if>
|
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <update id="updateStudentLiveOld" parameterType="StudentLiveOld">
|
|
|
|
+ update student_live_old
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
+ <if test="studentId != null">student_id = #{studentId},</if>
|
|
|
|
+ <if test="name != null">name = #{name},</if>
|
|
|
|
+ <if test="sex != null">sex = #{sex},</if>
|
|
|
|
+ <if test="age != null">age = #{age},</if>
|
|
|
|
+ <if test="school != null">school = #{school},</if>
|
|
|
|
+ <if test="studentNumber != null">student_number = #{studentNumber},</if>
|
|
|
|
+ <if test="createType != null">create_type = #{createType},</if>
|
|
|
|
+ <if test="idCard != null">id_card = #{idCard},</if>
|
|
|
|
+ <if test="height != null">height = #{height},</if>
|
|
|
|
+ <if test="weight != null">weight = #{weight},</if>
|
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
|
+ </trim>
|
|
|
|
+ where live_id = #{liveId}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteStudentLiveOldByLiveId" parameterType="Long">
|
|
|
|
+ delete from student_live_old where live_id = #{liveId}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <delete id="deleteStudentLiveOldByLiveIds" parameterType="String">
|
|
|
|
+ delete from student_live_old where live_id in
|
|
|
|
+ <foreach item="liveId" collection="array" open="(" separator="," close=")">
|
|
|
|
+ #{liveId}
|
|
|
|
+ </foreach>
|
|
|
|
+ </delete>
|
|
|
|
+</mapper>
|