TSpHolidaysMapper.xml 5.66 KB
<?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.zteits.bill.mapper.TSpHolidaysMapper" >
  <resultMap id="BaseResultMap" type="com.zteits.bill.domain.TSpHolidays" >
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="days_solar" property="daysSolar" jdbcType="DATE" />
    <result column="days_lunar" property="daysLunar" jdbcType="DATE" />
    <result column="is_holidays" property="isHolidays" jdbcType="INTEGER" />
    <result column="holidays_name" property="holidaysName" jdbcType="VARCHAR" />
    <result column="data_state" property="dataState" jdbcType="INTEGER" />
    <result column="create_op" property="createOp" jdbcType="BIGINT" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
    <result column="modify_op" property="modifyOp" jdbcType="BIGINT" />
    <result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, days_solar, days_lunar, is_holidays, holidays_name, data_state, create_op, create_time, 
    modify_op, modify_time
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    select 
    <include refid="Base_Column_List" />
    from t_sp_holidays
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    delete from t_sp_holidays
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.zteits.bill.domain.TSpHolidays" >
    <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_sp_holidays (days_solar, days_lunar, is_holidays, 
      holidays_name, data_state, create_op, 
      create_time, modify_op, modify_time
      )
    values (#{daysSolar,jdbcType=DATE}, #{daysLunar,jdbcType=DATE}, #{isHolidays,jdbcType=INTEGER}, 
      #{holidaysName,jdbcType=VARCHAR}, #{dataState,jdbcType=INTEGER}, #{createOp,jdbcType=BIGINT}, 
      #{createTime,jdbcType=TIMESTAMP}, #{modifyOp,jdbcType=BIGINT}, #{modifyTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.bill.domain.TSpHolidays" >
    <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_sp_holidays
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="daysSolar != null" >
        days_solar,
      </if>
      <if test="daysLunar != null" >
        days_lunar,
      </if>
      <if test="isHolidays != null" >
        is_holidays,
      </if>
      <if test="holidaysName != null" >
        holidays_name,
      </if>
      <if test="dataState != null" >
        data_state,
      </if>
      <if test="createOp != null" >
        create_op,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
      <if test="modifyOp != null" >
        modify_op,
      </if>
      <if test="modifyTime != null" >
        modify_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="daysSolar != null" >
        #{daysSolar,jdbcType=DATE},
      </if>
      <if test="daysLunar != null" >
        #{daysLunar,jdbcType=DATE},
      </if>
      <if test="isHolidays != null" >
        #{isHolidays,jdbcType=INTEGER},
      </if>
      <if test="holidaysName != null" >
        #{holidaysName,jdbcType=VARCHAR},
      </if>
      <if test="dataState != null" >
        #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createOp != null" >
        #{createOp,jdbcType=BIGINT},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyOp != null" >
        #{modifyOp,jdbcType=BIGINT},
      </if>
      <if test="modifyTime != null" >
        #{modifyTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.bill.domain.TSpHolidays" >
    update t_sp_holidays
    <set >
      <if test="daysSolar != null" >
        days_solar = #{daysSolar,jdbcType=DATE},
      </if>
      <if test="daysLunar != null" >
        days_lunar = #{daysLunar,jdbcType=DATE},
      </if>
      <if test="isHolidays != null" >
        is_holidays = #{isHolidays,jdbcType=INTEGER},
      </if>
      <if test="holidaysName != null" >
        holidays_name = #{holidaysName,jdbcType=VARCHAR},
      </if>
      <if test="dataState != null" >
        data_state = #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createOp != null" >
        create_op = #{createOp,jdbcType=BIGINT},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyOp != null" >
        modify_op = #{modifyOp,jdbcType=BIGINT},
      </if>
      <if test="modifyTime != null" >
        modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.bill.domain.TSpHolidays" >
    update t_sp_holidays
    set days_solar = #{daysSolar,jdbcType=DATE},
      days_lunar = #{daysLunar,jdbcType=DATE},
      is_holidays = #{isHolidays,jdbcType=INTEGER},
      holidays_name = #{holidaysName,jdbcType=VARCHAR},
      data_state = #{dataState,jdbcType=INTEGER},
      create_op = #{createOp,jdbcType=BIGINT},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      modify_op = #{modifyOp,jdbcType=BIGINT},
      modify_time = #{modifyTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>