123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <?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.ygj.yuemum.dao.maternitymatron.MmInfoTrainDao" >
- <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.maternitymatron.MmInfoTrain" >
- <id column="id" property="id" jdbcType="INTEGER" />
- <result column="servant_code" property="servant_code" jdbcType="INTEGER" />
- <result column="train_code" property="train_code" jdbcType="INTEGER" />
- <result column="train_date" property="train_date" jdbcType="DATE" />
- <result column="train_result" property="train_result" jdbcType="VARCHAR" />
- <result column="train_name" property="train_name" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, servant_code, train_code,train_date,train_result,train_name
- </sql>
- <!-- 得到所有的培训信息 -->
- <select id="getAll" resultMap="BaseResultMap" >
- select
- <include refid="Base_Column_List" />
- from mm_info_train
- </select>
- <select id="getTrainsCount" parameterType="java.lang.Integer" resultType="java.lang.Integer" >
- select
- count(1)
- from mm_info_train
- where servant_code = #{servant_code,jdbcType=INTEGER}
- </select>
- <select id="getInfoTrains" resultMap="BaseResultMap" parameterType="java.lang.Integer">
- select
- id,
- fgettrainname(train_code) train_name,
- train_code,
- train_date,
- train_result
- from mm_info_train
- where servant_code = #{servant_code,jdbcType=INTEGER}
- order by id asc
- </select>
- <!-- 根据id查找某个照片信息 -->
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from mm_info_train
- where servant_code = #{servant_code,jdbcType=INTEGER}
- </select>
- <!-- 根据id删除某个照片信息 -->
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from mm_info_train
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <!-- 插入一条照片信息 -->
- <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.maternitymatron.MmInfoTrain" >
- insert into mm_info_train
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="servant_code != null" >
- servant_code,
- </if>
- <if test="train_code != null" >
- train_code,
- </if>
- <if test="train_date != null" >
- train_date,
- </if>
- <if test="train_result != null" >
- train_result
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="servant_code != null" >
- #{servant_code,jdbcType=INTEGER},
- </if>
- <if test="train_code != null" >
- #{train_code,jdbcType=INTEGER},
- </if>
- <if test="train_date != null" >
- #{train_date,jdbcType=DATE},
- </if>
- <if test="train_result != null" >
- #{train_result,jdbcType=VARCHAR}
- </if>
- </trim>
- </insert>
- <!-- 根据id更新一条照片信息 -->
- <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.maternitymatron.MmInfoTrain" >
- update mm_info_train
- <set >
- <if test="servant_code != null" >
- servant_code = #{servant_code,jdbcType=INTEGER},
- </if>
- <if test="train_code != null" >
- train_code = #{train_code,jdbcType=VARCHAR},
- </if>
- <if test="train_date != null" >
- train_date = #{train_date,jdbcType=DATE},
- </if>
- <if test="train_result != null" >
- train_result = #{train_result,jdbcType=VARCHAR}
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- </mapper>
|