|
|
@@ -0,0 +1,176 @@
|
|
|
+<?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.usoftchina.smartschool.school.mapper.ScoreMapper" >
|
|
|
+ <resultMap id="BaseResultMap" type="com.usoftchina.smartschool.school.po.StuScore" >
|
|
|
+ <id column="score_id" property="score_id" jdbcType="BIGINT" />
|
|
|
+ <result column="score_type" property="score_type" jdbcType="VARCHAR" />
|
|
|
+ <result column="score_name" property="score_name" jdbcType="VARCHAR" />
|
|
|
+ <result column="stu_id" property="stu_id" jdbcType="BIGINT" />
|
|
|
+ <result column="score_total" property="score_total" jdbcType="DOUBLE" />
|
|
|
+ <result column="score_num" property="score_num" jdbcType="DOUBLE" />
|
|
|
+ <result column="score_scope" property="score_scope" jdbcType="VARCHAR" />
|
|
|
+ <result column="score_date" property="score_date" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="score_remarks" property="score_remarks" jdbcType="VARCHAR" />
|
|
|
+ <result column="school_id" property="school_id" jdbcType="BIGINT" />
|
|
|
+ <result column="subject_id" property="subject_id" jdbcType="BIGINT" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List" >
|
|
|
+ score_id, score_type, score_name, stu_id, score_total, score_num, score_scope, score_date,
|
|
|
+ score_remarks, school_id, subject_id
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from stu_score
|
|
|
+ where score_id = #{score_id,jdbcType=BIGINT}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
|
|
+ delete from stu_score
|
|
|
+ where score_id = #{score_id,jdbcType=BIGINT}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.usoftchina.smartschool.school.po.StuScore" >
|
|
|
+ insert into stu_score (score_id, score_type, score_name,
|
|
|
+ stu_id, score_total, score_num,
|
|
|
+ score_scope, score_date, score_remarks,
|
|
|
+ school_id, subject_id)
|
|
|
+ values (#{score_id,jdbcType=BIGINT}, #{score_type,jdbcType=VARCHAR}, #{score_name,jdbcType=VARCHAR},
|
|
|
+ #{stu_id,jdbcType=BIGINT}, #{score_total,jdbcType=DOUBLE}, #{score_num,jdbcType=DOUBLE},
|
|
|
+ #{score_scope,jdbcType=VARCHAR}, #{score_date,jdbcType=TIMESTAMP}, #{score_remarks,jdbcType=VARCHAR},
|
|
|
+ #{school_id,jdbcType=BIGINT}, #{subject_id,jdbcType=BIGINT})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.usoftchina.smartschool.school.po.StuScore" >
|
|
|
+ insert into stu_score
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="score_id != null" >
|
|
|
+ score_id,
|
|
|
+ </if>
|
|
|
+ <if test="score_type != null" >
|
|
|
+ score_type,
|
|
|
+ </if>
|
|
|
+ <if test="score_name != null" >
|
|
|
+ score_name,
|
|
|
+ </if>
|
|
|
+ <if test="stu_id != null" >
|
|
|
+ stu_id,
|
|
|
+ </if>
|
|
|
+ <if test="score_total != null" >
|
|
|
+ score_total,
|
|
|
+ </if>
|
|
|
+ <if test="score_num != null" >
|
|
|
+ score_num,
|
|
|
+ </if>
|
|
|
+ <if test="score_scope != null" >
|
|
|
+ score_scope,
|
|
|
+ </if>
|
|
|
+ <if test="score_date != null" >
|
|
|
+ score_date,
|
|
|
+ </if>
|
|
|
+ <if test="score_remarks != null" >
|
|
|
+ score_remarks,
|
|
|
+ </if>
|
|
|
+ <if test="school_id != null" >
|
|
|
+ school_id,
|
|
|
+ </if>
|
|
|
+ <if test="subject_id != null" >
|
|
|
+ subject_id,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="score_id != null" >
|
|
|
+ #{score_id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="score_type != null" >
|
|
|
+ #{score_type,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="score_name != null" >
|
|
|
+ #{score_name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="stu_id != null" >
|
|
|
+ #{stu_id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="score_total != null" >
|
|
|
+ #{score_total,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="score_num != null" >
|
|
|
+ #{score_num,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="score_scope != null" >
|
|
|
+ #{score_scope,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="score_date != null" >
|
|
|
+ #{score_date,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="score_remarks != null" >
|
|
|
+ #{score_remarks,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="school_id != null" >
|
|
|
+ #{school_id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="subject_id != null" >
|
|
|
+ #{subject_id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.smartschool.school.po.StuScore" >
|
|
|
+ update stu_score
|
|
|
+ <set >
|
|
|
+ <if test="score_type != null" >
|
|
|
+ score_type = #{score_type,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="score_name != null" >
|
|
|
+ score_name = #{score_name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="stu_id != null" >
|
|
|
+ stu_id = #{stu_id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="score_total != null" >
|
|
|
+ score_total = #{score_total,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="score_num != null" >
|
|
|
+ score_num = #{score_num,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="score_scope != null" >
|
|
|
+ score_scope = #{score_scope,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="score_date != null" >
|
|
|
+ score_date = #{score_date,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="score_remarks != null" >
|
|
|
+ score_remarks = #{score_remarks,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="school_id != null" >
|
|
|
+ school_id = #{school_id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="subject_id != null" >
|
|
|
+ subject_id = #{subject_id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where score_id = #{score_id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.usoftchina.smartschool.school.po.StuScore" >
|
|
|
+ update stu_score
|
|
|
+ set score_type = #{score_type,jdbcType=VARCHAR},
|
|
|
+ score_name = #{score_name,jdbcType=VARCHAR},
|
|
|
+ stu_id = #{stu_id,jdbcType=BIGINT},
|
|
|
+ score_total = #{score_total,jdbcType=DOUBLE},
|
|
|
+ score_num = #{score_num,jdbcType=DOUBLE},
|
|
|
+ score_scope = #{score_scope,jdbcType=VARCHAR},
|
|
|
+ score_date = #{score_date,jdbcType=TIMESTAMP},
|
|
|
+ score_remarks = #{score_remarks,jdbcType=VARCHAR},
|
|
|
+ school_id = #{school_id,jdbcType=BIGINT},
|
|
|
+ subject_id = #{subject_id,jdbcType=BIGINT}
|
|
|
+ where score_id = #{score_id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="selectByConditon" resultMap="BaseResultMap">
|
|
|
+ select * from stu_score <where>
|
|
|
+ <if test="con != null">
|
|
|
+ ${con}
|
|
|
+ </if>
|
|
|
+ <if test="school_id != null">
|
|
|
+ and school_id = #{school_id}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by score_id DESC
|
|
|
+ </select>
|
|
|
+</mapper>
|