TBillingRuleConfigMapper.xml 9.78 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.TBillingRuleConfigMapper" >
  <resultMap id="BaseResultMap" type="com.zteits.bill.domain.TBillingRuleConfig" >
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="rule_no" property="ruleNo" jdbcType="VARCHAR" />
    <result column="rule_config_no" property="ruleConfigNo" jdbcType="VARCHAR" />
    <result column="billing_config_type" property="billingConfigType" jdbcType="INTEGER" />
    <result column="isDay" property="isday" jdbcType="INTEGER" />
    <result column="start_time" property="startTime" jdbcType="TIME" />
    <result column="end_time" property="endTime" jdbcType="TIME" />
    <result column="start_billing_time" property="startBillingTime" jdbcType="INTEGER" />
    <result column="end_billing_time" property="endBillingTime" jdbcType="INTEGER" />
    <result column="unit" property="unit" jdbcType="INTEGER" />
    <result column="unit_rate" property="unitRate" jdbcType="INTEGER" />
    <result column="sort" property="sort" jdbcType="INTEGER" />
    <result column="unit_free_time" property="unitFreeTime" jdbcType="INTEGER" />
    <result column="create_op" property="createOp" jdbcType="BIGINT" />
    <result column="create_op_name" property="createOpName" jdbcType="VARCHAR" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
    <result column="modify_op" property="modifyOp" jdbcType="BIGINT" />
    <result column="modify_op_name" property="modifyOpName" jdbcType="VARCHAR" />
    <result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, rule_no, rule_config_no, billing_config_type, isDay, start_time, end_time, start_billing_time, 
    end_billing_time, unit, unit_rate, sort, unit_free_time, create_op, create_op_name, 
    create_time, modify_op, modify_op_name, modify_time
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    select 
    <include refid="Base_Column_List" />
    from t_billing_rule_config
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    delete from t_billing_rule_config
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.zteits.bill.domain.TBillingRuleConfig" >
    <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_billing_rule_config (rule_no, rule_config_no, billing_config_type, 
      isDay, start_time, end_time, 
      start_billing_time, end_billing_time, unit, 
      unit_rate, sort, unit_free_time, 
      create_op, create_op_name, create_time, 
      modify_op, modify_op_name, modify_time
      )
    values (#{ruleNo,jdbcType=VARCHAR}, #{ruleConfigNo,jdbcType=VARCHAR}, #{billingConfigType,jdbcType=INTEGER}, 
      #{isday,jdbcType=INTEGER}, #{startTime,jdbcType=TIME}, #{endTime,jdbcType=TIME}, 
      #{startBillingTime,jdbcType=INTEGER}, #{endBillingTime,jdbcType=INTEGER}, #{unit,jdbcType=INTEGER}, 
      #{unitRate,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER}, #{unitFreeTime,jdbcType=INTEGER}, 
      #{createOp,jdbcType=BIGINT}, #{createOpName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{modifyOp,jdbcType=BIGINT}, #{modifyOpName,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.bill.domain.TBillingRuleConfig" >
    <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_billing_rule_config
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="ruleNo != null" >
        rule_no,
      </if>
      <if test="ruleConfigNo != null" >
        rule_config_no,
      </if>
      <if test="billingConfigType != null" >
        billing_config_type,
      </if>
      <if test="isday != null" >
        isDay,
      </if>
      <if test="startTime != null" >
        start_time,
      </if>
      <if test="endTime != null" >
        end_time,
      </if>
      <if test="startBillingTime != null" >
        start_billing_time,
      </if>
      <if test="endBillingTime != null" >
        end_billing_time,
      </if>
      <if test="unit != null" >
        unit,
      </if>
      <if test="unitRate != null" >
        unit_rate,
      </if>
      <if test="sort != null" >
        sort,
      </if>
      <if test="unitFreeTime != null" >
        unit_free_time,
      </if>
      <if test="createOp != null" >
        create_op,
      </if>
      <if test="createOpName != null" >
        create_op_name,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
      <if test="modifyOp != null" >
        modify_op,
      </if>
      <if test="modifyOpName != null" >
        modify_op_name,
      </if>
      <if test="modifyTime != null" >
        modify_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="ruleNo != null" >
        #{ruleNo,jdbcType=VARCHAR},
      </if>
      <if test="ruleConfigNo != null" >
        #{ruleConfigNo,jdbcType=VARCHAR},
      </if>
      <if test="billingConfigType != null" >
        #{billingConfigType,jdbcType=INTEGER},
      </if>
      <if test="isday != null" >
        #{isday,jdbcType=INTEGER},
      </if>
      <if test="startTime != null" >
        #{startTime,jdbcType=TIME},
      </if>
      <if test="endTime != null" >
        #{endTime,jdbcType=TIME},
      </if>
      <if test="startBillingTime != null" >
        #{startBillingTime,jdbcType=INTEGER},
      </if>
      <if test="endBillingTime != null" >
        #{endBillingTime,jdbcType=INTEGER},
      </if>
      <if test="unit != null" >
        #{unit,jdbcType=INTEGER},
      </if>
      <if test="unitRate != null" >
        #{unitRate,jdbcType=INTEGER},
      </if>
      <if test="sort != null" >
        #{sort,jdbcType=INTEGER},
      </if>
      <if test="unitFreeTime != null" >
        #{unitFreeTime,jdbcType=INTEGER},
      </if>
      <if test="createOp != null" >
        #{createOp,jdbcType=BIGINT},
      </if>
      <if test="createOpName != null" >
        #{createOpName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyOp != null" >
        #{modifyOp,jdbcType=BIGINT},
      </if>
      <if test="modifyOpName != null" >
        #{modifyOpName,jdbcType=VARCHAR},
      </if>
      <if test="modifyTime != null" >
        #{modifyTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.bill.domain.TBillingRuleConfig" >
    update t_billing_rule_config
    <set >
      <if test="ruleNo != null" >
        rule_no = #{ruleNo,jdbcType=VARCHAR},
      </if>
      <if test="ruleConfigNo != null" >
        rule_config_no = #{ruleConfigNo,jdbcType=VARCHAR},
      </if>
      <if test="billingConfigType != null" >
        billing_config_type = #{billingConfigType,jdbcType=INTEGER},
      </if>
      <if test="isday != null" >
        isDay = #{isday,jdbcType=INTEGER},
      </if>
      <if test="startTime != null" >
        start_time = #{startTime,jdbcType=TIME},
      </if>
      <if test="endTime != null" >
        end_time = #{endTime,jdbcType=TIME},
      </if>
      <if test="startBillingTime != null" >
        start_billing_time = #{startBillingTime,jdbcType=INTEGER},
      </if>
      <if test="endBillingTime != null" >
        end_billing_time = #{endBillingTime,jdbcType=INTEGER},
      </if>
      <if test="unit != null" >
        unit = #{unit,jdbcType=INTEGER},
      </if>
      <if test="unitRate != null" >
        unit_rate = #{unitRate,jdbcType=INTEGER},
      </if>
      <if test="sort != null" >
        sort = #{sort,jdbcType=INTEGER},
      </if>
      <if test="unitFreeTime != null" >
        unit_free_time = #{unitFreeTime,jdbcType=INTEGER},
      </if>
      <if test="createOp != null" >
        create_op = #{createOp,jdbcType=BIGINT},
      </if>
      <if test="createOpName != null" >
        create_op_name = #{createOpName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyOp != null" >
        modify_op = #{modifyOp,jdbcType=BIGINT},
      </if>
      <if test="modifyOpName != null" >
        modify_op_name = #{modifyOpName,jdbcType=VARCHAR},
      </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.TBillingRuleConfig" >
    update t_billing_rule_config
    set rule_no = #{ruleNo,jdbcType=VARCHAR},
      rule_config_no = #{ruleConfigNo,jdbcType=VARCHAR},
      billing_config_type = #{billingConfigType,jdbcType=INTEGER},
      isDay = #{isday,jdbcType=INTEGER},
      start_time = #{startTime,jdbcType=TIME},
      end_time = #{endTime,jdbcType=TIME},
      start_billing_time = #{startBillingTime,jdbcType=INTEGER},
      end_billing_time = #{endBillingTime,jdbcType=INTEGER},
      unit = #{unit,jdbcType=INTEGER},
      unit_rate = #{unitRate,jdbcType=INTEGER},
      sort = #{sort,jdbcType=INTEGER},
      unit_free_time = #{unitFreeTime,jdbcType=INTEGER},
      create_op = #{createOp,jdbcType=BIGINT},
      create_op_name = #{createOpName,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      modify_op = #{modifyOp,jdbcType=BIGINT},
      modify_op_name = #{modifyOpName,jdbcType=VARCHAR},
      modify_time = #{modifyTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>