<?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.meterbasecar.mapper.MeterBaseCarMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.baseinfo.meterbasecar.model.MeterBaseCar">
    <id column="PK_NO" jdbcType="VARCHAR" property="pkNo" />
    <result column="CAR_NO" jdbcType="VARCHAR" property="carNo" />
    <result column="MNEMONIC_CODE" jdbcType="VARCHAR" property="mnemonicCode" />
    <result column="CUSTOMER_SUPPLIER_NO" jdbcType="VARCHAR" property="customerSupplierNo" />
    <result column="CUSTOMER_SUPPLIER_NAME" jdbcType="VARCHAR" property="customerSupplierName" />
    <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" />
    <result column="CAR_SELF_WEIGHT" jdbcType="DECIMAL" property="carSelfWeight" />
    <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="SSO_ID" jdbcType="VARCHAR" property="ssoId" />
    <result column="VEHICLE_TYPE" jdbcType="VARCHAR" property="vehicleType" />
    <result column="BELONG_UNIT_TYPE_NO" jdbcType="VARCHAR" property="belongUnitTypeNo" />
    <result column="BELONG_UNIT_TYPE_NAME" jdbcType="VARCHAR" property="belongUnitTypeName" />
    <result column="USET_DEPARTMENT" jdbcType="VARCHAR" property="usetDepartment" />
    <result column="VEHICLE_IDENTIFY_NO" jdbcType="VARCHAR" property="vehicleIdentifyNo" />
    <result column="FILLING_DEPARTMENT" jdbcType="VARCHAR" property="fillingDepartment" />
    <result column="FILLING_USER" jdbcType="VARCHAR" property="fillingUser" />
    <result column="IS_INSURANCE" jdbcType="VARCHAR" property="isInsurance" />
    <result column="OTHER_INSURANCE" jdbcType="VARCHAR" property="otherInsurance" />
    <result column="IS_SPECIALUNIT" jdbcType="VARCHAR" property="isSpecialunit" />
    <result column="USET_DEPARTMENT_NO" jdbcType="VARCHAR" property="usetDepartmentNo" />
  </resultMap>
  <sql id="columns">
    PK_NO, CAR_NO, MNEMONIC_CODE, CUSTOMER_SUPPLIER_NO, CUSTOMER_SUPPLIER_NAME, CAR_TYPE_NO, 
    CAR_TYPE_NAME, CAR_CARRIER_WEIGHT, CAR_SELF_WEIGHT, 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, SSO_ID, VEHICLE_TYPE, BELONG_UNIT_TYPE_NO, BELONG_UNIT_TYPE_NAME, 
    USET_DEPARTMENT, VEHICLE_IDENTIFY_NO, FILLING_DEPARTMENT, FILLING_USER, IS_INSURANCE, 
    OTHER_INSURANCE, IS_SPECIALUNIT, USET_DEPARTMENT_NO
  </sql>
  <sql id="columns_alias">
    t.PK_NO, t.CAR_NO, t.MNEMONIC_CODE, t.CUSTOMER_SUPPLIER_NO, t.CUSTOMER_SUPPLIER_NAME, 
    t.CAR_TYPE_NO, t.CAR_TYPE_NAME, t.CAR_CARRIER_WEIGHT, t.CAR_SELF_WEIGHT, 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.SSO_ID, t.VEHICLE_TYPE, t.BELONG_UNIT_TYPE_NO, t.BELONG_UNIT_TYPE_NAME, t.USET_DEPARTMENT, 
    t.VEHICLE_IDENTIFY_NO, t.FILLING_DEPARTMENT, t.FILLING_USER, t.IS_INSURANCE, t.OTHER_INSURANCE, 
    t.IS_SPECIALUNIT, t.USET_DEPARTMENT_NO
  </sql>
  <sql id="select">
    SELECT <include refid="columns"/> FROM METER_BASE_CAR
  </sql>
  <sql id="select_alias">
    SELECT <include refid="columns_alias"/> FROM METER_BASE_CAR t
  </sql>
  <sql id="where">
    <where> 
      <if test="pkNo != null and pkNo != ''">
        and PK_NO = #{pkNo}
      </if>
      <if test="carNo != null and carNo != ''">
        and CAR_NO = #{carNo}
      </if>
      <if test="mnemonicCode != null and mnemonicCode != ''">
        and MNEMONIC_CODE = #{mnemonicCode}
      </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="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>
      <if test="carSelfWeight != null">
        and CAR_SELF_WEIGHT = #{carSelfWeight}
      </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="ssoId != null and ssoId != ''">
        and SSO_ID = #{ssoId}
      </if>
      <if test="vehicleType != null and vehicleType != ''">
        and VEHICLE_TYPE = #{vehicleType}
      </if>
      <if test="belongUnitTypeNo != null and belongUnitTypeNo != ''">
        and BELONG_UNIT_TYPE_NO = #{belongUnitTypeNo}
      </if>
      <if test="belongUnitTypeName != null and belongUnitTypeName != ''">
        and BELONG_UNIT_TYPE_NAME = #{belongUnitTypeName}
      </if>
      <if test="usetDepartment != null and usetDepartment != ''">
        and USET_DEPARTMENT = #{usetDepartment}
      </if>
      <if test="vehicleIdentifyNo != null and vehicleIdentifyNo != ''">
        and VEHICLE_IDENTIFY_NO = #{vehicleIdentifyNo}
      </if>
      <if test="fillingDepartment != null and fillingDepartment != ''">
        and FILLING_DEPARTMENT = #{fillingDepartment}
      </if>
      <if test="fillingUser != null and fillingUser != ''">
        and FILLING_USER = #{fillingUser}
      </if>
      <if test="isInsurance != null and isInsurance != ''">
        and IS_INSURANCE = #{isInsurance}
      </if>
      <if test="otherInsurance != null and otherInsurance != ''">
        and OTHER_INSURANCE = #{otherInsurance}
      </if>
      <if test="isSpecialunit != null and isSpecialunit != ''">
        and IS_SPECIALUNIT = #{isSpecialunit}
      </if>
      <if test="usetDepartmentNo != null and usetDepartmentNo != ''">
        and USET_DEPARTMENT_NO = #{usetDepartmentNo}
      </if>
    </where>
  </sql>
  <sql id="whereLike">
    <where> 
      <if test="pkNo != null and pkNo != ''">
        and PK_NO LIKE '%${pkNo}%'
      </if>
      <if test="carNo != null and carNo != ''">
        and CAR_NO LIKE '%${carNo}%'
      </if>
      <if test="mnemonicCode != null and mnemonicCode != ''">
        and MNEMONIC_CODE LIKE '%${mnemonicCode}%'
      </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="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>
      <if test="carSelfWeight != null">
        and CAR_SELF_WEIGHT = #{carSelfWeight}
      </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="ssoId != null and ssoId != ''">
        and SSO_ID LIKE '%${ssoId}%'
      </if>
      <if test="vehicleType != null and vehicleType != ''">
        and VEHICLE_TYPE LIKE '%${vehicleType}%'
      </if>
      <if test="belongUnitTypeNo != null and belongUnitTypeNo != ''">
        and BELONG_UNIT_TYPE_NO LIKE '%${belongUnitTypeNo}%'
      </if>
      <if test="belongUnitTypeName != null and belongUnitTypeName != ''">
        and BELONG_UNIT_TYPE_NAME LIKE '%${belongUnitTypeName}%'
      </if>
      <if test="usetDepartment != null and usetDepartment != ''">
        and USET_DEPARTMENT LIKE '%${usetDepartment}%'
      </if>
      <if test="vehicleIdentifyNo != null and vehicleIdentifyNo != ''">
        and VEHICLE_IDENTIFY_NO LIKE '%${vehicleIdentifyNo}%'
      </if>
      <if test="fillingDepartment != null and fillingDepartment != ''">
        and FILLING_DEPARTMENT LIKE '%${fillingDepartment}%'
      </if>
      <if test="fillingUser != null and fillingUser != ''">
        and FILLING_USER LIKE '%${fillingUser}%'
      </if>
      <if test="isInsurance != null and isInsurance != ''">
        and IS_INSURANCE LIKE '%${isInsurance}%'
      </if>
      <if test="otherInsurance != null and otherInsurance != ''">
        and OTHER_INSURANCE LIKE '%${otherInsurance}%'
      </if>
      <if test="isSpecialunit != null and isSpecialunit != ''">
        and IS_SPECIALUNIT LIKE '%${isSpecialunit}%'
      </if>
      <if test="usetDepartmentNo != null and usetDepartmentNo != ''">
        and USET_DEPARTMENT_NO LIKE '%${usetDepartmentNo}%'
      </if>
    </where>
  </sql>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from METER_BASE_CAR
    where PK_NO = #{pkNo,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from METER_BASE_CAR
    where 1!=1 
      <if test="carNo != null and carNo != ''">
        or CAR_NO = #{carNo}
      </if>
      <if test="mnemonicCode != null and mnemonicCode != ''">
        or MNEMONIC_CODE = #{mnemonicCode}
      </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="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>
      <if test="carSelfWeight != null">
        or CAR_SELF_WEIGHT = #{carSelfWeight}
      </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="ssoId != null and ssoId != ''">
        or SSO_ID = #{ssoId}
      </if>
      <if test="vehicleType != null and vehicleType != ''">
        or VEHICLE_TYPE = #{vehicleType}
      </if>
      <if test="belongUnitTypeNo != null and belongUnitTypeNo != ''">
        or BELONG_UNIT_TYPE_NO = #{belongUnitTypeNo}
      </if>
      <if test="belongUnitTypeName != null and belongUnitTypeName != ''">
        or BELONG_UNIT_TYPE_NAME = #{belongUnitTypeName}
      </if>
      <if test="usetDepartment != null and usetDepartment != ''">
        or USET_DEPARTMENT = #{usetDepartment}
      </if>
      <if test="vehicleIdentifyNo != null and vehicleIdentifyNo != ''">
        or VEHICLE_IDENTIFY_NO = #{vehicleIdentifyNo}
      </if>
      <if test="fillingDepartment != null and fillingDepartment != ''">
        or FILLING_DEPARTMENT = #{fillingDepartment}
      </if>
      <if test="fillingUser != null and fillingUser != ''">
        or FILLING_USER = #{fillingUser}
      </if>
      <if test="isInsurance != null and isInsurance != ''">
        or IS_INSURANCE = #{isInsurance}
      </if>
      <if test="otherInsurance != null and otherInsurance != ''">
        or OTHER_INSURANCE = #{otherInsurance}
      </if>
      <if test="isSpecialunit != null and isSpecialunit != ''">
        or IS_SPECIALUNIT = #{isSpecialunit}
      </if>
      <if test="usetDepartmentNo != null and usetDepartmentNo != ''">
        or USET_DEPARTMENT_NO = #{usetDepartmentNo}
      </if>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.baseinfo.meterbasecar.model.MeterBaseCar">
    insert into METER_BASE_CAR (PK_NO, CAR_NO, MNEMONIC_CODE, 
      CUSTOMER_SUPPLIER_NO, CUSTOMER_SUPPLIER_NAME, 
      CAR_TYPE_NO, CAR_TYPE_NAME, CAR_CARRIER_WEIGHT, 
      CAR_SELF_WEIGHT, 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, 
      SSO_ID, VEHICLE_TYPE, BELONG_UNIT_TYPE_NO, 
      BELONG_UNIT_TYPE_NAME, USET_DEPARTMENT, VEHICLE_IDENTIFY_NO, 
      FILLING_DEPARTMENT, FILLING_USER, IS_INSURANCE, 
      OTHER_INSURANCE, IS_SPECIALUNIT, USET_DEPARTMENT_NO
      )
    values (#{pkNo,jdbcType=VARCHAR}, #{carNo,jdbcType=VARCHAR}, #{mnemonicCode,jdbcType=VARCHAR}, 
      #{customerSupplierNo,jdbcType=VARCHAR}, #{customerSupplierName,jdbcType=VARCHAR}, 
      #{carTypeNo,jdbcType=VARCHAR}, #{carTypeName,jdbcType=VARCHAR}, #{carCarrierWeight,jdbcType=DECIMAL}, 
      #{carSelfWeight,jdbcType=DECIMAL}, #{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}, 
      #{ssoId,jdbcType=VARCHAR}, #{vehicleType,jdbcType=VARCHAR}, #{belongUnitTypeNo,jdbcType=VARCHAR}, 
      #{belongUnitTypeName,jdbcType=VARCHAR}, #{usetDepartment,jdbcType=VARCHAR}, #{vehicleIdentifyNo,jdbcType=VARCHAR}, 
      #{fillingDepartment,jdbcType=VARCHAR}, #{fillingUser,jdbcType=VARCHAR}, #{isInsurance,jdbcType=VARCHAR}, 
      #{otherInsurance,jdbcType=VARCHAR}, #{isSpecialunit,jdbcType=VARCHAR}, #{usetDepartmentNo,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.baseinfo.meterbasecar.model.MeterBaseCar">
    insert into METER_BASE_CAR
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="pkNo != null">
        PK_NO,
      </if>
      <if test="carNo != null">
        CAR_NO,
      </if>
      <if test="mnemonicCode != null">
        MNEMONIC_CODE,
      </if>
      <if test="customerSupplierNo != null">
        CUSTOMER_SUPPLIER_NO,
      </if>
      <if test="customerSupplierName != null">
        CUSTOMER_SUPPLIER_NAME,
      </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>
      <if test="carSelfWeight != null">
        CAR_SELF_WEIGHT,
      </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="ssoId != null">
        SSO_ID,
      </if>
      <if test="vehicleType != null">
        VEHICLE_TYPE,
      </if>
      <if test="belongUnitTypeNo != null">
        BELONG_UNIT_TYPE_NO,
      </if>
      <if test="belongUnitTypeName != null">
        BELONG_UNIT_TYPE_NAME,
      </if>
      <if test="usetDepartment != null">
        USET_DEPARTMENT,
      </if>
      <if test="vehicleIdentifyNo != null">
        VEHICLE_IDENTIFY_NO,
      </if>
      <if test="fillingDepartment != null">
        FILLING_DEPARTMENT,
      </if>
      <if test="fillingUser != null">
        FILLING_USER,
      </if>
      <if test="isInsurance != null">
        IS_INSURANCE,
      </if>
      <if test="otherInsurance != null">
        OTHER_INSURANCE,
      </if>
      <if test="isSpecialunit != null">
        IS_SPECIALUNIT,
      </if>
      <if test="usetDepartmentNo != null">
        USET_DEPARTMENT_NO,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="pkNo != null">
        #{pkNo,jdbcType=VARCHAR},
      </if>
      <if test="carNo != null">
        #{carNo,jdbcType=VARCHAR},
      </if>
      <if test="mnemonicCode != null">
        #{mnemonicCode,jdbcType=VARCHAR},
      </if>
      <if test="customerSupplierNo != null">
        #{customerSupplierNo,jdbcType=VARCHAR},
      </if>
      <if test="customerSupplierName != null">
        #{customerSupplierName,jdbcType=VARCHAR},
      </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>
      <if test="carSelfWeight != null">
        #{carSelfWeight,jdbcType=DECIMAL},
      </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="ssoId != null">
        #{ssoId,jdbcType=VARCHAR},
      </if>
      <if test="vehicleType != null">
        #{vehicleType,jdbcType=VARCHAR},
      </if>
      <if test="belongUnitTypeNo != null">
        #{belongUnitTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="belongUnitTypeName != null">
        #{belongUnitTypeName,jdbcType=VARCHAR},
      </if>
      <if test="usetDepartment != null">
        #{usetDepartment,jdbcType=VARCHAR},
      </if>
      <if test="vehicleIdentifyNo != null">
        #{vehicleIdentifyNo,jdbcType=VARCHAR},
      </if>
      <if test="fillingDepartment != null">
        #{fillingDepartment,jdbcType=VARCHAR},
      </if>
      <if test="fillingUser != null">
        #{fillingUser,jdbcType=VARCHAR},
      </if>
      <if test="isInsurance != null">
        #{isInsurance,jdbcType=VARCHAR},
      </if>
      <if test="otherInsurance != null">
        #{otherInsurance,jdbcType=VARCHAR},
      </if>
      <if test="isSpecialunit != null">
        #{isSpecialunit,jdbcType=VARCHAR},
      </if>
      <if test="usetDepartmentNo != null">
        #{usetDepartmentNo,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.baseinfo.meterbasecar.model.MeterBaseCar">
    update METER_BASE_CAR
    set CAR_NO = #{carNo,jdbcType=VARCHAR},
      MNEMONIC_CODE = #{mnemonicCode,jdbcType=VARCHAR},
      CUSTOMER_SUPPLIER_NO = #{customerSupplierNo,jdbcType=VARCHAR},
      CUSTOMER_SUPPLIER_NAME = #{customerSupplierName,jdbcType=VARCHAR},
      CAR_TYPE_NO = #{carTypeNo,jdbcType=VARCHAR},
      CAR_TYPE_NAME = #{carTypeName,jdbcType=VARCHAR},
      CAR_CARRIER_WEIGHT = #{carCarrierWeight,jdbcType=DECIMAL},
      CAR_SELF_WEIGHT = #{carSelfWeight,jdbcType=DECIMAL},
      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},
      SSO_ID = #{ssoId,jdbcType=VARCHAR},
      VEHICLE_TYPE = #{vehicleType,jdbcType=VARCHAR},
      BELONG_UNIT_TYPE_NO = #{belongUnitTypeNo,jdbcType=VARCHAR},
      BELONG_UNIT_TYPE_NAME = #{belongUnitTypeName,jdbcType=VARCHAR},
      USET_DEPARTMENT = #{usetDepartment,jdbcType=VARCHAR},
      VEHICLE_IDENTIFY_NO = #{vehicleIdentifyNo,jdbcType=VARCHAR},
      FILLING_DEPARTMENT = #{fillingDepartment,jdbcType=VARCHAR},
      FILLING_USER = #{fillingUser,jdbcType=VARCHAR},
      IS_INSURANCE = #{isInsurance,jdbcType=VARCHAR},
      OTHER_INSURANCE = #{otherInsurance,jdbcType=VARCHAR},
      IS_SPECIALUNIT = #{isSpecialunit,jdbcType=VARCHAR},
      USET_DEPARTMENT_NO = #{usetDepartmentNo,jdbcType=VARCHAR}
    where PK_NO = #{pkNo,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.baseinfo.meterbasecar.model.MeterBaseCar">
    update METER_BASE_CAR
    <set>
      <if test="carNo != null">
        CAR_NO = #{carNo,jdbcType=VARCHAR},
      </if>
      <if test="mnemonicCode != null">
        MNEMONIC_CODE = #{mnemonicCode,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="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>
      <if test="carSelfWeight != null">
        CAR_SELF_WEIGHT = #{carSelfWeight,jdbcType=DECIMAL},
      </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="ssoId != null">
        SSO_ID = #{ssoId,jdbcType=VARCHAR},
      </if>
      <if test="vehicleType != null">
        VEHICLE_TYPE = #{vehicleType,jdbcType=VARCHAR},
      </if>
      <if test="belongUnitTypeNo != null">
        BELONG_UNIT_TYPE_NO = #{belongUnitTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="belongUnitTypeName != null">
        BELONG_UNIT_TYPE_NAME = #{belongUnitTypeName,jdbcType=VARCHAR},
      </if>
      <if test="usetDepartment != null">
        USET_DEPARTMENT = #{usetDepartment,jdbcType=VARCHAR},
      </if>
      <if test="vehicleIdentifyNo != null">
        VEHICLE_IDENTIFY_NO = #{vehicleIdentifyNo,jdbcType=VARCHAR},
      </if>
      <if test="fillingDepartment != null">
        FILLING_DEPARTMENT = #{fillingDepartment,jdbcType=VARCHAR},
      </if>
      <if test="fillingUser != null">
        FILLING_USER = #{fillingUser,jdbcType=VARCHAR},
      </if>
      <if test="isInsurance != null">
        IS_INSURANCE = #{isInsurance,jdbcType=VARCHAR},
      </if>
      <if test="otherInsurance != null">
        OTHER_INSURANCE = #{otherInsurance,jdbcType=VARCHAR},
      </if>
      <if test="isSpecialunit != null">
        IS_SPECIALUNIT = #{isSpecialunit,jdbcType=VARCHAR},
      </if>
      <if test="usetDepartmentNo != null">
        USET_DEPARTMENT_NO = #{usetDepartmentNo,jdbcType=VARCHAR},
      </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_CAR 
      (PK_NO, 
      CAR_NO, MNEMONIC_CODE, CUSTOMER_SUPPLIER_NO, 
      CUSTOMER_SUPPLIER_NAME, CAR_TYPE_NO, 
      CAR_TYPE_NAME, CAR_CARRIER_WEIGHT, 
      CAR_SELF_WEIGHT, 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, 
      SSO_ID, VEHICLE_TYPE, BELONG_UNIT_TYPE_NO, 
      BELONG_UNIT_TYPE_NAME, USET_DEPARTMENT, 
      VEHICLE_IDENTIFY_NO, FILLING_DEPARTMENT, 
      FILLING_USER, IS_INSURANCE, OTHER_INSURANCE, 
      IS_SPECIALUNIT, USET_DEPARTMENT_NO
      )
    ( <foreach collection="list" item="item" separator="union all"> 
   select  
      #{item.pkNo,jdbcType=VARCHAR}, 
      #{item.carNo,jdbcType=VARCHAR}, #{item.mnemonicCode,jdbcType=VARCHAR}, #{item.customerSupplierNo,jdbcType=VARCHAR}, 
      #{item.customerSupplierName,jdbcType=VARCHAR}, #{item.carTypeNo,jdbcType=VARCHAR}, 
      #{item.carTypeName,jdbcType=VARCHAR}, #{item.carCarrierWeight,jdbcType=DECIMAL}, 
      #{item.carSelfWeight,jdbcType=DECIMAL}, #{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.ssoId,jdbcType=VARCHAR}, #{item.vehicleType,jdbcType=VARCHAR}, #{item.belongUnitTypeNo,jdbcType=VARCHAR}, 
      #{item.belongUnitTypeName,jdbcType=VARCHAR}, #{item.usetDepartment,jdbcType=VARCHAR}, 
      #{item.vehicleIdentifyNo,jdbcType=VARCHAR}, #{item.fillingDepartment,jdbcType=VARCHAR}, 
      #{item.fillingUser,jdbcType=VARCHAR}, #{item.isInsurance,jdbcType=VARCHAR}, #{item.otherInsurance,jdbcType=VARCHAR}, 
      #{item.isSpecialunit,jdbcType=VARCHAR}, #{item.usetDepartmentNo,jdbcType=VARCHAR}
       from dual  
   </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
     update METER_BASE_CAR
     set
       PK_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.pkNo,jdbcType=VARCHAR}
       </foreach>
       ,CAR_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.carNo,jdbcType=VARCHAR}
       </foreach>
       ,MNEMONIC_CODE=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.mnemonicCode,jdbcType=VARCHAR}
       </foreach>
       ,CUSTOMER_SUPPLIER_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.customerSupplierNo,jdbcType=VARCHAR}
       </foreach>
       ,CUSTOMER_SUPPLIER_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.customerSupplierName,jdbcType=VARCHAR}
       </foreach>
       ,CAR_TYPE_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.carTypeNo,jdbcType=VARCHAR}
       </foreach>
       ,CAR_TYPE_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.carTypeName,jdbcType=VARCHAR}
       </foreach>
       ,CAR_CARRIER_WEIGHT=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.carCarrierWeight,jdbcType=DECIMAL}
       </foreach>
       ,CAR_SELF_WEIGHT=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.carSelfWeight,jdbcType=DECIMAL}
       </foreach>
       ,MEMO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
       </foreach>
       ,VALID_FLAG=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.validFlag,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
       </foreach>
       ,UPDATE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
       </foreach>
       ,DELETE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.deleteManNo,jdbcType=VARCHAR}
       </foreach>
       ,DELETE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.deleteManName,jdbcType=VARCHAR}
       </foreach>
       ,DELETE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.deleteTime,jdbcType=TIMESTAMP}
       </foreach>
       ,SSO_ID=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.ssoId,jdbcType=VARCHAR}
       </foreach>
       ,VEHICLE_TYPE=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.vehicleType,jdbcType=VARCHAR}
       </foreach>
       ,BELONG_UNIT_TYPE_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.belongUnitTypeNo,jdbcType=VARCHAR}
       </foreach>
       ,BELONG_UNIT_TYPE_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.belongUnitTypeName,jdbcType=VARCHAR}
       </foreach>
       ,USET_DEPARTMENT=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.usetDepartment,jdbcType=VARCHAR}
       </foreach>
       ,VEHICLE_IDENTIFY_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.vehicleIdentifyNo,jdbcType=VARCHAR}
       </foreach>
       ,FILLING_DEPARTMENT=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.fillingDepartment,jdbcType=VARCHAR}
       </foreach>
       ,FILLING_USER=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.fillingUser,jdbcType=VARCHAR}
       </foreach>
       ,IS_INSURANCE=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.isInsurance,jdbcType=VARCHAR}
       </foreach>
       ,OTHER_INSURANCE=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.otherInsurance,jdbcType=VARCHAR}
       </foreach>
       ,IS_SPECIALUNIT=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.isSpecialunit,jdbcType=VARCHAR}
       </foreach>
       ,USET_DEPARTMENT_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
          when #{item.pkNo,jdbcType=VARCHAR} then #{item.usetDepartmentNo,jdbcType=VARCHAR}
       </foreach>
     where PK_NO in 
     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
    #{item.pkNo,jdbcType=VARCHAR}
     </foreach> 
  </update>
  <delete id="batchDelete" parameterType="java.util.List">
    delete from METER_BASE_CAR
    where PK_NO in 
    <foreach collection="list" item="id" open="(" close=")" 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) -4))),0) + 1,5,'0') PK_NO
        FROM METER_BASE_CAR where instr(PK_NO,#{afl,jdbcType=VARCHAR})>0 -->
    SELECT LPAD(NVL(MAX(TO_NUMBER(SUBSTR(PK_NO,9))),0) + 1,5,'0') PK_NO
    FROM METER_BASE_CAR where instr(PK_NO,#{afl,jdbcType=VARCHAR})>0
  </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="carNo != null and carNo != ''">
        and CCAR_NO = #{cusSupCarNo}
      </if>
    </where>
  </select>

  <!--  批量删除车辆-->
  <update id="deleteCarById" parameterType="java.util.List">
    update METER_BASE_CAR set VALID_FLAG = '1' where CAR_NO in
    <foreach item="carNos" collection="list" open="(" separator="," close=")">
      #{carNos}
    </foreach>
  </update>

  <update id="enableCarById" parameterType="java.util.List">
    update METER_BASE_CAR set VALID_FLAG = '0' where CAR_NO in
    <foreach item="carNos" collection="list" open="(" separator="," close=")">
      #{carNos}
    </foreach>
  </update>

  <select id="selectByMap" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select" />
    where valid_flag in ('1', '2')
    <if test="carNo != null and carNo != ''">
      and CAR_NO = '${carNo}'
    </if>
  </select>

  <update id="updateValidFlagById" parameterType="java.util.HashMap">
    update METER_BASE_CAR set VALID_FLAG = '0'
    where 1=1
    <if test="pkNo != null and pkNo != ''">
      and PK_NO = #{pkNo}
    </if>
  </update>

  <select id="selectByParametersNoPage" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select" />
    <include refid="where" />
    <if test="flag != null and flag != ''">
      where valid_flag = '0'
      and car_type_no = '001004003'
    </if>
  </select>

  <update id="reNewID" parameterType="com.steerinfo.baseinfo.meterbasecar.model.MeterBaseCar">
    update METER_BASE_CAR
    <set>
      <if test="pkNo != null">
        pk_no = #{pkNo,jdbcType=VARCHAR},
      </if>
      <if test="carNo != null">
        CAR_NO = #{carNo,jdbcType=VARCHAR},
      </if>
      <if test="mnemonicCode != null">
        MNEMONIC_CODE = #{mnemonicCode,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="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>
      <if test="carSelfWeight != null">
        CAR_SELF_WEIGHT = #{carSelfWeight,jdbcType=DECIMAL},
      </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="ssoId != null">
        SSO_ID = #{ssoId,jdbcType=VARCHAR},
      </if>
      <if test="vehicleType != null">
        VEHICLE_TYPE = #{vehicleType,jdbcType=VARCHAR},
      </if>
      <if test="belongUnitTypeNo != null">
        BELONG_UNIT_TYPE_NO = #{belongUnitTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="belongUnitTypeName != null">
        BELONG_UNIT_TYPE_NAME = #{belongUnitTypeName,jdbcType=VARCHAR},
      </if>
      <if test="usetDepartment != null">
        USET_DEPARTMENT = #{usetDepartment,jdbcType=VARCHAR},
      </if>
      <if test="vehicleIdentifyNo != null">
        VEHICLE_IDENTIFY_NO = #{vehicleIdentifyNo,jdbcType=VARCHAR},
      </if>
      <if test="fillingDepartment != null">
        FILLING_DEPARTMENT = #{fillingDepartment,jdbcType=VARCHAR},
      </if>
      <if test="fillingUser != null">
        FILLING_USER = #{fillingUser,jdbcType=VARCHAR},
      </if>
      <if test="isInsurance != null">
        IS_INSURANCE = #{isInsurance,jdbcType=VARCHAR},
      </if>
      <if test="otherInsurance != null">
        OTHER_INSURANCE = #{otherInsurance,jdbcType=VARCHAR},
      </if>
      <if test="isSpecialunit != null">
        IS_SPECIALUNIT = #{isSpecialunit,jdbcType=VARCHAR},
      </if>
      <if test="usetDepartmentNo != null">
        USET_DEPARTMENT_NO = #{usetDepartmentNo,jdbcType=VARCHAR},
      </if>
    </set>
    where CAR_NO = #{carNo,jdbcType=VARCHAR}
  </update>

  <select id="ssoIdBySysUser" parameterType="java.util.HashMap" resultType="java.lang.String">
     select user_Id as pk_no from sso.sys_user
     where user_code = #{userCode}
  </select>
</mapper>