TVipAreaCardCustInfoRelMapper.xml 11.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.bill.mapper.TVipAreaCardCustInfoRelMapper">
  <resultMap id="BaseResultMap" type="com.zteits.bill.domain.TVipAreaCardCustInfoRel">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="cust_card_no" jdbcType="VARCHAR" property="custCardNo" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="car_number" jdbcType="VARCHAR" property="carNumber" />
    <result column="eff_date" jdbcType="TIMESTAMP" property="effDate" />
    <result column="exp_date" jdbcType="TIMESTAMP" property="expDate" />
    <result column="push_state" jdbcType="INTEGER" property="pushState" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="record_no" jdbcType="VARCHAR" property="recordNo" />
    <result column="org_id" jdbcType="BIGINT" property="orgId" />
    <result column="org_name" jdbcType="VARCHAR" property="orgName" />
  </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, cust_card_no, pl_no, car_number, eff_date, exp_date, push_state, data_state, 
    remark, record_no, org_id, org_name
  </sql>
  <select id="selectByExample" parameterType="com.zteits.bill.domain.TVipAreaCardCustInfoRelExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from t_vip_area_card_cust_info_rel
    <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 t_vip_area_card_cust_info_rel
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from t_vip_area_card_cust_info_rel
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.bill.domain.TVipAreaCardCustInfoRelExample">
    delete from t_vip_area_card_cust_info_rel
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.bill.domain.TVipAreaCardCustInfoRel">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_vip_area_card_cust_info_rel (cust_card_no, pl_no, car_number, 
      eff_date, exp_date, push_state, 
      data_state, remark, record_no, 
      org_id, org_name)
    values (#{custCardNo,jdbcType=VARCHAR}, #{plNo,jdbcType=VARCHAR}, #{carNumber,jdbcType=VARCHAR}, 
      #{effDate,jdbcType=TIMESTAMP}, #{expDate,jdbcType=TIMESTAMP}, #{pushState,jdbcType=INTEGER}, 
      #{dataState,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{recordNo,jdbcType=VARCHAR}, 
      #{orgId,jdbcType=BIGINT}, #{orgName,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.bill.domain.TVipAreaCardCustInfoRel">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_vip_area_card_cust_info_rel
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="custCardNo != null">
        cust_card_no,
      </if>
      <if test="plNo != null">
        pl_no,
      </if>
      <if test="carNumber != null">
        car_number,
      </if>
      <if test="effDate != null">
        eff_date,
      </if>
      <if test="expDate != null">
        exp_date,
      </if>
      <if test="pushState != null">
        push_state,
      </if>
      <if test="dataState != null">
        data_state,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="recordNo != null">
        record_no,
      </if>
      <if test="orgId != null">
        org_id,
      </if>
      <if test="orgName != null">
        org_name,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="custCardNo != null">
        #{custCardNo,jdbcType=VARCHAR},
      </if>
      <if test="plNo != null">
        #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="carNumber != null">
        #{carNumber,jdbcType=VARCHAR},
      </if>
      <if test="effDate != null">
        #{effDate,jdbcType=TIMESTAMP},
      </if>
      <if test="expDate != null">
        #{expDate,jdbcType=TIMESTAMP},
      </if>
      <if test="pushState != null">
        #{pushState,jdbcType=INTEGER},
      </if>
      <if test="dataState != null">
        #{dataState,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="recordNo != null">
        #{recordNo,jdbcType=VARCHAR},
      </if>
      <if test="orgId != null">
        #{orgId,jdbcType=BIGINT},
      </if>
      <if test="orgName != null">
        #{orgName,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.bill.domain.TVipAreaCardCustInfoRelExample" resultType="java.lang.Long">
    select count(*) from t_vip_area_card_cust_info_rel
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update t_vip_area_card_cust_info_rel
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.custCardNo != null">
        cust_card_no = #{record.custCardNo,jdbcType=VARCHAR},
      </if>
      <if test="record.plNo != null">
        pl_no = #{record.plNo,jdbcType=VARCHAR},
      </if>
      <if test="record.carNumber != null">
        car_number = #{record.carNumber,jdbcType=VARCHAR},
      </if>
      <if test="record.effDate != null">
        eff_date = #{record.effDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.expDate != null">
        exp_date = #{record.expDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.pushState != null">
        push_state = #{record.pushState,jdbcType=INTEGER},
      </if>
      <if test="record.dataState != null">
        data_state = #{record.dataState,jdbcType=INTEGER},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
      <if test="record.recordNo != null">
        record_no = #{record.recordNo,jdbcType=VARCHAR},
      </if>
      <if test="record.orgId != null">
        org_id = #{record.orgId,jdbcType=BIGINT},
      </if>
      <if test="record.orgName != null">
        org_name = #{record.orgName,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update t_vip_area_card_cust_info_rel
    set id = #{record.id,jdbcType=BIGINT},
      cust_card_no = #{record.custCardNo,jdbcType=VARCHAR},
      pl_no = #{record.plNo,jdbcType=VARCHAR},
      car_number = #{record.carNumber,jdbcType=VARCHAR},
      eff_date = #{record.effDate,jdbcType=TIMESTAMP},
      exp_date = #{record.expDate,jdbcType=TIMESTAMP},
      push_state = #{record.pushState,jdbcType=INTEGER},
      data_state = #{record.dataState,jdbcType=INTEGER},
      remark = #{record.remark,jdbcType=VARCHAR},
      record_no = #{record.recordNo,jdbcType=VARCHAR},
      org_id = #{record.orgId,jdbcType=BIGINT},
      org_name = #{record.orgName,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.bill.domain.TVipAreaCardCustInfoRel">
    update t_vip_area_card_cust_info_rel
    <set>
      <if test="custCardNo != null">
        cust_card_no = #{custCardNo,jdbcType=VARCHAR},
      </if>
      <if test="plNo != null">
        pl_no = #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="carNumber != null">
        car_number = #{carNumber,jdbcType=VARCHAR},
      </if>
      <if test="effDate != null">
        eff_date = #{effDate,jdbcType=TIMESTAMP},
      </if>
      <if test="expDate != null">
        exp_date = #{expDate,jdbcType=TIMESTAMP},
      </if>
      <if test="pushState != null">
        push_state = #{pushState,jdbcType=INTEGER},
      </if>
      <if test="dataState != null">
        data_state = #{dataState,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="recordNo != null">
        record_no = #{recordNo,jdbcType=VARCHAR},
      </if>
      <if test="orgId != null">
        org_id = #{orgId,jdbcType=BIGINT},
      </if>
      <if test="orgName != null">
        org_name = #{orgName,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.bill.domain.TVipAreaCardCustInfoRel">
    update t_vip_area_card_cust_info_rel
    set cust_card_no = #{custCardNo,jdbcType=VARCHAR},
      pl_no = #{plNo,jdbcType=VARCHAR},
      car_number = #{carNumber,jdbcType=VARCHAR},
      eff_date = #{effDate,jdbcType=TIMESTAMP},
      exp_date = #{expDate,jdbcType=TIMESTAMP},
      push_state = #{pushState,jdbcType=INTEGER},
      data_state = #{dataState,jdbcType=INTEGER},
      remark = #{remark,jdbcType=VARCHAR},
      record_no = #{recordNo,jdbcType=VARCHAR},
      org_id = #{orgId,jdbcType=BIGINT},
      org_name = #{orgName,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>