TdClCustomerCarInfoMapper.xml 10.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.pay.mapper.TdClCustomerCarInfoMapper">
  <resultMap id="BaseResultMap" type="com.zteits.pay.domain.TdClCustomerCarInfo">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="customer_name" jdbcType="VARCHAR" property="customerName" />
    <result column="car_no" jdbcType="VARCHAR" property="carNo" />
    <result column="car_type" jdbcType="INTEGER" property="carType" />
    <result column="isFixedCar" jdbcType="INTEGER" property="isfixedcar" />
    <result column="data_status" jdbcType="INTEGER" property="dataStatus" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
    <result column="customer_no" jdbcType="VARCHAR" property="customerNo" />
  </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, customer_name, car_no, car_type, isFixedCar, data_status, create_date, update_date, 
    customer_no
  </sql>
  <select id="selectByExample" parameterType="com.zteits.pay.domain.TdClCustomerCarInfoExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    'true' as QUERYID,
    <include refid="Base_Column_List" />
    from td_cl_customer_car_info
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>

    <select id="selectDtoByExample" parameterType="com.zteits.pay.domain.TdClCustomerCarInfoExample" resultMap="BaseResultMap">
        select
        <if test="distinct">
            distinct
        </if>
        'true' as QUERYID,
        <include refid="Base_Column_List" />
        from td_cl_customer_car_info
        <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_customer_car_info
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from td_cl_customer_car_info
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.pay.domain.TdClCustomerCarInfoExample">
    delete from td_cl_customer_car_info
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.pay.domain.TdClCustomerCarInfo">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_cl_customer_car_info (customer_name, car_no, car_type, 
      isFixedCar, data_status, create_date, 
      update_date, customer_no)
    values (#{customerName,jdbcType=VARCHAR}, #{carNo,jdbcType=VARCHAR}, #{carType,jdbcType=INTEGER}, 
      #{isfixedcar,jdbcType=INTEGER}, #{dataStatus,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
      #{updateDate,jdbcType=TIMESTAMP}, #{customerNo,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.pay.domain.TdClCustomerCarInfo">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_cl_customer_car_info
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="customerName != null">
        customer_name,
      </if>
      <if test="carNo != null">
        car_no,
      </if>
      <if test="carType != null">
        car_type,
      </if>
      <if test="isfixedcar != null">
        isFixedCar,
      </if>
      <if test="dataStatus != null">
        data_status,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
      <if test="updateDate != null">
        update_date,
      </if>
      <if test="customerNo != null">
        customer_no,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="customerName != null">
        #{customerName,jdbcType=VARCHAR},
      </if>
      <if test="carNo != null">
        #{carNo,jdbcType=VARCHAR},
      </if>
      <if test="carType != null">
        #{carType,jdbcType=INTEGER},
      </if>
      <if test="isfixedcar != null">
        #{isfixedcar,jdbcType=INTEGER},
      </if>
      <if test="dataStatus != null">
        #{dataStatus,jdbcType=INTEGER},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="updateDate != null">
        #{updateDate,jdbcType=TIMESTAMP},
      </if>
      <if test="customerNo != null">
        #{customerNo,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.pay.domain.TdClCustomerCarInfoExample" resultType="java.lang.Long">
    select count(*) from td_cl_customer_car_info
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update td_cl_customer_car_info
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.customerName != null">
        customer_name = #{record.customerName,jdbcType=VARCHAR},
      </if>
      <if test="record.carNo != null">
        car_no = #{record.carNo,jdbcType=VARCHAR},
      </if>
      <if test="record.carType != null">
        car_type = #{record.carType,jdbcType=INTEGER},
      </if>
      <if test="record.isfixedcar != null">
        isFixedCar = #{record.isfixedcar,jdbcType=INTEGER},
      </if>
      <if test="record.dataStatus != null">
        data_status = #{record.dataStatus,jdbcType=INTEGER},
      </if>
      <if test="record.createDate != null">
        create_date = #{record.createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateDate != null">
        update_date = #{record.updateDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.customerNo != null">
        customer_no = #{record.customerNo,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_customer_car_info
    set id = #{record.id,jdbcType=BIGINT},
      customer_name = #{record.customerName,jdbcType=VARCHAR},
      car_no = #{record.carNo,jdbcType=VARCHAR},
      car_type = #{record.carType,jdbcType=INTEGER},
      isFixedCar = #{record.isfixedcar,jdbcType=INTEGER},
      data_status = #{record.dataStatus,jdbcType=INTEGER},
      create_date = #{record.createDate,jdbcType=TIMESTAMP},
      update_date = #{record.updateDate,jdbcType=TIMESTAMP},
      customer_no = #{record.customerNo,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.pay.domain.TdClCustomerCarInfo">
    update td_cl_customer_car_info
    <set>
      <if test="customerName != null">
        customer_name = #{customerName,jdbcType=VARCHAR},
      </if>
      <if test="carNo != null">
        car_no = #{carNo,jdbcType=VARCHAR},
      </if>
      <if test="carType != null">
        car_type = #{carType,jdbcType=INTEGER},
      </if>
      <if test="isfixedcar != null">
        isFixedCar = #{isfixedcar,jdbcType=INTEGER},
      </if>
      <if test="dataStatus != null">
        data_status = #{dataStatus,jdbcType=INTEGER},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="updateDate != null">
        update_date = #{updateDate,jdbcType=TIMESTAMP},
      </if>
      <if test="customerNo != null">
        customer_no = #{customerNo,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.pay.domain.TdClCustomerCarInfo">
    update td_cl_customer_car_info
    set customer_name = #{customerName,jdbcType=VARCHAR},
      car_no = #{carNo,jdbcType=VARCHAR},
      car_type = #{carType,jdbcType=INTEGER},
      isFixedCar = #{isfixedcar,jdbcType=INTEGER},
      data_status = #{dataStatus,jdbcType=INTEGER},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      update_date = #{updateDate,jdbcType=TIMESTAMP},
      customer_no = #{customerNo,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>