TdCBusinessCouponRuleMapper.xml 14.9 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.business.mapper.TdCBusinessCouponRuleMapper">
  <resultMap id="BaseResultMap" type="com.zteits.business.domain.TdCBusinessCouponRule">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="card_rule_no" jdbcType="VARCHAR" property="cardRuleNo" />
    <result column="card_rule_name" jdbcType="VARCHAR" property="cardRuleName" />
    <result column="card_type" jdbcType="INTEGER" property="cardType" />
    <result column="coupons_type" jdbcType="INTEGER" property="couponsType" />
    <result column="use_rule" jdbcType="INTEGER" property="useRule" />
    <result column="disc_value" jdbcType="VARCHAR" property="discValue" />
    <result column="full_cut_value" jdbcType="INTEGER" property="fullCutValue" />
    <result column="is_superp_use" jdbcType="INTEGER" property="isSuperpUse" />
    <result column="create_empid" jdbcType="VARCHAR" property="createEmpid" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="modfiy_empid" jdbcType="VARCHAR" property="modfiyEmpid" />
    <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
    <result column="card_content" jdbcType="VARCHAR" property="cardContent" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
  </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, card_rule_no, card_rule_name, card_type, coupons_type, use_rule, disc_value, 
    full_cut_value, is_superp_use, create_empid, create_date, modfiy_empid, modfiy_date, 
    card_content, data_state, remark
  </sql>
  <select id="selectByExample" parameterType="com.zteits.business.domain.TdCBusinessCouponRuleExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from td_c_business_coupon_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_c_business_coupon_rule
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from td_c_business_coupon_rule
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.business.domain.TdCBusinessCouponRuleExample">
    delete from td_c_business_coupon_rule
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.business.domain.TdCBusinessCouponRule">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_c_business_coupon_rule (card_rule_no, card_rule_name, card_type, 
      coupons_type, use_rule, disc_value, 
      full_cut_value, is_superp_use, create_empid, 
      create_date, modfiy_empid, modfiy_date, 
      card_content, data_state, remark
      )
    values (#{cardRuleNo,jdbcType=VARCHAR}, #{cardRuleName,jdbcType=VARCHAR}, #{cardType,jdbcType=INTEGER}, 
      #{couponsType,jdbcType=INTEGER}, #{useRule,jdbcType=INTEGER}, #{discValue,jdbcType=VARCHAR}, 
      #{fullCutValue,jdbcType=INTEGER}, #{isSuperpUse,jdbcType=INTEGER}, #{createEmpid,jdbcType=VARCHAR}, 
      #{createDate,jdbcType=TIMESTAMP}, #{modfiyEmpid,jdbcType=VARCHAR}, #{modfiyDate,jdbcType=TIMESTAMP}, 
      #{cardContent,jdbcType=VARCHAR}, #{dataState,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.business.domain.TdCBusinessCouponRule">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_c_business_coupon_rule
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="cardRuleNo != null">
        card_rule_no,
      </if>
      <if test="cardRuleName != null">
        card_rule_name,
      </if>
      <if test="cardType != null">
        card_type,
      </if>
      <if test="couponsType != null">
        coupons_type,
      </if>
      <if test="useRule != null">
        use_rule,
      </if>
      <if test="discValue != null">
        disc_value,
      </if>
      <if test="fullCutValue != null">
        full_cut_value,
      </if>
      <if test="isSuperpUse != null">
        is_superp_use,
      </if>
      <if test="createEmpid != null">
        create_empid,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
      <if test="modfiyEmpid != null">
        modfiy_empid,
      </if>
      <if test="modfiyDate != null">
        modfiy_date,
      </if>
      <if test="cardContent != null">
        card_content,
      </if>
      <if test="dataState != null">
        data_state,
      </if>
      <if test="remark != null">
        remark,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="cardRuleNo != null">
        #{cardRuleNo,jdbcType=VARCHAR},
      </if>
      <if test="cardRuleName != null">
        #{cardRuleName,jdbcType=VARCHAR},
      </if>
      <if test="cardType != null">
        #{cardType,jdbcType=INTEGER},
      </if>
      <if test="couponsType != null">
        #{couponsType,jdbcType=INTEGER},
      </if>
      <if test="useRule != null">
        #{useRule,jdbcType=INTEGER},
      </if>
      <if test="discValue != null">
        #{discValue,jdbcType=VARCHAR},
      </if>
      <if test="fullCutValue != null">
        #{fullCutValue,jdbcType=INTEGER},
      </if>
      <if test="isSuperpUse != null">
        #{isSuperpUse,jdbcType=INTEGER},
      </if>
      <if test="createEmpid != null">
        #{createEmpid,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modfiyEmpid != null">
        #{modfiyEmpid,jdbcType=VARCHAR},
      </if>
      <if test="modfiyDate != null">
        #{modfiyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="cardContent != null">
        #{cardContent,jdbcType=VARCHAR},
      </if>
      <if test="dataState != null">
        #{dataState,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.business.domain.TdCBusinessCouponRuleExample" resultType="java.lang.Long">
    select count(*) from td_c_business_coupon_rule
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update td_c_business_coupon_rule
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.cardRuleNo != null">
        card_rule_no = #{record.cardRuleNo,jdbcType=VARCHAR},
      </if>
      <if test="record.cardRuleName != null">
        card_rule_name = #{record.cardRuleName,jdbcType=VARCHAR},
      </if>
      <if test="record.cardType != null">
        card_type = #{record.cardType,jdbcType=INTEGER},
      </if>
      <if test="record.couponsType != null">
        coupons_type = #{record.couponsType,jdbcType=INTEGER},
      </if>
      <if test="record.useRule != null">
        use_rule = #{record.useRule,jdbcType=INTEGER},
      </if>
      <if test="record.discValue != null">
        disc_value = #{record.discValue,jdbcType=VARCHAR},
      </if>
      <if test="record.fullCutValue != null">
        full_cut_value = #{record.fullCutValue,jdbcType=INTEGER},
      </if>
      <if test="record.isSuperpUse != null">
        is_superp_use = #{record.isSuperpUse,jdbcType=INTEGER},
      </if>
      <if test="record.createEmpid != null">
        create_empid = #{record.createEmpid,jdbcType=VARCHAR},
      </if>
      <if test="record.createDate != null">
        create_date = #{record.createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.modfiyEmpid != null">
        modfiy_empid = #{record.modfiyEmpid,jdbcType=VARCHAR},
      </if>
      <if test="record.modfiyDate != null">
        modfiy_date = #{record.modfiyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.cardContent != null">
        card_content = #{record.cardContent,jdbcType=VARCHAR},
      </if>
      <if test="record.dataState != null">
        data_state = #{record.dataState,jdbcType=INTEGER},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update td_c_business_coupon_rule
    set id = #{record.id,jdbcType=BIGINT},
      card_rule_no = #{record.cardRuleNo,jdbcType=VARCHAR},
      card_rule_name = #{record.cardRuleName,jdbcType=VARCHAR},
      card_type = #{record.cardType,jdbcType=INTEGER},
      coupons_type = #{record.couponsType,jdbcType=INTEGER},
      use_rule = #{record.useRule,jdbcType=INTEGER},
      disc_value = #{record.discValue,jdbcType=VARCHAR},
      full_cut_value = #{record.fullCutValue,jdbcType=INTEGER},
      is_superp_use = #{record.isSuperpUse,jdbcType=INTEGER},
      create_empid = #{record.createEmpid,jdbcType=VARCHAR},
      create_date = #{record.createDate,jdbcType=TIMESTAMP},
      modfiy_empid = #{record.modfiyEmpid,jdbcType=VARCHAR},
      modfiy_date = #{record.modfiyDate,jdbcType=TIMESTAMP},
      card_content = #{record.cardContent,jdbcType=VARCHAR},
      data_state = #{record.dataState,jdbcType=INTEGER},
      remark = #{record.remark,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.business.domain.TdCBusinessCouponRule">
    update td_c_business_coupon_rule
    <set>
      <if test="cardRuleNo != null">
        card_rule_no = #{cardRuleNo,jdbcType=VARCHAR},
      </if>
      <if test="cardRuleName != null">
        card_rule_name = #{cardRuleName,jdbcType=VARCHAR},
      </if>
      <if test="cardType != null">
        card_type = #{cardType,jdbcType=INTEGER},
      </if>
      <if test="couponsType != null">
        coupons_type = #{couponsType,jdbcType=INTEGER},
      </if>
      <if test="useRule != null">
        use_rule = #{useRule,jdbcType=INTEGER},
      </if>
      <if test="discValue != null">
        disc_value = #{discValue,jdbcType=VARCHAR},
      </if>
      <if test="fullCutValue != null">
        full_cut_value = #{fullCutValue,jdbcType=INTEGER},
      </if>
      <if test="isSuperpUse != null">
        is_superp_use = #{isSuperpUse,jdbcType=INTEGER},
      </if>
      <if test="createEmpid != null">
        create_empid = #{createEmpid,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modfiyEmpid != null">
        modfiy_empid = #{modfiyEmpid,jdbcType=VARCHAR},
      </if>
      <if test="modfiyDate != null">
        modfiy_date = #{modfiyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="cardContent != null">
        card_content = #{cardContent,jdbcType=VARCHAR},
      </if>
      <if test="dataState != null">
        data_state = #{dataState,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.business.domain.TdCBusinessCouponRule">
    update td_c_business_coupon_rule
    set card_rule_no = #{cardRuleNo,jdbcType=VARCHAR},
      card_rule_name = #{cardRuleName,jdbcType=VARCHAR},
      card_type = #{cardType,jdbcType=INTEGER},
      coupons_type = #{couponsType,jdbcType=INTEGER},
      use_rule = #{useRule,jdbcType=INTEGER},
      disc_value = #{discValue,jdbcType=VARCHAR},
      full_cut_value = #{fullCutValue,jdbcType=INTEGER},
      is_superp_use = #{isSuperpUse,jdbcType=INTEGER},
      create_empid = #{createEmpid,jdbcType=VARCHAR},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      modfiy_empid = #{modfiyEmpid,jdbcType=VARCHAR},
      modfiy_date = #{modfiyDate,jdbcType=TIMESTAMP},
      card_content = #{cardContent,jdbcType=VARCHAR},
      data_state = #{dataState,jdbcType=INTEGER},
      remark = #{remark,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>