TdClSpecialCarMapper.xml 11.7 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.TdClSpecialCarMapper">
  <resultMap id="BaseResultMap" type="com.zteits.bill.domain.TdClSpecialCar">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="scope_type" jdbcType="CHAR" property="scopeType" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="car_number" jdbcType="VARCHAR" property="carNumber" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
    <result column="data_state" jdbcType="CHAR" property="dataState" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="create_name" jdbcType="VARCHAR" property="createName" />
    <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
    <result column="modfiy_name" jdbcType="VARCHAR" property="modfiyName" />
    <result column="org_id" jdbcType="BIGINT" property="orgId" />
    <result column="type" jdbcType="INTEGER" property="type" />
  </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, scope_type, pl_no, car_number, remarks, data_state, create_date, create_name, 
    modfiy_date, modfiy_name, org_id, type
  </sql>
  <select id="selectByExample" parameterType="com.zteits.bill.domain.TdClSpecialCarExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from td_cl_special_car
    <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_special_car
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from td_cl_special_car
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.bill.domain.TdClSpecialCarExample">
    delete from td_cl_special_car
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.bill.domain.TdClSpecialCar">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_cl_special_car (scope_type, pl_no, car_number, 
      remarks, data_state, create_date, 
      create_name, modfiy_date, modfiy_name, 
      org_id, type)
    values (#{scopeType,jdbcType=CHAR}, #{plNo,jdbcType=VARCHAR}, #{carNumber,jdbcType=VARCHAR}, 
      #{remarks,jdbcType=VARCHAR}, #{dataState,jdbcType=CHAR}, #{createDate,jdbcType=TIMESTAMP}, 
      #{createName,jdbcType=VARCHAR}, #{modfiyDate,jdbcType=TIMESTAMP}, #{modfiyName,jdbcType=VARCHAR}, 
      #{orgId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.bill.domain.TdClSpecialCar">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into td_cl_special_car
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="scopeType != null">
        scope_type,
      </if>
      <if test="plNo != null">
        pl_no,
      </if>
      <if test="carNumber != null">
        car_number,
      </if>
      <if test="remarks != null">
        remarks,
      </if>
      <if test="dataState != null">
        data_state,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
      <if test="createName != null">
        create_name,
      </if>
      <if test="modfiyDate != null">
        modfiy_date,
      </if>
      <if test="modfiyName != null">
        modfiy_name,
      </if>
      <if test="orgId != null">
        org_id,
      </if>
      <if test="type != null">
        type,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="scopeType != null">
        #{scopeType,jdbcType=CHAR},
      </if>
      <if test="plNo != null">
        #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="carNumber != null">
        #{carNumber,jdbcType=VARCHAR},
      </if>
      <if test="remarks != null">
        #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="dataState != null">
        #{dataState,jdbcType=CHAR},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="createName != null">
        #{createName,jdbcType=VARCHAR},
      </if>
      <if test="modfiyDate != null">
        #{modfiyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modfiyName != null">
        #{modfiyName,jdbcType=VARCHAR},
      </if>
      <if test="orgId != null">
        #{orgId,jdbcType=BIGINT},
      </if>
      <if test="type != null">
        #{type,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.bill.domain.TdClSpecialCarExample" resultType="java.lang.Long">
    select count(*) from td_cl_special_car
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update td_cl_special_car
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.scopeType != null">
        scope_type = #{record.scopeType,jdbcType=CHAR},
      </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.remarks != null">
        remarks = #{record.remarks,jdbcType=VARCHAR},
      </if>
      <if test="record.dataState != null">
        data_state = #{record.dataState,jdbcType=CHAR},
      </if>
      <if test="record.createDate != null">
        create_date = #{record.createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createName != null">
        create_name = #{record.createName,jdbcType=VARCHAR},
      </if>
      <if test="record.modfiyDate != null">
        modfiy_date = #{record.modfiyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.modfiyName != null">
        modfiy_name = #{record.modfiyName,jdbcType=VARCHAR},
      </if>
      <if test="record.orgId != null">
        org_id = #{record.orgId,jdbcType=BIGINT},
      </if>
      <if test="record.type != null">
        type = #{record.type,jdbcType=INTEGER},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update td_cl_special_car
    set id = #{record.id,jdbcType=BIGINT},
      scope_type = #{record.scopeType,jdbcType=CHAR},
      pl_no = #{record.plNo,jdbcType=VARCHAR},
      car_number = #{record.carNumber,jdbcType=VARCHAR},
      remarks = #{record.remarks,jdbcType=VARCHAR},
      data_state = #{record.dataState,jdbcType=CHAR},
      create_date = #{record.createDate,jdbcType=TIMESTAMP},
      create_name = #{record.createName,jdbcType=VARCHAR},
      modfiy_date = #{record.modfiyDate,jdbcType=TIMESTAMP},
      modfiy_name = #{record.modfiyName,jdbcType=VARCHAR},
      org_id = #{record.orgId,jdbcType=BIGINT},
      type = #{record.type,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.bill.domain.TdClSpecialCar">
    update td_cl_special_car
    <set>
      <if test="scopeType != null">
        scope_type = #{scopeType,jdbcType=CHAR},
      </if>
      <if test="plNo != null">
        pl_no = #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="carNumber != null">
        car_number = #{carNumber,jdbcType=VARCHAR},
      </if>
      <if test="remarks != null">
        remarks = #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="dataState != null">
        data_state = #{dataState,jdbcType=CHAR},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="createName != null">
        create_name = #{createName,jdbcType=VARCHAR},
      </if>
      <if test="modfiyDate != null">
        modfiy_date = #{modfiyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modfiyName != null">
        modfiy_name = #{modfiyName,jdbcType=VARCHAR},
      </if>
      <if test="orgId != null">
        org_id = #{orgId,jdbcType=BIGINT},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.bill.domain.TdClSpecialCar">
    update td_cl_special_car
    set scope_type = #{scopeType,jdbcType=CHAR},
      pl_no = #{plNo,jdbcType=VARCHAR},
      car_number = #{carNumber,jdbcType=VARCHAR},
      remarks = #{remarks,jdbcType=VARCHAR},
      data_state = #{dataState,jdbcType=CHAR},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      create_name = #{createName,jdbcType=VARCHAR},
      modfiy_date = #{modfiyDate,jdbcType=TIMESTAMP},
      modfiy_name = #{modfiyName,jdbcType=VARCHAR},
      org_id = #{orgId,jdbcType=BIGINT},
      type = #{type,jdbcType=INTEGER}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>