<?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.jkcredit.invoice.mapper.customer.CustomerRecMapper" >
  <resultMap id="BaseResultMap" type="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="customerName" property="customerName" jdbcType="VARCHAR" />
    <result column="company_leader" property="companyLeader" jdbcType="VARCHAR" />
    <result column="company_leader_Phone" property="companyLeaderPhone" jdbcType="VARCHAR" />
    <result column="company_name" property="companyName" jdbcType="VARCHAR" />
    <result column="company_referenceNum" property="companyReferencenum" jdbcType="VARCHAR" />
    <result column="company_openbank" property="companyOpenbank" jdbcType="VARCHAR" />
    <result column="company_openbank_acc" property="companyOpenbankAcc" jdbcType="VARCHAR" />
    <result column="company_adress" property="companyAdress" jdbcType="VARCHAR" />
    <result column="company_phone" property="companyPhone" jdbcType="VARCHAR" />
    <result column="createTime" property="createtime" jdbcType="VARCHAR" />
    <result column="company_belong_name" property="companyBelongName" jdbcType="VARCHAR" />
    <result column="rec_status" property="recStatus" jdbcType="INTEGER" />
    <result column="inter_type" property="interType" jdbcType="INTEGER" />
    <result column="bussiness_type" property="bussinessType" jdbcType="INTEGER" />
    <result column="company_type" property="companyType" jdbcType="INTEGER" />
    <result column="operating_rangeType" property="operatingRangeType" jdbcType="INTEGER" />
    <result column="company_num" property="companyNum" jdbcType="VARCHAR" />
    <result column="service_startTime" property="serviceStartTime" jdbcType="VARCHAR" />
    <result column="service_endTime" property="serviceEndTime" jdbcType="VARCHAR" />
    <result column="service_type" property="serviceType" jdbcType="INTEGER" />
    <result column="contractFileName" property="contractFileName" jdbcType="VARCHAR" />
    <result column="contractSuc" property="contractSuc" jdbcType="INTEGER" />
    <result column="base64Str" property="base64Str" jdbcType="VARCHAR" />
    <result column="contrantNum" property="contrantNum" jdbcType="VARCHAR" />
    <result column="lowerFileName" property="lowerFileName" jdbcType="VARCHAR" />
    <result column="lowerBase64Str" property="lowerBase64Str" jdbcType="VARCHAR" />
  </resultMap>



  <resultMap id="BaseResultMapNoBase64Str" type="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="customerName" property="customerName" jdbcType="VARCHAR" />
    <result column="company_leader" property="companyLeader" jdbcType="VARCHAR" />
    <result column="company_leader_Phone" property="companyLeaderPhone" jdbcType="VARCHAR" />
    <result column="company_name" property="companyName" jdbcType="VARCHAR" />
    <result column="company_referenceNum" property="companyReferencenum" jdbcType="VARCHAR" />
    <result column="company_openbank" property="companyOpenbank" jdbcType="VARCHAR" />
    <result column="company_openbank_acc" property="companyOpenbankAcc" jdbcType="VARCHAR" />
    <result column="company_adress" property="companyAdress" jdbcType="VARCHAR" />
    <result column="company_phone" property="companyPhone" jdbcType="VARCHAR" />
    <result column="createTime" property="createtime" jdbcType="VARCHAR" />
    <result column="company_belong_name" property="companyBelongName" jdbcType="VARCHAR" />
    <result column="rec_status" property="recStatus" jdbcType="INTEGER" />
    <result column="inter_type" property="interType" jdbcType="INTEGER" />
    <result column="bussiness_type" property="bussinessType" jdbcType="INTEGER" />
    <result column="company_type" property="companyType" jdbcType="INTEGER" />
    <result column="operating_rangeType" property="operatingRangeType" jdbcType="INTEGER" />
    <result column="company_num" property="companyNum" jdbcType="VARCHAR" />
    <result column="service_startTime" property="serviceStartTime" jdbcType="VARCHAR" />
    <result column="service_endTime" property="serviceEndTime" jdbcType="VARCHAR" />
    <result column="service_type" property="serviceType" jdbcType="INTEGER" />
    <result column="contractFileName" property="contractFileName" jdbcType="VARCHAR" />
    <result column="contractSuc" property="contractSuc" jdbcType="INTEGER" />
    <result column="contrantNum" property="contrantNum" jdbcType="VARCHAR" />
    <result column="lowerFileName" property="lowerFileName" jdbcType="VARCHAR" />
    <result column="lowerBase64Str" property="lowerBase64Str" jdbcType="VARCHAR" />

  </resultMap>
  <resultMap id="BaseResultMapNoLocalBase64Str" type="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="customerName" property="customerName" jdbcType="VARCHAR" />
    <result column="company_leader" property="companyLeader" jdbcType="VARCHAR" />
    <result column="company_leader_Phone" property="companyLeaderPhone" jdbcType="VARCHAR" />
    <result column="company_name" property="companyName" jdbcType="VARCHAR" />
    <result column="company_referenceNum" property="companyReferencenum" jdbcType="VARCHAR" />
    <result column="company_openbank" property="companyOpenbank" jdbcType="VARCHAR" />
    <result column="company_openbank_acc" property="companyOpenbankAcc" jdbcType="VARCHAR" />
    <result column="company_adress" property="companyAdress" jdbcType="VARCHAR" />
    <result column="company_phone" property="companyPhone" jdbcType="VARCHAR" />
    <result column="createTime" property="createtime" jdbcType="VARCHAR" />
    <result column="company_belong_name" property="companyBelongName" jdbcType="VARCHAR" />
    <result column="rec_status" property="recStatus" jdbcType="INTEGER" />
    <result column="inter_type" property="interType" jdbcType="INTEGER" />
    <result column="bussiness_type" property="bussinessType" jdbcType="INTEGER" />
    <result column="company_type" property="companyType" jdbcType="INTEGER" />
    <result column="operating_rangeType" property="operatingRangeType" jdbcType="INTEGER" />
    <result column="company_num" property="companyNum" jdbcType="VARCHAR" />
    <result column="service_startTime" property="serviceStartTime" jdbcType="VARCHAR" />
    <result column="service_endTime" property="serviceEndTime" jdbcType="VARCHAR" />
    <result column="service_type" property="serviceType" jdbcType="INTEGER" />
    <result column="contractFileName" property="contractFileName" jdbcType="VARCHAR" />
    <result column="contractSuc" property="contractSuc" jdbcType="INTEGER" />
    <result column="contrantNum" property="contrantNum" jdbcType="VARCHAR" />
    <result column="lowerFileName" property="lowerFileName" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, customerName,company_leader, company_leader_Phone, company_name, company_referenceNum, company_openbank,
    company_openbank_acc, company_adress, company_phone, createTime, company_belong_name, 
    rec_status, inter_type,bussiness_type,company_type,operating_rangeType,company_num,service_startTime
    ,service_endTime,service_type,contractFileName,contractSuc,contrantNum,lowerFileName,fileMessage
  </sql>

  <select id="selectAllByPage" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from t_customer_rec
    <where>
    <if test="customerRec.customerName != null and customerRec.customerName != ''">
      AND   customerName = BINARY #{customerRec.customerName}
    </if>
    <if test="customerRec.companyLeaderPhone != null and customerRec.companyLeaderPhone != ''">
      and  company_leader_Phone = BINARY #{customerRec.companyLeaderPhone}
    </if>
    <if test="customerRec.companyReferencenum != null and customerRec.companyReferencenum != ''">
      and  company_referenceNum = BINARY #{customerRec.companyReferencenum}
    </if>
    <if test="customerRec.companyName != null and customerRec.companyName != ''">
      and  company_name  LIKE BINARY CONCAT('%',#{customerRec.companyName},'%')
    </if>
      <if test="customerRec.companyBelongName != null and customerRec.companyBelongName != ''">
        and company_belong_name  LIKE CONCAT('%',#{customerRec.companyBelongName},'%')
      </if>
      <if test="customerRec.serviceEndTimeStart != null and customerRec.serviceEndTimeStart != ''">
        and service_endTime BETWEEN #{customerRec.serviceEndTimeStart} and #{customerRec.serviceEndTimeEnd}
      </if>
    </where>
      order by id DESC
  </select>

  <select id="selectAllNoCarComapany" resultMap="BaseResultMap">
    select
      DISTINCT company_name
    from t_customer_rec
    where bussiness_type = 2 and rec_status = 1
  </select>

  <select id="selectAllByPageWarning" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from t_customer_rec
    <where>
      <if test="customerRec.customerName != null and customerRec.customerName != ''">
        AND   customerName = BINARY #{customerRec.customerName}
      </if>
      <if test="customerRec.companyLeaderPhone != null and customerRec.companyLeaderPhone != ''">
        and  company_leader_Phone = BINARY #{customerRec.companyLeaderPhone}
      </if>
      <if test="customerRec.companyReferencenum != null and customerRec.companyReferencenum != ''">
        and  company_referenceNum = BINARY #{customerRec.companyReferencenum}
      </if>
      <if test="customerRec.companyName != null and customerRec.companyName != ''">
        and  company_name  LIKE BINARY CONCAT('%',#{customerRec.companyName},'%')
      </if>
      <if test="customerRec.companyBelongName != null and customerRec.companyBelongName != ''">
        and company_belong_name  LIKE CONCAT('%',#{customerRec.companyBelongName},'%')
      </if>
      <if test="customerRec.serviceEndTimeStart != null and customerRec.serviceEndTimeStart != ''">
        and service_endTime BETWEEN #{customerRec.serviceEndTimeStart} and #{customerRec.serviceEndTimeEnd}
      </if>
        and  rec_status = 1
        and service_endTime is not null

    </where>
    order by id DESC
  </select>



  <select id="selectAllByPageExport" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from t_customer_rec
    <where>
      <if test="customerRec.customerName != null and customerRec.customerName != ''">
        AND   customerName = BINARY #{customerRec.customerName}
      </if>
      <if test="customerRec.companyName != null and customerRec.companyName != ''">
        and  company_name  LIKE BINARY CONCAT('%',#{customerRec.companyName},'%')
      </if>
      <if test="customerRec.companyBelongName != null and customerRec.companyBelongName != ''">
        and  company_belong_name   LIKE BINARY CONCAT('%',#{customerRec.companyBelongName},'%')
      </if>
    </where>
    ORDER by customerName
  </select>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from t_customer_rec
    where company_num = #{id,jdbcType=INTEGER}
  </select>
  <select id="selectByPrimaryKeyHasBase64" resultMap="BaseResultMapNoBase64Str" parameterType="java.lang.Integer" >
    select
    <include refid="Base_Column_List" />,lowerBase64Str
    from t_customer_rec
    where id = #{id,jdbcType=INTEGER}
  </select>


  <select id="selectByPrimaryKeyHasNoLocalBase64" resultMap="BaseResultMapNoLocalBase64Str" parameterType="java.lang.Integer" >
    select
    <include refid="Base_Column_List" />
    from t_customer_rec
    where id = #{id,jdbcType=INTEGER}
  </select>



  <select id="selectByCustomerName" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select
    <include refid="Base_Column_List" />
    from t_customer_rec
    where  customerName = BINARY #{customerName,jdbcType=VARCHAR} and rec_status =1
  </select>
    <select id="selectByCustomerNameAll" resultMap="BaseResultMap" parameterType="java.lang.String" >
        select
        <include refid="Base_Column_List" />
        from t_customer_rec
        where  customerName = BINARY #{customerName,jdbcType=VARCHAR}
    </select>
  <select id="selectByCustomerNameCpAll" resultMap="BaseResultMap" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
    select
    <include refid="Base_Column_List" />
    from t_customer_rec
    where  customerName = BINARY #{customerRec.customerName,jdbcType=VARCHAR}
    <if test="customerRec.companyName != null and customerRec.companyName != ''">
      and  company_name   LIKE BINARY CONCAT('%',#{customerRec.companyName},'%')
    </if>
  </select>
    <select id="selectByCustomerNameAndCompany" resultMap="BaseResultMap" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
        select
        <include refid="Base_Column_List" />
        from t_customer_rec
        where  customerName = BINARY #{customerName,jdbcType=VARCHAR} AND  company_name = BINARY  #{companyName,jdbcType=VARCHAR}
    </select>
  <select id="selectByCustomerNameAndCompanyReference" resultMap="BaseResultMap" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
    select
    <include refid="Base_Column_List" />
    from t_customer_rec
    where  customerName = BINARY #{customerName,jdbcType=VARCHAR} AND  company_referenceNum = BINARY #{companyReferencenum,jdbcType=VARCHAR} and rec_status =1
  </select>
  <select id="selectByCustomerNameAndCompanyReferenceAll" resultMap="BaseResultMap" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
    select
    <include refid="Base_Column_List" />
    from t_customer_rec
    where  customerName = BINARY #{customerName,jdbcType=VARCHAR} AND  company_referenceNum = BINARY #{companyReferencenum,jdbcType=VARCHAR}
  </select>
    <select id="selectByCompanyReference" resultMap="BaseResultMap" parameterType="java.lang.String" >
        select
        <include refid="Base_Column_List" />
        from t_customer_rec
        where   company_referenceNum = BINARY #{companyReferencenum,jdbcType=VARCHAR} and rec_status =1
    </select>

  <select id="selectByCustomerNameAndCompanyConcat" resultMap="BaseResultMap" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
    select
    <include refid="Base_Column_List" />,base64Str
    from t_customer_rec
    where  customerName = BINARY #{customerName,jdbcType=VARCHAR} AND BINARY company_name =  #{companyName,jdbcType=VARCHAR}
  </select>
  <select id="selectByCustomerNameAndCompanyNum" resultMap="BaseResultMap" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
    select
    <include refid="Base_Column_List" />
    from t_customer_rec
    where  customerName = BINARY #{customerName,jdbcType=VARCHAR} AND company_num =  #{companyNum,jdbcType=VARCHAR}
  </select>
    <select id="selectByCompanyNum" resultMap="BaseResultMap" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
        select
        <include refid="Base_Column_List" />
        from t_customer_rec
        where  company_num =  #{companyNum,jdbcType=VARCHAR} and rec_status =1
    </select>
  <select id="selectByCompanyName" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select
    <include refid="Base_Column_List" />
    from t_customer_rec
    where  company_name =  #{companyName,jdbcType=VARCHAR} and rec_status =1
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from t_customer_rec
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
    insert into t_customer_rec (customerName,company_leader, company_leader_Phone,
      company_name, company_referenceNum, company_openbank, 
      company_openbank_acc, company_adress, company_phone, 
      createTime, company_belong_name, rec_status, 
      inter_type,bussiness_type,company_type,operating_rangeType,company_num,
      service_startTime,service_endTime,service_type,contractFileName,base64Str,contractSuc,lowerFileName,lowerBase64Str
      )
    values (#{customerName,jdbcType=VARCHAR}, #{companyLeader,jdbcType=VARCHAR}, #{companyLeaderPhone,jdbcType=VARCHAR},
      #{companyName,jdbcType=VARCHAR}, #{companyReferencenum,jdbcType=VARCHAR}, #{companyOpenbank,jdbcType=VARCHAR}, 
      #{companyOpenbankAcc,jdbcType=VARCHAR}, #{companyAdress,jdbcType=VARCHAR}, #{companyPhone,jdbcType=VARCHAR}, 
      #{createtime,jdbcType=TIMESTAMP}, #{companyBelongName,jdbcType=VARCHAR}, #{recStatus,jdbcType=INTEGER}, 
      #{interType,jdbcType=INTEGER}, #{bussinessType,jdbcType=INTEGER},#{companyType,jdbcType=INTEGER},#{operatingRangeType,jdbcType=INTEGER},#{companyNum,jdbcType=VARCHAR},
      #{serviceStartTime,jdbcType=VARCHAR},#{serviceEndTime,jdbcType=VARCHAR},#{serviceType,jdbcType=INTEGER},#{contractFileName,jdbcType=VARCHAR},#{base64Str,jdbcType=VARCHAR},#{contractSuc,jdbcType=INTEGER},#{lowerFileName,jdbcType=VARCHAR},#{lowerBase64Str,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
    insert into t_customer_rec
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="companyLeader != null" >
        company_leader,
      </if>
      <if test="companyLeaderPhone != null" >
        company_leader_Phone,
      </if>
      <if test="companyName != null" >
        company_name,
      </if>
      <if test="companyReferencenum != null" >
        company_referenceNum,
      </if>
      <if test="companyOpenbank != null" >
        company_openbank,
      </if>
      <if test="companyOpenbankAcc != null" >
        company_openbank_acc,
      </if>
      <if test="companyAdress != null" >
        company_adress,
      </if>
      <if test="companyPhone != null" >
        company_phone,
      </if>
      <if test="createtime != null" >
        createTime,
      </if>
      <if test="companyBelongName != null" >
        company_belong_name,
      </if>
      <if test="recStatus != null" >
        rec_status,
      </if>
      <if test="interType != null" >
        inter_type,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=INTEGER},
      </if>
      <if test="companyLeader != null" >
        #{companyLeader,jdbcType=VARCHAR},
      </if>
      <if test="companyLeaderPhone != null" >
        #{companyLeaderPhone,jdbcType=VARCHAR},
      </if>
      <if test="companyName != null" >
        #{companyName,jdbcType=VARCHAR},
      </if>
      <if test="companyReferencenum != null" >
        #{companyReferencenum,jdbcType=VARCHAR},
      </if>
      <if test="companyOpenbank != null" >
        #{companyOpenbank,jdbcType=VARCHAR},
      </if>
      <if test="companyOpenbankAcc != null" >
        #{companyOpenbankAcc,jdbcType=VARCHAR},
      </if>
      <if test="companyAdress != null" >
        #{companyAdress,jdbcType=VARCHAR},
      </if>
      <if test="companyPhone != null" >
        #{companyPhone,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null" >
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="companyBelongName != null" >
        #{companyBelongName,jdbcType=VARCHAR},
      </if>
      <if test="recStatus != null" >
        #{recStatus,jdbcType=INTEGER},
      </if>
      <if test="interType != null" >
        #{interType,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
    update t_customer_rec
    <set >
      <if test="companyLeader != null" >
        company_leader = #{companyLeader,jdbcType=VARCHAR},
      </if>
      <if test="companyLeaderPhone != null" >
        company_leader_Phone = #{companyLeaderPhone,jdbcType=VARCHAR},
      </if>
      <if test="companyName != null" >
        company_name = #{companyName,jdbcType=VARCHAR},
      </if>
      <if test="companyReferencenum != null" >
        company_referenceNum = #{companyReferencenum,jdbcType=VARCHAR},
      </if>
      <if test="companyOpenbank != null" >
        company_openbank = #{companyOpenbank,jdbcType=VARCHAR},
      </if>
      <if test="companyOpenbankAcc != null" >
        company_openbank_acc = #{companyOpenbankAcc,jdbcType=VARCHAR},
      </if>
      <if test="companyAdress != null" >
        company_adress = #{companyAdress,jdbcType=VARCHAR},
      </if>
      <if test="companyPhone != null" >
        company_phone = #{companyPhone,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null" >
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="companyBelongName != null" >
        company_belong_name = #{companyBelongName,jdbcType=VARCHAR},
      </if>
      <if test="recStatus != null" >
        rec_status = #{recStatus,jdbcType=INTEGER},
      </if>
      <if test="interType != null" >
        inter_type = #{interType,jdbcType=INTEGER},
      </if>
      <if test="bussinessType != null" >
        bussiness_type = #{bussinessType,jdbcType=INTEGER},
      </if>
      <if test="companyType != null" >
        company_type = #{companyType,jdbcType=INTEGER},
      </if>
      <if test="operatingRangeType != null" >
        operating_rangeType = #{operatingRangeType,jdbcType=INTEGER},
      </if>
      <if test="companyNum != null" >
        company_num = #{companyNum,jdbcType=VARCHAR},
      </if>
      <if test="serviceStartTime != null" >
        service_startTime = #{serviceStartTime,jdbcType=VARCHAR},
      </if>
      <if test="serviceEndTime != null" >
        service_endTime = #{serviceEndTime,jdbcType=VARCHAR},
      </if>
      <if test="serviceType != null" >
        service_type = #{serviceType,jdbcType=INTEGER},
      </if>
      <if test="contractFileName != null" >
        contractFileName = #{contractFileName,jdbcType=VARCHAR},
      </if>
      <if test="base64Str != null" >
        base64Str = #{base64Str,jdbcType=VARCHAR},
      </if>
      <if test="contractSuc != null" >
        contractSuc = #{contractSuc,jdbcType=INTEGER},
      </if>
      <if test="contrantNum != null" >
        contrantNum = #{contrantNum,jdbcType=VARCHAR},
      </if>
      <if test="lowerFileName != null" >
        lowerFileName = #{lowerFileName,jdbcType=VARCHAR},
      </if>
      <if test="lowerBase64Str != null" >
        lowerBase64Str = #{lowerBase64Str,jdbcType=VARCHAR},
      </if>
      <if test="fileMessage != null" >
        fileMessage = #{fileMessage,jdbcType=VARCHAR},
      </if>
    </set>
    where  company_name = BINARY #{companyName,jdbcType=VARCHAR} and  bussiness_type = #{bussinessType,jdbcType=INTEGER} and company_referenceNum = #{companyReferencenum,jdbcType=VARCHAR}
  </update>




  <update id="updateByPrimaryKeySelectiveUpload" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
    update t_customer_rec
    <set >
      <if test="companyLeader != null" >
        company_leader = #{companyLeader,jdbcType=VARCHAR},
      </if>
      <if test="companyLeaderPhone != null" >
        company_leader_Phone = #{companyLeaderPhone,jdbcType=VARCHAR},
      </if>
      <if test="companyName != null" >
        company_name = #{companyName,jdbcType=VARCHAR},
      </if>
      <if test="companyReferencenum != null" >
        company_referenceNum = #{companyReferencenum,jdbcType=VARCHAR},
      </if>
      <if test="companyOpenbank != null" >
        company_openbank = #{companyOpenbank,jdbcType=VARCHAR},
      </if>
      <if test="companyOpenbankAcc != null" >
        company_openbank_acc = #{companyOpenbankAcc,jdbcType=VARCHAR},
      </if>
      <if test="companyAdress != null" >
        company_adress = #{companyAdress,jdbcType=VARCHAR},
      </if>
      <if test="companyPhone != null" >
        company_phone = #{companyPhone,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null" >
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="companyBelongName != null" >
        company_belong_name = #{companyBelongName,jdbcType=VARCHAR},
      </if>
      <if test="recStatus != null" >
        rec_status = #{recStatus,jdbcType=INTEGER},
      </if>
      <if test="interType != null" >
        inter_type = #{interType,jdbcType=INTEGER},
      </if>
      <if test="bussinessType != null" >
        bussiness_type = #{bussinessType,jdbcType=INTEGER},
      </if>
      <if test="companyType != null" >
        company_type = #{companyType,jdbcType=INTEGER},
      </if>
      <if test="operatingRangeType != null" >
        operating_rangeType = #{operatingRangeType,jdbcType=INTEGER},
      </if>
      <if test="companyNum != null" >
        company_num = #{companyNum,jdbcType=VARCHAR},
      </if>
      <if test="serviceStartTime != null" >
        service_startTime = #{serviceStartTime,jdbcType=VARCHAR},
      </if>
      <if test="serviceEndTime != null" >
        service_endTime = #{serviceEndTime,jdbcType=VARCHAR},
      </if>
      <if test="serviceType != null" >
        service_type = #{serviceType,jdbcType=INTEGER},
      </if>
      <if test="contractFileName != null" >
        contractFileName = #{contractFileName,jdbcType=VARCHAR},
      </if>
      <if test="base64Str != null" >
        base64Str = #{base64Str,jdbcType=VARCHAR},
      </if>
      <if test="contractSuc != null" >
        contractSuc = #{contractSuc,jdbcType=INTEGER},
      </if>
      <if test="contrantNum != null" >
        contrantNum = #{contrantNum,jdbcType=VARCHAR},
      </if>
      <if test="lowerFileName != null" >
        lowerFileName = #{lowerFileName,jdbcType=VARCHAR},
      </if>
      <if test="lowerBase64Str != null" >
        lowerBase64Str = #{lowerBase64Str,jdbcType=VARCHAR},
      </if>
      <if test="fileMessage != null" >
        fileMessage = #{fileMessage,jdbcType=VARCHAR},
      </if>
    </set>
    where  id = BINARY #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
  update t_customer_rec
  set company_leader = #{companyLeader,jdbcType=VARCHAR},
  company_leader_Phone = #{companyLeaderPhone,jdbcType=VARCHAR},
  company_name = #{companyName,jdbcType=VARCHAR},
  company_referenceNum = #{companyReferencenum,jdbcType=VARCHAR},
  company_openbank = #{companyOpenbank,jdbcType=VARCHAR},
  company_openbank_acc = #{companyOpenbankAcc,jdbcType=VARCHAR},
  company_adress = #{companyAdress,jdbcType=VARCHAR},
  company_phone = #{companyPhone,jdbcType=VARCHAR},
  createTime = #{createtime,jdbcType=TIMESTAMP},
  company_belong_name = #{companyBelongName,jdbcType=VARCHAR},
  rec_status = #{recStatus,jdbcType=INTEGER},
  inter_type = #{interType,jdbcType=INTEGER},
  bussiness_type = #{bussinessType,jdbcType=INTEGER},
  company_type = #{companyType,jdbcType=INTEGER},
  operating_rangeType = #{operatingRangeType,jdbcType=INTEGER},
  company_num = #{companyNum,jdbcType=VARCHAR},
  service_startTime = #{serviceStartTime,jdbcType=VARCHAR},
  service_endTime = #{serviceEndTime,jdbcType=VARCHAR},
  service_type = #{serviceType,jdbcType=INTEGER},
  contractFileName = #{contractFileName,jdbcType=VARCHAR},
  base64Str = #{base64Str,jdbcType=VARCHAR},
  contractSuc = #{contractSuc,jdbcType=INTEGER},
  contrantNum = #{contrantNum,jdbcType=VARCHAR}
  where id = #{id,jdbcType=INTEGER}
</update>
  <update id="updateByCompany" parameterType="com.jkcredit.invoice.model.entity.customer.CustomerRec" >
    update t_customer_rec
    set company_leader = #{companyLeader,jdbcType=VARCHAR},
    company_leader_Phone = #{companyLeaderPhone,jdbcType=VARCHAR},
    company_name = #{companyName,jdbcType=VARCHAR},
    company_referenceNum = #{companyReferencenum,jdbcType=VARCHAR},
    company_openbank = #{companyOpenbank,jdbcType=VARCHAR},
    company_openbank_acc = #{companyOpenbankAcc,jdbcType=VARCHAR},
    company_adress = #{companyAdress,jdbcType=VARCHAR},
    company_phone = #{companyPhone,jdbcType=VARCHAR},
    createTime = #{createtime,jdbcType=TIMESTAMP},
    company_belong_name = #{companyBelongName,jdbcType=VARCHAR},
    rec_status = #{recStatus,jdbcType=INTEGER},
    inter_type = #{interType,jdbcType=INTEGER},
    bussiness_type = #{bussinessType,jdbcType=INTEGER},
    company_type = #{companyType,jdbcType=INTEGER},
    operating_rangeType = #{operatingRangeType,jdbcType=INTEGER},
    company_num = #{companyNum,jdbcType=VARCHAR},
    service_startTime = #{serviceStartTime,jdbcType=VARCHAR},
    service_endTime = #{serviceEndTime,jdbcType=VARCHAR},
    service_type = #{serviceType,jdbcType=INTEGER},
    contractFileName = #{contractFileName,jdbcType=VARCHAR},
    base64Str = #{base64Str,jdbcType=VARCHAR},
    contractSuc = #{contractSuc,jdbcType=INTEGER},
    contrantNum = #{contrantNum,jdbcType=VARCHAR}
    where  company_name = BINARY #{companyName,jdbcType=VARCHAR} and bussiness_type = #{bussinessType,jdbcType=INTEGER} and company_referenceNum = #{companyReferencenum,jdbcType=VARCHAR}
  </update>
</mapper>