123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <?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.xinxin.topro.inpnurseservice.mysqlmapper.DicHolidayMapper" >
- <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.DicHoliday" >
- <id column="dh_id" property="dhId" jdbcType="INTEGER" />
- <result column="hi_id" property="hiId" jdbcType="INTEGER" />
- <result column="dh_name" property="dhName" jdbcType="VARCHAR" />
- <result column="dh_begin_time" property="dhBeginTime" jdbcType="TIMESTAMP" />
- <result column="dh_end_time" property="dhEndTime" jdbcType="TIMESTAMP" />
- <result column="dh_is_del" property="dhIsDel" jdbcType="INTEGER" />
- <result column="dh_type" property="dhType" jdbcType="INTEGER" />
- </resultMap>
- <sql id="Base_Column_List" >
- dh_id, hi_id, dh_name, dh_begin_time, dh_end_time, dh_is_del, dh_type
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from dic_holiday
- where dh_id = #{dhId,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from dic_holiday
- where dh_id = #{dhId,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicHoliday" >
- insert into dic_holiday (dh_id, hi_id, dh_name,
- dh_begin_time, dh_end_time, dh_is_del, dh_type
- )
- values (#{dhId,jdbcType=INTEGER}, #{hiId,jdbcType=INTEGER}, #{dhName,jdbcType=VARCHAR},
- #{dhBeginTime,jdbcType=TIMESTAMP}, #{dhEndTime,jdbcType=TIMESTAMP}, #{dhIsDel,jdbcType=INTEGER},
- #{dhType,jdbcType=INTEGER}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicHoliday" >
- insert into dic_holiday
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="dhId != null" >
- dh_id,
- </if>
- <if test="hiId != null" >
- hi_id,
- </if>
- <if test="dhName != null" >
- dh_name,
- </if>
- <if test="dhBeginTime != null" >
- dh_begin_time,
- </if>
- <if test="dhEndTime != null" >
- dh_end_time,
- </if>
- <if test="dhIsDel != null" >
- dh_is_del,
- </if>
- <if test="dhType != null" >
- dh_type,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="dhId != null" >
- #{dhId,jdbcType=INTEGER},
- </if>
- <if test="hiId != null" >
- #{hiId,jdbcType=INTEGER},
- </if>
- <if test="dhName != null" >
- #{dhName,jdbcType=VARCHAR},
- </if>
- <if test="dhBeginTime != null" >
- #{dhBeginTime,jdbcType=TIMESTAMP},
- </if>
- <if test="dhEndTime != null" >
- #{dhEndTime,jdbcType=TIMESTAMP},
- </if>
- <if test="dhIsDel != null" >
- #{dhIsDel,jdbcType=INTEGER},
- </if>
- <if test="dhType != null" >
- #{dhType,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicHoliday" >
- update dic_holiday
- <set >
- <if test="hiId != null" >
- hi_id = #{hiId,jdbcType=INTEGER},
- </if>
- <if test="dhName != null" >
- dh_name = #{dhName,jdbcType=VARCHAR},
- </if>
- <if test="dhBeginTime != null" >
- dh_begin_time = #{dhBeginTime,jdbcType=TIMESTAMP},
- </if>
- <if test="dhEndTime != null" >
- dh_end_time = #{dhEndTime,jdbcType=TIMESTAMP},
- </if>
- <if test="dhIsDel != null" >
- dh_is_del = #{dhIsDel,jdbcType=INTEGER},
- </if>
- <if test="dhType != null" >
- dh_type = #{dhType,jdbcType=INTEGER},
- </if>
- </set>
- where dh_id = #{dhId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicHoliday" >
- update dic_holiday
- set hi_id = #{hiId,jdbcType=INTEGER},
- dh_name = #{dhName,jdbcType=VARCHAR},
- dh_begin_time = #{dhBeginTime,jdbcType=TIMESTAMP},
- dh_end_time = #{dhEndTime,jdbcType=TIMESTAMP},
- dh_is_del = #{dhIsDel,jdbcType=INTEGER},
- dh_type = #{dhType,jdbcType=INTEGER}
- where dh_id = #{dhId,jdbcType=INTEGER}
- </update>
- <update id="deleteAllData" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicHoliday" >
- UPDATE dic_holiday
- SET dh_is_del = -1
- WHERE dh_is_del = 0
- AND dh_type = #{dhType,jdbcType=INTEGER}
- </update>
- <insert id="batchInsert" parameterType="java.util.List">
- INSERT INTO dic_holiday (dh_id, hi_id, dh_name,
- dh_begin_time, dh_end_time, dh_is_del, dh_type
- )
- VALUES
- <foreach collection="list" item="item" separator=",">
- (#{item.dhId,jdbcType=INTEGER}, #{item.hiId,jdbcType=INTEGER}, #{item.dhName,jdbcType=VARCHAR},
- #{item.dhBeginTime,jdbcType=TIMESTAMP}, #{item.dhEndTime,jdbcType=TIMESTAMP}, #{item.dhIsDel,jdbcType=INTEGER},
- #{item.dhType,jdbcType=INTEGER}
- )
- </foreach>
- </insert>
- <select id="selectDicHolidayList" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List" />
- FROM dic_holiday
- WHERE
- dh_is_del = 0
- <if test="hiId != null" >
- AND hi_id = #{hiId,jdbcType=INTEGER}
- </if>
- <if test="dhType != null" >
- AND dh_type = #{dhType,jdbcType=INTEGER}
- </if>
- </select>
- </mapper>
|