<?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.steerinfo.baseinfo.meterbasecussupcar.mapper.MeterBaseCusSupCarMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.baseinfo.meterbasecussupcar.model.MeterBaseCusSupCar">
    <id column="PK_NO" jdbcType="VARCHAR" property="pkNo" />
    <result column="CUS_SUP_CAR_NO" jdbcType="VARCHAR" property="cusSupCarNo" />
    <result column="MNEMONIC_CODE" jdbcType="VARCHAR" property="mnemonicCode" />
    <result column="DRIVER_NAME" jdbcType="VARCHAR" property="driverName" />
    <result column="ID_NUM" jdbcType="VARCHAR" property="idNum" />
    <result column="TEL_NUM" jdbcType="VARCHAR" property="telNum" />
    <result column="CUSTOMER_SUPPLIER_NO" jdbcType="VARCHAR" property="customerSupplierNo" />
    <result column="CUSTOMER_SUPPLIER_NAME" jdbcType="VARCHAR" property="customerSupplierName" />
    <result column="MEMO" jdbcType="VARCHAR" property="memo" />
    <result column="VALID_FLAG" jdbcType="VARCHAR" property="validFlag" />
    <result column="CREATE_MAN_NO" jdbcType="VARCHAR" property="createManNo" />
    <result column="CREATE_MAN_NAME" jdbcType="VARCHAR" property="createManName" />
    <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
    <result column="UPDATE_MAN_NO" jdbcType="VARCHAR" property="updateManNo" />
    <result column="UPDATE_MAN_NAME" jdbcType="VARCHAR" property="updateManName" />
    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="DELETE_MAN_NO" jdbcType="VARCHAR" property="deleteManNo" />
    <result column="DELETE_MAN_NAME" jdbcType="VARCHAR" property="deleteManName" />
    <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
    <result column="CAR_TYPE_NO" jdbcType="VARCHAR" property="carTypeNo" />
    <result column="CAR_TYPE_NAME" jdbcType="VARCHAR" property="carTypeName" />
    <result column="CAR_CARRIER_WEIGHT" jdbcType="DECIMAL" property="carCarrierWeight" />
  </resultMap>
  <sql id="columns">
    PK_NO, CUS_SUP_CAR_NO, MNEMONIC_CODE, DRIVER_NAME, ID_NUM, TEL_NUM, CUSTOMER_SUPPLIER_NO, 
    CUSTOMER_SUPPLIER_NAME, MEMO, VALID_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
    UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, DELETE_MAN_NO, DELETE_MAN_NAME, DELETE_TIME, 
    CAR_TYPE_NO, CAR_TYPE_NAME, CAR_CARRIER_WEIGHT
  </sql>
  <sql id="columns_alias">
    t.PK_NO, t.CUS_SUP_CAR_NO, t.MNEMONIC_CODE, t.DRIVER_NAME, t.ID_NUM, t.TEL_NUM, t.CUSTOMER_SUPPLIER_NO, 
    t.CUSTOMER_SUPPLIER_NAME, t.MEMO, t.VALID_FLAG, t.CREATE_MAN_NO, t.CREATE_MAN_NAME, 
    t.CREATE_TIME, t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, t.UPDATE_TIME, t.DELETE_MAN_NO, 
    t.DELETE_MAN_NAME, t.DELETE_TIME, t.CAR_TYPE_NO, t.CAR_TYPE_NAME, t.CAR_CARRIER_WEIGHT
  </sql>
  <sql id="select">
    SELECT <include refid="columns" /> FROM METER_BASE_CUS_SUP_CAR
  </sql>
  <sql id="select_alias">
    SELECT <include refid="columns_alias" /> FROM METER_BASE_CUS_SUP_CAR t
  </sql>
  <sql id="where">
    <where> 
      <if test="pkNo != null and pkNo != ''">
        and PK_NO = #{pkNo}
      </if>
      <if test="cusSupCarNo != null and cusSupCarNo != ''">
        and CUS_SUP_CAR_NO = #{cusSupCarNo}
      </if>
      <if test="mnemonicCode != null and mnemonicCode != ''">
        and MNEMONIC_CODE = #{mnemonicCode}
      </if>
      <if test="driverName != null and driverName != ''">
        and DRIVER_NAME = #{driverName}
      </if>
      <if test="idNum != null and idNum != ''">
        and ID_NUM = #{idNum}
      </if>
      <if test="telNum != null and telNum != ''">
        and TEL_NUM = #{telNum}
      </if>
      <if test="customerSupplierNo != null and customerSupplierNo != ''">
        and CUSTOMER_SUPPLIER_NO = #{customerSupplierNo}
      </if>
      <if test="customerSupplierName != null and customerSupplierName != ''">
        and CUSTOMER_SUPPLIER_NAME = #{customerSupplierName}
      </if>
      <if test="memo != null and memo != ''">
        and MEMO = #{memo}
      </if>
      <if test="validFlag != null and validFlag != ''">
        and VALID_FLAG = #{validFlag}
      </if>
      <if test="createManNo != null and createManNo != ''">
        and CREATE_MAN_NO = #{createManNo}
      </if>
      <if test="createManName != null and createManName != ''">
        and CREATE_MAN_NAME = #{createManName}
      </if>
      <if test="createTime != null">
        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
      </if>
      <if test="updateManNo != null and updateManNo != ''">
        and UPDATE_MAN_NO = #{updateManNo}
      </if>
      <if test="updateManName != null and updateManName != ''">
        and UPDATE_MAN_NAME = #{updateManName}
      </if>
      <if test="updateTime != null">
        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
      </if>
      <if test="deleteManNo != null and deleteManNo != ''">
        and DELETE_MAN_NO = #{deleteManNo}
      </if>
      <if test="deleteManName != null and deleteManName != ''">
        and DELETE_MAN_NAME = #{deleteManName}
      </if>
      <if test="deleteTime != null">
        and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
      </if>
      <if test="carTypeNo != null and carTypeNo != ''">
        and CAR_TYPE_NO = #{carTypeNo}
      </if>
      <if test="carTypeName != null and carTypeName != ''">
        and CAR_TYPE_NAME = #{carTypeName}
      </if>
      <if test="carCarrierWeight != null">
        and CAR_CARRIER_WEIGHT = #{carCarrierWeight}
      </if>
    </where>
  </sql>
  <sql id="whereLike">
    <where> 
      <if test="pkNo != null and pkNo != ''">
        and PK_NO LIKE '%${pkNo}%'
      </if>
      <if test="cusSupCarNo != null and cusSupCarNo != ''">
        and CUS_SUP_CAR_NO LIKE '%${cusSupCarNo}%'
      </if>
      <if test="mnemonicCode != null and mnemonicCode != ''">
        and MNEMONIC_CODE LIKE '%${mnemonicCode}%'
      </if>
      <if test="driverName != null and driverName != ''">
        and DRIVER_NAME LIKE '%${driverName}%'
      </if>
      <if test="idNum != null and idNum != ''">
        and ID_NUM LIKE '%${idNum}%'
      </if>
      <if test="telNum != null and telNum != ''">
        and TEL_NUM LIKE '%${telNum}%'
      </if>
      <if test="customerSupplierNo != null and customerSupplierNo != ''">
        and CUSTOMER_SUPPLIER_NO LIKE '%${customerSupplierNo}%'
      </if>
      <if test="customerSupplierName != null and customerSupplierName != ''">
        and CUSTOMER_SUPPLIER_NAME LIKE '%${customerSupplierName}%'
      </if>
      <if test="memo != null and memo != ''">
        and MEMO LIKE '%${memo}%'
      </if>
      <if test="validFlag != null and validFlag != ''">
        and VALID_FLAG LIKE '%${validFlag}%'
      </if>
      <if test="createManNo != null and createManNo != ''">
        and CREATE_MAN_NO LIKE '%${createManNo}%'
      </if>
      <if test="createManName != null and createManName != ''">
        and CREATE_MAN_NAME LIKE '%${createManName}%'
      </if>
      <if test="createTime != null">
        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
      </if>
      <if test="updateManNo != null and updateManNo != ''">
        and UPDATE_MAN_NO LIKE '%${updateManNo}%'
      </if>
      <if test="updateManName != null and updateManName != ''">
        and UPDATE_MAN_NAME LIKE '%${updateManName}%'
      </if>
      <if test="updateTime != null">
        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
      </if>
      <if test="deleteManNo != null and deleteManNo != ''">
        and DELETE_MAN_NO LIKE '%${deleteManNo}%'
      </if>
      <if test="deleteManName != null and deleteManName != ''">
        and DELETE_MAN_NAME LIKE '%${deleteManName}%'
      </if>
      <if test="deleteTime != null">
        and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
      </if>
      <if test="carTypeNo != null and carTypeNo != ''">
        and CAR_TYPE_NO LIKE '%${carTypeNo}%'
      </if>
      <if test="carTypeName != null and carTypeName != ''">
        and CAR_TYPE_NAME LIKE '%${carTypeName}%'
      </if>
      <if test="carCarrierWeight != null">
        and CAR_CARRIER_WEIGHT = #{carCarrierWeight}
      </if>
    </where>
  </sql>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from METER_BASE_CUS_SUP_CAR
    where PK_NO = #{pkNo,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from METER_BASE_CUS_SUP_CAR
    where 1!=1 
      <if test="cusSupCarNo != null and cusSupCarNo != ''">
        or CUS_SUP_CAR_NO = #{cusSupCarNo}
      </if>
      <if test="mnemonicCode != null and mnemonicCode != ''">
        or MNEMONIC_CODE = #{mnemonicCode}
      </if>
      <if test="driverName != null and driverName != ''">
        or DRIVER_NAME = #{driverName}
      </if>
      <if test="idNum != null and idNum != ''">
        or ID_NUM = #{idNum}
      </if>
      <if test="telNum != null and telNum != ''">
        or TEL_NUM = #{telNum}
      </if>
      <if test="customerSupplierNo != null and customerSupplierNo != ''">
        or CUSTOMER_SUPPLIER_NO = #{customerSupplierNo}
      </if>
      <if test="customerSupplierName != null and customerSupplierName != ''">
        or CUSTOMER_SUPPLIER_NAME = #{customerSupplierName}
      </if>
      <if test="memo != null and memo != ''">
        or MEMO = #{memo}
      </if>
      <if test="validFlag != null and validFlag != ''">
        or VALID_FLAG = #{validFlag}
      </if>
      <if test="createManNo != null and createManNo != ''">
        or CREATE_MAN_NO = #{createManNo}
      </if>
      <if test="createManName != null and createManName != ''">
        or CREATE_MAN_NAME = #{createManName}
      </if>
      <if test="createTime != null">
        or TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = '#{createTime}'
      </if>
      <if test="updateManNo != null and updateManNo != ''">
        or UPDATE_MAN_NO = #{updateManNo}
      </if>
      <if test="updateManName != null and updateManName != ''">
        or UPDATE_MAN_NAME = #{updateManName}
      </if>
      <if test="updateTime != null">
        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
      </if>
      <if test="deleteManNo != null and deleteManNo != ''">
        or DELETE_MAN_NO = #{deleteManNo}
      </if>
      <if test="deleteManName != null and deleteManName != ''">
        or DELETE_MAN_NAME = #{deleteManName}
      </if>
      <if test="deleteTime != null">
        or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
      </if>
      <if test="carTypeNo != null and carTypeNo != ''">
        or CAR_TYPE_NO = #{carTypeNo}
      </if>
      <if test="carTypeName != null and carTypeName != ''">
        or CAR_TYPE_NAME = #{carTypeName}
      </if>
      <if test="carCarrierWeight != null">
        or CAR_CARRIER_WEIGHT = #{carCarrierWeight}
      </if>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.baseinfo.meterbasecussupcar.model.MeterBaseCusSupCar">
    insert into METER_BASE_CUS_SUP_CAR (PK_NO, CUS_SUP_CAR_NO, MNEMONIC_CODE, 
      DRIVER_NAME, ID_NUM, TEL_NUM, 
      CUSTOMER_SUPPLIER_NO, CUSTOMER_SUPPLIER_NAME, 
      MEMO, VALID_FLAG, CREATE_MAN_NO, 
      CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO, 
      UPDATE_MAN_NAME, UPDATE_TIME, DELETE_MAN_NO, 
      DELETE_MAN_NAME, DELETE_TIME, CAR_TYPE_NO, 
      CAR_TYPE_NAME, CAR_CARRIER_WEIGHT)
    values (#{pkNo,jdbcType=VARCHAR}, #{cusSupCarNo,jdbcType=VARCHAR}, #{mnemonicCode,jdbcType=VARCHAR}, 
      #{driverName,jdbcType=VARCHAR}, #{idNum,jdbcType=VARCHAR}, #{telNum,jdbcType=VARCHAR}, 
      #{customerSupplierNo,jdbcType=VARCHAR}, #{customerSupplierName,jdbcType=VARCHAR}, 
      #{memo,jdbcType=VARCHAR}, #{validFlag,jdbcType=VARCHAR}, #{createManNo,jdbcType=VARCHAR}, 
      #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateManNo,jdbcType=VARCHAR}, 
      #{updateManName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{deleteManNo,jdbcType=VARCHAR}, 
      #{deleteManName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{carTypeNo,jdbcType=VARCHAR}, 
      #{carTypeName,jdbcType=VARCHAR}, #{carCarrierWeight,jdbcType=DECIMAL})
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.baseinfo.meterbasecussupcar.model.MeterBaseCusSupCar">
    insert into METER_BASE_CUS_SUP_CAR
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="pkNo != null">
        PK_NO,
      </if>
      <if test="cusSupCarNo != null">
        CUS_SUP_CAR_NO,
      </if>
      <if test="mnemonicCode != null">
        MNEMONIC_CODE,
      </if>
      <if test="driverName != null">
        DRIVER_NAME,
      </if>
      <if test="idNum != null">
        ID_NUM,
      </if>
      <if test="telNum != null">
        TEL_NUM,
      </if>
      <if test="customerSupplierNo != null">
        CUSTOMER_SUPPLIER_NO,
      </if>
      <if test="customerSupplierName != null">
        CUSTOMER_SUPPLIER_NAME,
      </if>
      <if test="memo != null">
        MEMO,
      </if>
      <if test="validFlag != null">
        VALID_FLAG,
      </if>
      <if test="createManNo != null">
        CREATE_MAN_NO,
      </if>
      <if test="createManName != null">
        CREATE_MAN_NAME,
      </if>
      <if test="createTime != null">
        CREATE_TIME,
      </if>
      <if test="updateManNo != null">
        UPDATE_MAN_NO,
      </if>
      <if test="updateManName != null">
        UPDATE_MAN_NAME,
      </if>
      <if test="updateTime != null">
        UPDATE_TIME,
      </if>
      <if test="deleteManNo != null">
        DELETE_MAN_NO,
      </if>
      <if test="deleteManName != null">
        DELETE_MAN_NAME,
      </if>
      <if test="deleteTime != null">
        DELETE_TIME,
      </if>
      <if test="carTypeNo != null">
        CAR_TYPE_NO,
      </if>
      <if test="carTypeName != null">
        CAR_TYPE_NAME,
      </if>
      <if test="carCarrierWeight != null">
        CAR_CARRIER_WEIGHT,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="pkNo != null">
        #{pkNo,jdbcType=VARCHAR},
      </if>
      <if test="cusSupCarNo != null">
        #{cusSupCarNo,jdbcType=VARCHAR},
      </if>
      <if test="mnemonicCode != null">
        #{mnemonicCode,jdbcType=VARCHAR},
      </if>
      <if test="driverName != null">
        #{driverName,jdbcType=VARCHAR},
      </if>
      <if test="idNum != null">
        #{idNum,jdbcType=VARCHAR},
      </if>
      <if test="telNum != null">
        #{telNum,jdbcType=VARCHAR},
      </if>
      <if test="customerSupplierNo != null">
        #{customerSupplierNo,jdbcType=VARCHAR},
      </if>
      <if test="customerSupplierName != null">
        #{customerSupplierName,jdbcType=VARCHAR},
      </if>
      <if test="memo != null">
        #{memo,jdbcType=VARCHAR},
      </if>
      <if test="validFlag != null">
        #{validFlag,jdbcType=VARCHAR},
      </if>
      <if test="createManNo != null">
        #{createManNo,jdbcType=VARCHAR},
      </if>
      <if test="createManName != null">
        #{createManName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateManNo != null">
        #{updateManNo,jdbcType=VARCHAR},
      </if>
      <if test="updateManName != null">
        #{updateManName,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteManNo != null">
        #{deleteManNo,jdbcType=VARCHAR},
      </if>
      <if test="deleteManName != null">
        #{deleteManName,jdbcType=VARCHAR},
      </if>
      <if test="deleteTime != null">
        #{deleteTime,jdbcType=TIMESTAMP},
      </if>
      <if test="carTypeNo != null">
        #{carTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="carTypeName != null">
        #{carTypeName,jdbcType=VARCHAR},
      </if>
      <if test="carCarrierWeight != null">
        #{carCarrierWeight,jdbcType=DECIMAL},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.baseinfo.meterbasecussupcar.model.MeterBaseCusSupCar">
    update METER_BASE_CUS_SUP_CAR
    set CUS_SUP_CAR_NO = #{cusSupCarNo,jdbcType=VARCHAR},
      MNEMONIC_CODE = #{mnemonicCode,jdbcType=VARCHAR},
      DRIVER_NAME = #{driverName,jdbcType=VARCHAR},
      ID_NUM = #{idNum,jdbcType=VARCHAR},
      TEL_NUM = #{telNum,jdbcType=VARCHAR},
      CUSTOMER_SUPPLIER_NO = #{customerSupplierNo,jdbcType=VARCHAR},
      CUSTOMER_SUPPLIER_NAME = #{customerSupplierName,jdbcType=VARCHAR},
      MEMO = #{memo,jdbcType=VARCHAR},
      VALID_FLAG = #{validFlag,jdbcType=VARCHAR},
      CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
      CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
      UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
      DELETE_MAN_NO = #{deleteManNo,jdbcType=VARCHAR},
      DELETE_MAN_NAME = #{deleteManName,jdbcType=VARCHAR},
      DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
      CAR_TYPE_NO = #{carTypeNo,jdbcType=VARCHAR},
      CAR_TYPE_NAME = #{carTypeName,jdbcType=VARCHAR},
      CAR_CARRIER_WEIGHT = #{carCarrierWeight,jdbcType=DECIMAL}
    where PK_NO = #{pkNo,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.baseinfo.meterbasecussupcar.model.MeterBaseCusSupCar">
    update METER_BASE_CUS_SUP_CAR
    <set>
      <if test="cusSupCarNo != null">
        CUS_SUP_CAR_NO = #{cusSupCarNo,jdbcType=VARCHAR},
      </if>
      <if test="mnemonicCode != null">
        MNEMONIC_CODE = #{mnemonicCode,jdbcType=VARCHAR},
      </if>
      <if test="driverName != null">
        DRIVER_NAME = #{driverName,jdbcType=VARCHAR},
      </if>
      <if test="idNum != null">
        ID_NUM = #{idNum,jdbcType=VARCHAR},
      </if>
      <if test="telNum != null">
        TEL_NUM = #{telNum,jdbcType=VARCHAR},
      </if>
      <if test="customerSupplierNo != null">
        CUSTOMER_SUPPLIER_NO = #{customerSupplierNo,jdbcType=VARCHAR},
      </if>
      <if test="customerSupplierName != null">
        CUSTOMER_SUPPLIER_NAME = #{customerSupplierName,jdbcType=VARCHAR},
      </if>
      <if test="memo != null">
        MEMO = #{memo,jdbcType=VARCHAR},
      </if>
      <if test="validFlag != null">
        VALID_FLAG = #{validFlag,jdbcType=VARCHAR},
      </if>
      <if test="createManNo != null">
        CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
      </if>
      <if test="createManName != null">
        CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateManNo != null">
        UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
      </if>
      <if test="updateManName != null">
        UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteManNo != null">
        DELETE_MAN_NO = #{deleteManNo,jdbcType=VARCHAR},
      </if>
      <if test="deleteManName != null">
        DELETE_MAN_NAME = #{deleteManName,jdbcType=VARCHAR},
      </if>
      <if test="deleteTime != null">
        DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
      </if>
      <if test="carTypeNo != null">
        CAR_TYPE_NO = #{carTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="carTypeName != null">
        CAR_TYPE_NAME = #{carTypeName,jdbcType=VARCHAR},
      </if>
      <if test="carCarrierWeight != null">
        CAR_CARRIER_WEIGHT = #{carCarrierWeight,jdbcType=DECIMAL},
      </if>
    </set>
    where PK_NO = #{pkNo,jdbcType=VARCHAR}
  </update>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <include refid="select" />
    where PK_NO = #{pkNo,jdbcType=VARCHAR}
  </select>
  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select" />
    <include refid="where" />
  </select>
  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select" />
    <include refid="whereLike" />
  </select>
  <insert id="batchInsert" parameterType="java.util.List">
    insert into METER_BASE_CUS_SUP_CAR 
      (PK_NO, 
      CUS_SUP_CAR_NO, MNEMONIC_CODE, DRIVER_NAME, 
      ID_NUM, TEL_NUM, CUSTOMER_SUPPLIER_NO, 
      CUSTOMER_SUPPLIER_NAME, MEMO, VALID_FLAG, 
      CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
      UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, 
      DELETE_MAN_NO, DELETE_MAN_NAME, DELETE_TIME, 
      CAR_TYPE_NO, CAR_TYPE_NAME, CAR_CARRIER_WEIGHT
      )
    ( <foreach collection="list" item="item" separator="union all"> 
   select  
      #{item.pkNo,jdbcType=VARCHAR}, 
      #{item.cusSupCarNo,jdbcType=VARCHAR}, #{item.mnemonicCode,jdbcType=VARCHAR}, #{item.driverName,jdbcType=VARCHAR}, 
      #{item.idNum,jdbcType=VARCHAR}, #{item.telNum,jdbcType=VARCHAR}, #{item.customerSupplierNo,jdbcType=VARCHAR}, 
      #{item.customerSupplierName,jdbcType=VARCHAR}, #{item.memo,jdbcType=VARCHAR}, #{item.validFlag,jdbcType=VARCHAR}, 
      #{item.createManNo,jdbcType=VARCHAR}, #{item.createManName,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, 
      #{item.updateManNo,jdbcType=VARCHAR}, #{item.updateManName,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
      #{item.deleteManNo,jdbcType=VARCHAR}, #{item.deleteManName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP}, 
      #{item.carTypeNo,jdbcType=VARCHAR}, #{item.carTypeName,jdbcType=VARCHAR}, #{item.carCarrierWeight,jdbcType=DECIMAL}
       from dual  
   </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
     update METER_BASE_CUS_SUP_CAR
     set
       PK_NO=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.pkNo,jdbcType=VARCHAR}
       </foreach>
       ,CUS_SUP_CAR_NO=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.cusSupCarNo,jdbcType=VARCHAR}
       </foreach>
       ,MNEMONIC_CODE=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.mnemonicCode,jdbcType=VARCHAR}
       </foreach>
       ,DRIVER_NAME=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.driverName,jdbcType=VARCHAR}
       </foreach>
       ,ID_NUM=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.idNum,jdbcType=VARCHAR}
       </foreach>
       ,TEL_NUM=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.telNum,jdbcType=VARCHAR}
       </foreach>
       ,CUSTOMER_SUPPLIER_NO=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.customerSupplierNo,jdbcType=VARCHAR}
       </foreach>
       ,CUSTOMER_SUPPLIER_NAME=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.customerSupplierName,jdbcType=VARCHAR}
       </foreach>
       ,MEMO=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
       </foreach>
       ,VALID_FLAG=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.validFlag,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NO=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NAME=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_TIME=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
       </foreach>
       ,UPDATE_MAN_NO=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_MAN_NAME=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_TIME=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
       </foreach>
       ,DELETE_MAN_NO=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.deleteManNo,jdbcType=VARCHAR}
       </foreach>
       ,DELETE_MAN_NAME=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.deleteManName,jdbcType=VARCHAR}
       </foreach>
       ,DELETE_TIME=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.deleteTime,jdbcType=TIMESTAMP}
       </foreach>
       ,CAR_TYPE_NO=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.carTypeNo,jdbcType=VARCHAR}
       </foreach>
       ,CAR_TYPE_NAME=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.carTypeName,jdbcType=VARCHAR}
       </foreach>
       ,CAR_CARRIER_WEIGHT=
       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.carCarrierWeight,jdbcType=DECIMAL}
       </foreach>
     where PK_NO in 
     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
    #{item.pkNo,jdbcType=VARCHAR}
     </foreach> 
  </update>
  <delete id="batchDelete" parameterType="java.util.List">
    delete from METER_BASE_CUS_SUP_CAR
    where PK_NO in 
    <foreach close=")" collection="list" item="id" open="(" separator=",">
      #{id}
    </foreach>
  </delete>

  <!-- 友情提示！！！-->
  <!-- 请将自己写的代码放在此标签之下，方便以后粘贴复制。-->
  <select id="GetNewID" parameterType="java.lang.String" resultType="java.lang.String">
    SELECT LPAD(NVL(MAX(TO_NUMBER(SUBSTR(PK_NO, LENGTH(PK_NO) -3))),0) + 1,4,'0') PK_NO
    FROM METER_BASE_CUS_SUP_CAR
  </select>

  <select id="selectForUpdate" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select"/>
    <where>
      <if test="pkNo != null and pkNo != ''">
        and PK_NO != #{pkNo}
      </if>
      <if test="cusSupCarNo != null and cusSupCarNo != ''">
        and CUS_SUP_CAR_NO = #{cusSupCarNo}
      </if>
    </where>
  </select>
  
</mapper>