TBillingRuleMapper.xml 9.36 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.TBillingRuleMapper" >
  <resultMap id="BaseResultMap" type="com.zteits.bill.domain.TBillingRule" >
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="rule_no" property="ruleNo" jdbcType="VARCHAR" />
    <result column="org_id" property="orgId" jdbcType="BIGINT" />
    <result column="rule_type" property="ruleType" jdbcType="INTEGER" />
    <result column="cross_time_rule_type" property="crossTimeRuleType" jdbcType="INTEGER" />
    <result column="car_type" property="carType" jdbcType="INTEGER" />
    <result column="frist_free_time" property="fristFreeTime" jdbcType="INTEGER" />
    <result column="day_max_charge" property="dayMaxCharge" jdbcType="INTEGER" />
    <result column="max_charge" property="maxCharge" jdbcType="INTEGER" />
    <result column="apply_date_type" property="applyDateType" jdbcType="INTEGER" />
    <result column="check_state" property="checkState" jdbcType="INTEGER" />
    <result column="data_state" property="dataState" 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, org_id, rule_type, cross_time_rule_type, car_type, frist_free_time, 
    day_max_charge, max_charge, apply_date_type, check_state, data_state, 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
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    delete from t_billing_rule
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.zteits.bill.domain.TBillingRule" >
    <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_billing_rule (rule_no, org_id, rule_type, 
      cross_time_rule_type, car_type, frist_free_time, 
      day_max_charge, max_charge, apply_date_type, 
      check_state, data_state, create_op, 
      create_op_name, create_time, modify_op, 
      modify_op_name, modify_time)
    values (#{ruleNo,jdbcType=VARCHAR}, #{orgId,jdbcType=BIGINT}, #{ruleType,jdbcType=INTEGER}, 
      #{crossTimeRuleType,jdbcType=INTEGER}, #{carType,jdbcType=INTEGER}, #{fristFreeTime,jdbcType=INTEGER}, 
      #{dayMaxCharge,jdbcType=INTEGER}, #{maxCharge,jdbcType=INTEGER}, #{applyDateType,jdbcType=INTEGER}, 
      #{checkState,jdbcType=INTEGER}, #{dataState,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.TBillingRule" >
    <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_billing_rule
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="ruleNo != null" >
        rule_no,
      </if>
      <if test="orgId != null" >
        org_id,
      </if>
      <if test="ruleType != null" >
        rule_type,
      </if>
      <if test="crossTimeRuleType != null" >
        cross_time_rule_type,
      </if>
      <if test="carType != null" >
        car_type,
      </if>
      <if test="fristFreeTime != null" >
        frist_free_time,
      </if>
      <if test="dayMaxCharge != null" >
        day_max_charge,
      </if>
      <if test="maxCharge != null" >
        max_charge,
      </if>
      <if test="applyDateType != null" >
        apply_date_type,
      </if>
      <if test="checkState != null" >
        check_state,
      </if>
      <if test="dataState != null" >
        data_state,
      </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="orgId != null" >
        #{orgId,jdbcType=BIGINT},
      </if>
      <if test="ruleType != null" >
        #{ruleType,jdbcType=INTEGER},
      </if>
      <if test="crossTimeRuleType != null" >
        #{crossTimeRuleType,jdbcType=INTEGER},
      </if>
      <if test="carType != null" >
        #{carType,jdbcType=INTEGER},
      </if>
      <if test="fristFreeTime != null" >
        #{fristFreeTime,jdbcType=INTEGER},
      </if>
      <if test="dayMaxCharge != null" >
        #{dayMaxCharge,jdbcType=INTEGER},
      </if>
      <if test="maxCharge != null" >
        #{maxCharge,jdbcType=INTEGER},
      </if>
      <if test="applyDateType != null" >
        #{applyDateType,jdbcType=INTEGER},
      </if>
      <if test="checkState != null" >
        #{checkState,jdbcType=INTEGER},
      </if>
      <if test="dataState != null" >
        #{dataState,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.TBillingRule" >
    update t_billing_rule
    <set >
      <if test="ruleNo != null" >
        rule_no = #{ruleNo,jdbcType=VARCHAR},
      </if>
      <if test="orgId != null" >
        org_id = #{orgId,jdbcType=BIGINT},
      </if>
      <if test="ruleType != null" >
        rule_type = #{ruleType,jdbcType=INTEGER},
      </if>
      <if test="crossTimeRuleType != null" >
        cross_time_rule_type = #{crossTimeRuleType,jdbcType=INTEGER},
      </if>
      <if test="carType != null" >
        car_type = #{carType,jdbcType=INTEGER},
      </if>
      <if test="fristFreeTime != null" >
        frist_free_time = #{fristFreeTime,jdbcType=INTEGER},
      </if>
      <if test="dayMaxCharge != null" >
        day_max_charge = #{dayMaxCharge,jdbcType=INTEGER},
      </if>
      <if test="maxCharge != null" >
        max_charge = #{maxCharge,jdbcType=INTEGER},
      </if>
      <if test="applyDateType != null" >
        apply_date_type = #{applyDateType,jdbcType=INTEGER},
      </if>
      <if test="checkState != null" >
        check_state = #{checkState,jdbcType=INTEGER},
      </if>
      <if test="dataState != null" >
        data_state = #{dataState,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.TBillingRule" >
    update t_billing_rule
    set rule_no = #{ruleNo,jdbcType=VARCHAR},
      org_id = #{orgId,jdbcType=BIGINT},
      rule_type = #{ruleType,jdbcType=INTEGER},
      cross_time_rule_type = #{crossTimeRuleType,jdbcType=INTEGER},
      car_type = #{carType,jdbcType=INTEGER},
      frist_free_time = #{fristFreeTime,jdbcType=INTEGER},
      day_max_charge = #{dayMaxCharge,jdbcType=INTEGER},
      max_charge = #{maxCharge,jdbcType=INTEGER},
      apply_date_type = #{applyDateType,jdbcType=INTEGER},
      check_state = #{checkState,jdbcType=INTEGER},
      data_state = #{dataState,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>