TdClRuleCollectMapper.xml 9.77 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.TdClRuleCollectMapper">
  <resultMap id="BaseResultMap" type="com.zteits.bill.domain.TdClRuleCollect">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="rule_collect_id" jdbcType="VARCHAR" property="ruleCollectId" />
    <result column="rule_collect_name" jdbcType="VARCHAR" property="ruleCollectName" />
    <result column="car_type_strategy" jdbcType="INTEGER" property="carTypeStrategy" />
    <result column="rule_desc" jdbcType="VARCHAR" property="ruleDesc" />
    <result column="data_flg" jdbcType="CHAR" property="dataFlg" />
    <result column="fee_type" jdbcType="INTEGER" property="feeType" />
    <result column="org_id" jdbcType="BIGINT" property="orgId" />
  </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_collect_name, car_type_strategy, rule_desc, data_flg, fee_type, 
    org_id
  </sql>
  <select id="selectByExample" parameterType="com.zteits.bill.domain.TdClRuleCollectExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from td_cl_rule_collect
    <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_collect
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from td_cl_rule_collect
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.bill.domain.TdClRuleCollectExample">
    delete from td_cl_rule_collect
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.bill.domain.TdClRuleCollect">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_cl_rule_collect (rule_collect_id, rule_collect_name, car_type_strategy, 
      rule_desc, data_flg, fee_type, 
      org_id)
    values (#{ruleCollectId,jdbcType=VARCHAR}, #{ruleCollectName,jdbcType=VARCHAR}, #{carTypeStrategy,jdbcType=INTEGER}, 
      #{ruleDesc,jdbcType=VARCHAR}, #{dataFlg,jdbcType=CHAR}, #{feeType,jdbcType=INTEGER}, 
      #{orgId,jdbcType=BIGINT})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.bill.domain.TdClRuleCollect">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_cl_rule_collect
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="ruleCollectId != null">
        rule_collect_id,
      </if>
      <if test="ruleCollectName != null">
        rule_collect_name,
      </if>
      <if test="carTypeStrategy != null">
        car_type_strategy,
      </if>
      <if test="ruleDesc != null">
        rule_desc,
      </if>
      <if test="dataFlg != null">
        data_flg,
      </if>
      <if test="feeType != null">
        fee_type,
      </if>
      <if test="orgId != null">
        org_id,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="ruleCollectId != null">
        #{ruleCollectId,jdbcType=VARCHAR},
      </if>
      <if test="ruleCollectName != null">
        #{ruleCollectName,jdbcType=VARCHAR},
      </if>
      <if test="carTypeStrategy != null">
        #{carTypeStrategy,jdbcType=INTEGER},
      </if>
      <if test="ruleDesc != null">
        #{ruleDesc,jdbcType=VARCHAR},
      </if>
      <if test="dataFlg != null">
        #{dataFlg,jdbcType=CHAR},
      </if>
      <if test="feeType != null">
        #{feeType,jdbcType=INTEGER},
      </if>
      <if test="orgId != null">
        #{orgId,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.bill.domain.TdClRuleCollectExample" resultType="java.lang.Long">
    select count(*) from td_cl_rule_collect
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update td_cl_rule_collect
    <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.ruleCollectName != null">
        rule_collect_name = #{record.ruleCollectName,jdbcType=VARCHAR},
      </if>
      <if test="record.carTypeStrategy != null">
        car_type_strategy = #{record.carTypeStrategy,jdbcType=INTEGER},
      </if>
      <if test="record.ruleDesc != null">
        rule_desc = #{record.ruleDesc,jdbcType=VARCHAR},
      </if>
      <if test="record.dataFlg != null">
        data_flg = #{record.dataFlg,jdbcType=CHAR},
      </if>
      <if test="record.feeType != null">
        fee_type = #{record.feeType,jdbcType=INTEGER},
      </if>
      <if test="record.orgId != null">
        org_id = #{record.orgId,jdbcType=BIGINT},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update td_cl_rule_collect
    set id = #{record.id,jdbcType=BIGINT},
      rule_collect_id = #{record.ruleCollectId,jdbcType=VARCHAR},
      rule_collect_name = #{record.ruleCollectName,jdbcType=VARCHAR},
      car_type_strategy = #{record.carTypeStrategy,jdbcType=INTEGER},
      rule_desc = #{record.ruleDesc,jdbcType=VARCHAR},
      data_flg = #{record.dataFlg,jdbcType=CHAR},
      fee_type = #{record.feeType,jdbcType=INTEGER},
      org_id = #{record.orgId,jdbcType=BIGINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.bill.domain.TdClRuleCollect">
    update td_cl_rule_collect
    <set>
      <if test="ruleCollectId != null">
        rule_collect_id = #{ruleCollectId,jdbcType=VARCHAR},
      </if>
      <if test="ruleCollectName != null">
        rule_collect_name = #{ruleCollectName,jdbcType=VARCHAR},
      </if>
      <if test="carTypeStrategy != null">
        car_type_strategy = #{carTypeStrategy,jdbcType=INTEGER},
      </if>
      <if test="ruleDesc != null">
        rule_desc = #{ruleDesc,jdbcType=VARCHAR},
      </if>
      <if test="dataFlg != null">
        data_flg = #{dataFlg,jdbcType=CHAR},
      </if>
      <if test="feeType != null">
        fee_type = #{feeType,jdbcType=INTEGER},
      </if>
      <if test="orgId != null">
        org_id = #{orgId,jdbcType=BIGINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.bill.domain.TdClRuleCollect">
    update td_cl_rule_collect
    set rule_collect_id = #{ruleCollectId,jdbcType=VARCHAR},
      rule_collect_name = #{ruleCollectName,jdbcType=VARCHAR},
      car_type_strategy = #{carTypeStrategy,jdbcType=INTEGER},
      rule_desc = #{ruleDesc,jdbcType=VARCHAR},
      data_flg = #{dataFlg,jdbcType=CHAR},
      fee_type = #{feeType,jdbcType=INTEGER},
      org_id = #{orgId,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>