|
|
@@ -0,0 +1,104 @@
|
|
|
+<?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.SchoolTemplateMapper" >
|
|
|
+ <resultMap id="BaseResultMap" type="com.usoftchina.smartschool.school.po.SchoolTemplate" >
|
|
|
+ <id column="st_id" property="st_id" jdbcType="BIGINT" />
|
|
|
+ <result column="st_code" property="st_code" jdbcType="VARCHAR" />
|
|
|
+ <result column="st_name" property="st_name" jdbcType="VARCHAR" />
|
|
|
+ <result column="st_templateid" property="st_templateid" jdbcType="VARCHAR" />
|
|
|
+ <result column="st_schoolid" property="st_schoolid" jdbcType="BIGINT" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List" >
|
|
|
+ st_id, st_code, st_name, st_templateid, st_schoolid
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from school_template
|
|
|
+ where st_id = #{st_id,jdbcType=BIGINT}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
|
|
+ delete from school_template
|
|
|
+ where st_id = #{st_id,jdbcType=BIGINT}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.usoftchina.smartschool.school.po.SchoolTemplate" >
|
|
|
+ insert into school_template (st_id, st_code, st_name,
|
|
|
+ st_templateid, st_schoolid)
|
|
|
+ values (#{st_id,jdbcType=BIGINT}, #{st_code,jdbcType=VARCHAR}, #{st_name,jdbcType=VARCHAR},
|
|
|
+ #{st_templateid,jdbcType=VARCHAR}, #{st_schoolid,jdbcType=BIGINT})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.usoftchina.smartschool.school.po.SchoolTemplate" >
|
|
|
+ insert into school_template
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="st_code != null" >
|
|
|
+ st_code,
|
|
|
+ </if>
|
|
|
+ <if test="st_name != null" >
|
|
|
+ st_name,
|
|
|
+ </if>
|
|
|
+ <if test="st_templateid != null" >
|
|
|
+ st_templateid,
|
|
|
+ </if>
|
|
|
+ <if test="st_schoolid != null" >
|
|
|
+ st_schoolid,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="st_code != null" >
|
|
|
+ #{st_code,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_name != null" >
|
|
|
+ #{st_name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_templateid != null" >
|
|
|
+ #{st_templateid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_schoolid != null" >
|
|
|
+ #{st_schoolid,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.smartschool.school.po.SchoolTemplate" >
|
|
|
+ update school_template
|
|
|
+ <set >
|
|
|
+ <if test="st_code != null" >
|
|
|
+ st_code = #{st_code,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_name != null" >
|
|
|
+ st_name = #{st_name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_templateid != null" >
|
|
|
+ st_templateid = #{st_templateid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="st_schoolid != null" >
|
|
|
+ st_schoolid = #{st_schoolid,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where st_id = #{st_id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.usoftchina.smartschool.school.po.SchoolTemplate" >
|
|
|
+ update school_template
|
|
|
+ set st_code = #{st_code,jdbcType=VARCHAR},
|
|
|
+ st_name = #{st_name,jdbcType=VARCHAR},
|
|
|
+ st_templateid = #{st_templateid,jdbcType=VARCHAR},
|
|
|
+ st_schoolid = #{st_schoolid,jdbcType=BIGINT}
|
|
|
+ where st_id = #{st_id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="selectByConditon" resultMap="BaseResultMap">
|
|
|
+ select * from school_template <where>
|
|
|
+ <if test="con != null">
|
|
|
+ ${con}
|
|
|
+ </if>
|
|
|
+ <if test="school_id != null">
|
|
|
+ and st_schoolid = #{school_id}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by st_id DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectByCode" resultMap="BaseResultMap">
|
|
|
+ select * from school_template where st_code=#{code} and st_schoolid=#{school_id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|