TdClRuleMapper.xml 12.1 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.TdClRuleMapper">
  <resultMap id="BaseResultMap" type="com.zteits.bill.domain.TdClRule">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="rule_collect_id" jdbcType="VARCHAR" property="ruleCollectId" />
    <result column="rule_id" jdbcType="VARCHAR" property="ruleId" />
    <result column="fee_type" jdbcType="INTEGER" property="feeType" />
    <result column="car_type" jdbcType="INTEGER" property="carType" />
    <result column="loop_type" jdbcType="INTEGER" property="loopType" />
    <result column="rule_fee_limit" jdbcType="INTEGER" property="ruleFeeLimit" />
    <result column="cross_period_strategy" jdbcType="INTEGER" property="crossPeriodStrategy" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="create_by" jdbcType="VARCHAR" property="createBy" />
    <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    id, rule_collect_id, rule_id, fee_type, car_type, loop_type, rule_fee_limit, cross_period_strategy, 
    create_time, update_time, create_by, update_by
  </sql>
  <select id="selectByExample" parameterType="com.zteits.bill.domain.TdClRuleExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from td_cl_rule
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from td_cl_rule
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from td_cl_rule
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.bill.domain.TdClRuleExample">
    delete from td_cl_rule
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.bill.domain.TdClRule">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_cl_rule (rule_collect_id, rule_id, fee_type, 
      car_type, loop_type, rule_fee_limit, 
      cross_period_strategy, create_time, update_time, 
      create_by, update_by)
    values (#{ruleCollectId,jdbcType=VARCHAR}, #{ruleId,jdbcType=VARCHAR}, #{feeType,jdbcType=INTEGER}, 
      #{carType,jdbcType=INTEGER}, #{loopType,jdbcType=INTEGER}, #{ruleFeeLimit,jdbcType=INTEGER}, 
      #{crossPeriodStrategy,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, 
      #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.bill.domain.TdClRule">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_cl_rule
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="ruleCollectId != null">
        rule_collect_id,
      </if>
      <if test="ruleId != null">
        rule_id,
      </if>
      <if test="feeType != null">
        fee_type,
      </if>
      <if test="carType != null">
        car_type,
      </if>
      <if test="loopType != null">
        loop_type,
      </if>
      <if test="ruleFeeLimit != null">
        rule_fee_limit,
      </if>
      <if test="crossPeriodStrategy != null">
        cross_period_strategy,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="createBy != null">
        create_by,
      </if>
      <if test="updateBy != null">
        update_by,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="ruleCollectId != null">
        #{ruleCollectId,jdbcType=VARCHAR},
      </if>
      <if test="ruleId != null">
        #{ruleId,jdbcType=VARCHAR},
      </if>
      <if test="feeType != null">
        #{feeType,jdbcType=INTEGER},
      </if>
      <if test="carType != null">
        #{carType,jdbcType=INTEGER},
      </if>
      <if test="loopType != null">
        #{loopType,jdbcType=INTEGER},
      </if>
      <if test="ruleFeeLimit != null">
        #{ruleFeeLimit,jdbcType=INTEGER},
      </if>
      <if test="crossPeriodStrategy != null">
        #{crossPeriodStrategy,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createBy != null">
        #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="updateBy != null">
        #{updateBy,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.bill.domain.TdClRuleExample" resultType="java.lang.Long">
    select count(*) from td_cl_rule
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update td_cl_rule
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.ruleCollectId != null">
        rule_collect_id = #{record.ruleCollectId,jdbcType=VARCHAR},
      </if>
      <if test="record.ruleId != null">
        rule_id = #{record.ruleId,jdbcType=VARCHAR},
      </if>
      <if test="record.feeType != null">
        fee_type = #{record.feeType,jdbcType=INTEGER},
      </if>
      <if test="record.carType != null">
        car_type = #{record.carType,jdbcType=INTEGER},
      </if>
      <if test="record.loopType != null">
        loop_type = #{record.loopType,jdbcType=INTEGER},
      </if>
      <if test="record.ruleFeeLimit != null">
        rule_fee_limit = #{record.ruleFeeLimit,jdbcType=INTEGER},
      </if>
      <if test="record.crossPeriodStrategy != null">
        cross_period_strategy = #{record.crossPeriodStrategy,jdbcType=INTEGER},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createBy != null">
        create_by = #{record.createBy,jdbcType=VARCHAR},
      </if>
      <if test="record.updateBy != null">
        update_by = #{record.updateBy,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update td_cl_rule
    set id = #{record.id,jdbcType=BIGINT},
      rule_collect_id = #{record.ruleCollectId,jdbcType=VARCHAR},
      rule_id = #{record.ruleId,jdbcType=VARCHAR},
      fee_type = #{record.feeType,jdbcType=INTEGER},
      car_type = #{record.carType,jdbcType=INTEGER},
      loop_type = #{record.loopType,jdbcType=INTEGER},
      rule_fee_limit = #{record.ruleFeeLimit,jdbcType=INTEGER},
      cross_period_strategy = #{record.crossPeriodStrategy,jdbcType=INTEGER},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      create_by = #{record.createBy,jdbcType=VARCHAR},
      update_by = #{record.updateBy,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.bill.domain.TdClRule">
    update td_cl_rule
    <set>
      <if test="ruleCollectId != null">
        rule_collect_id = #{ruleCollectId,jdbcType=VARCHAR},
      </if>
      <if test="ruleId != null">
        rule_id = #{ruleId,jdbcType=VARCHAR},
      </if>
      <if test="feeType != null">
        fee_type = #{feeType,jdbcType=INTEGER},
      </if>
      <if test="carType != null">
        car_type = #{carType,jdbcType=INTEGER},
      </if>
      <if test="loopType != null">
        loop_type = #{loopType,jdbcType=INTEGER},
      </if>
      <if test="ruleFeeLimit != null">
        rule_fee_limit = #{ruleFeeLimit,jdbcType=INTEGER},
      </if>
      <if test="crossPeriodStrategy != null">
        cross_period_strategy = #{crossPeriodStrategy,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createBy != null">
        create_by = #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="updateBy != null">
        update_by = #{updateBy,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.bill.domain.TdClRule">
    update td_cl_rule
    set rule_collect_id = #{ruleCollectId,jdbcType=VARCHAR},
      rule_id = #{ruleId,jdbcType=VARCHAR},
      fee_type = #{feeType,jdbcType=INTEGER},
      car_type = #{carType,jdbcType=INTEGER},
      loop_type = #{loopType,jdbcType=INTEGER},
      rule_fee_limit = #{ruleFeeLimit,jdbcType=INTEGER},
      cross_period_strategy = #{crossPeriodStrategy,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      create_by = #{createBy,jdbcType=VARCHAR},
      update_by = #{updateBy,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>