<?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="cn.superdesk.uniorder.dao.mapper.score.ScoreOrderMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.score.ScoreOrder">
    
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="order_sn" jdbcType="VARCHAR" property="orderSn" />
    <result column="order_sn_out_trade" jdbcType="VARCHAR" property="orderSnOutTrade" />
    <result column="service_name" jdbcType="VARCHAR" property="serviceName" />
    <result column="service_no" jdbcType="VARCHAR" property="serviceNo" />
    <result column="project_id" jdbcType="BIGINT" property="projectId" />
    <result column="project_name" jdbcType="VARCHAR" property="projectName" />
    <result column="purchase_virt_id" jdbcType="BIGINT" property="purchaseVirtId" />
    <result column="purchase_virt_name" jdbcType="VARCHAR" property="purchaseVirtName" />
    <result column="purchase_user_id" jdbcType="BIGINT" property="purchaseUserId" />
    <result column="purchase_user_name" jdbcType="VARCHAR" property="purchaseUserName" />
    <result column="purchase_phone" jdbcType="VARCHAR" property="purchasePhone" />
    <result column="sale_id" jdbcType="BIGINT" property="saleId" />
    <result column="sale_name" jdbcType="VARCHAR" property="saleName" />
    <result column="amount" jdbcType="DECIMAL" property="amount" />
    <result column="cost_amount" jdbcType="DECIMAL" property="costAmount" />
    <result column="transport_amount" jdbcType="DECIMAL" property="transportAmount" />
    <result column="complet_state" jdbcType="TINYINT" property="completState" />
    <result column="sale_account_state" jdbcType="TINYINT" property="saleAccountState" />
    <result column="account_state" jdbcType="TINYINT" property="accountState" />
    <result column="payment_type" jdbcType="TINYINT" property="paymentType" />
    <result column="pay_state" jdbcType="TINYINT" property="payState" />
    <result column="order_state" jdbcType="TINYINT" property="orderState" />
    <result column="order_state_name" jdbcType="VARCHAR" property="orderStateName" />
    <result column="settlement_type" jdbcType="TINYINT" property="settlementType" />
    <result column="appraise_state" jdbcType="TINYINT" property="appraiseState" />
    <result column="source_channel" jdbcType="TINYINT" property="sourceChannel" />
    <result column="other_params" jdbcType="VARCHAR" property="otherParams" />
    <result column="user_type" jdbcType="VARCHAR" property="userType" />
    <result column="user_name" jdbcType="VARCHAR" property="userName" />
    <result column="inv_state" jdbcType="TINYINT" property="invState" />
    <result column="inv_number" jdbcType="VARCHAR" property="invNumber" />
    <result column="inv_sn" jdbcType="VARCHAR" property="invSn" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_user_id" jdbcType="BIGINT" property="createUserId" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="update_user_id" jdbcType="BIGINT" property="updateUserId" />
    <result column="rec_userid" jdbcType="BIGINT" property="recUserid" />
    <result column="rec_user_name" jdbcType="VARCHAR" property="recUserName" />
    <result column="rec_user_phone" jdbcType="VARCHAR" property="recUserPhone" />
    <result column="rec_address" jdbcType="VARCHAR" property="recAddress" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  </resultMap>
  <sql id="Example_Where_Clause">
    
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    
    id, order_sn, order_sn_out_trade, service_name, service_no, project_id, project_name, 
    purchase_virt_id, purchase_virt_name, purchase_user_id, purchase_user_name, purchase_phone, 
    sale_id, sale_name, amount, cost_amount, transport_amount, complet_state, sale_account_state, 
    account_state, payment_type, pay_state, order_state, order_state_name, settlement_type, 
    appraise_state, source_channel, other_params, user_type, user_name, inv_state, inv_number, 
    inv_sn, create_time, create_user_id, update_time, update_user_id, rec_userid, rec_user_name, 
    rec_user_phone, rec_address, remarks
  </sql>
  <select id="selectByExample" parameterType="cn.superdesk.uniorder.dao.entity.score.ScoreOrderExample" resultMap="BaseResultMap">
    
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from score_order
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    
    select 
    <include refid="Base_Column_List" />
    from score_order
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    
    delete from score_order
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.score.ScoreOrderExample">
    
    delete from score_order
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.score.ScoreOrder">
    
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into score_order (order_sn, order_sn_out_trade, service_name, 
      service_no, project_id, project_name, 
      purchase_virt_id, purchase_virt_name, purchase_user_id, 
      purchase_user_name, purchase_phone, sale_id, 
      sale_name, amount, cost_amount, 
      transport_amount, complet_state, sale_account_state, 
      account_state, payment_type, pay_state, 
      order_state, order_state_name, settlement_type, 
      appraise_state, source_channel, other_params, 
      user_type, user_name, inv_state, 
      inv_number, inv_sn, create_time, 
      create_user_id, update_time, update_user_id, 
      rec_userid, rec_user_name, rec_user_phone, 
      rec_address, remarks)
    values (#{orderSn,jdbcType=VARCHAR}, #{orderSnOutTrade,jdbcType=VARCHAR}, #{serviceName,jdbcType=VARCHAR}, 
      #{serviceNo,jdbcType=VARCHAR}, #{projectId,jdbcType=BIGINT}, #{projectName,jdbcType=VARCHAR}, 
      #{purchaseVirtId,jdbcType=BIGINT}, #{purchaseVirtName,jdbcType=VARCHAR}, #{purchaseUserId,jdbcType=BIGINT}, 
      #{purchaseUserName,jdbcType=VARCHAR}, #{purchasePhone,jdbcType=VARCHAR}, #{saleId,jdbcType=BIGINT}, 
      #{saleName,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{costAmount,jdbcType=DECIMAL}, 
      #{transportAmount,jdbcType=DECIMAL}, #{completState,jdbcType=TINYINT}, #{saleAccountState,jdbcType=TINYINT}, 
      #{accountState,jdbcType=TINYINT}, #{paymentType,jdbcType=TINYINT}, #{payState,jdbcType=TINYINT}, 
      #{orderState,jdbcType=TINYINT}, #{orderStateName,jdbcType=VARCHAR}, #{settlementType,jdbcType=TINYINT}, 
      #{appraiseState,jdbcType=TINYINT}, #{sourceChannel,jdbcType=TINYINT}, #{otherParams,jdbcType=VARCHAR}, 
      #{userType,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{invState,jdbcType=TINYINT}, 
      #{invNumber,jdbcType=VARCHAR}, #{invSn,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{createUserId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{updateUserId,jdbcType=BIGINT}, 
      #{recUserid,jdbcType=BIGINT}, #{recUserName,jdbcType=VARCHAR}, #{recUserPhone,jdbcType=VARCHAR}, 
      #{recAddress,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.score.ScoreOrder">
    
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into score_order
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="orderSn != null">
        order_sn,
      </if>
      <if test="orderSnOutTrade != null">
        order_sn_out_trade,
      </if>
      <if test="serviceName != null">
        service_name,
      </if>
      <if test="serviceNo != null">
        service_no,
      </if>
      <if test="projectId != null">
        project_id,
      </if>
      <if test="projectName != null">
        project_name,
      </if>
      <if test="purchaseVirtId != null">
        purchase_virt_id,
      </if>
      <if test="purchaseVirtName != null">
        purchase_virt_name,
      </if>
      <if test="purchaseUserId != null">
        purchase_user_id,
      </if>
      <if test="purchaseUserName != null">
        purchase_user_name,
      </if>
      <if test="purchasePhone != null">
        purchase_phone,
      </if>
      <if test="saleId != null">
        sale_id,
      </if>
      <if test="saleName != null">
        sale_name,
      </if>
      <if test="amount != null">
        amount,
      </if>
      <if test="costAmount != null">
        cost_amount,
      </if>
      <if test="transportAmount != null">
        transport_amount,
      </if>
      <if test="completState != null">
        complet_state,
      </if>
      <if test="saleAccountState != null">
        sale_account_state,
      </if>
      <if test="accountState != null">
        account_state,
      </if>
      <if test="paymentType != null">
        payment_type,
      </if>
      <if test="payState != null">
        pay_state,
      </if>
      <if test="orderState != null">
        order_state,
      </if>
      <if test="orderStateName != null">
        order_state_name,
      </if>
      <if test="settlementType != null">
        settlement_type,
      </if>
      <if test="appraiseState != null">
        appraise_state,
      </if>
      <if test="sourceChannel != null">
        source_channel,
      </if>
      <if test="otherParams != null">
        other_params,
      </if>
      <if test="userType != null">
        user_type,
      </if>
      <if test="userName != null">
        user_name,
      </if>
      <if test="invState != null">
        inv_state,
      </if>
      <if test="invNumber != null">
        inv_number,
      </if>
      <if test="invSn != null">
        inv_sn,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="createUserId != null">
        create_user_id,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="updateUserId != null">
        update_user_id,
      </if>
      <if test="recUserid != null">
        rec_userid,
      </if>
      <if test="recUserName != null">
        rec_user_name,
      </if>
      <if test="recUserPhone != null">
        rec_user_phone,
      </if>
      <if test="recAddress != null">
        rec_address,
      </if>
      <if test="remarks != null">
        remarks,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="orderSn != null">
        #{orderSn,jdbcType=VARCHAR},
      </if>
      <if test="orderSnOutTrade != null">
        #{orderSnOutTrade,jdbcType=VARCHAR},
      </if>
      <if test="serviceName != null">
        #{serviceName,jdbcType=VARCHAR},
      </if>
      <if test="serviceNo != null">
        #{serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="projectId != null">
        #{projectId,jdbcType=BIGINT},
      </if>
      <if test="projectName != null">
        #{projectName,jdbcType=VARCHAR},
      </if>
      <if test="purchaseVirtId != null">
        #{purchaseVirtId,jdbcType=BIGINT},
      </if>
      <if test="purchaseVirtName != null">
        #{purchaseVirtName,jdbcType=VARCHAR},
      </if>
      <if test="purchaseUserId != null">
        #{purchaseUserId,jdbcType=BIGINT},
      </if>
      <if test="purchaseUserName != null">
        #{purchaseUserName,jdbcType=VARCHAR},
      </if>
      <if test="purchasePhone != null">
        #{purchasePhone,jdbcType=VARCHAR},
      </if>
      <if test="saleId != null">
        #{saleId,jdbcType=BIGINT},
      </if>
      <if test="saleName != null">
        #{saleName,jdbcType=VARCHAR},
      </if>
      <if test="amount != null">
        #{amount,jdbcType=DECIMAL},
      </if>
      <if test="costAmount != null">
        #{costAmount,jdbcType=DECIMAL},
      </if>
      <if test="transportAmount != null">
        #{transportAmount,jdbcType=DECIMAL},
      </if>
      <if test="completState != null">
        #{completState,jdbcType=TINYINT},
      </if>
      <if test="saleAccountState != null">
        #{saleAccountState,jdbcType=TINYINT},
      </if>
      <if test="accountState != null">
        #{accountState,jdbcType=TINYINT},
      </if>
      <if test="paymentType != null">
        #{paymentType,jdbcType=TINYINT},
      </if>
      <if test="payState != null">
        #{payState,jdbcType=TINYINT},
      </if>
      <if test="orderState != null">
        #{orderState,jdbcType=TINYINT},
      </if>
      <if test="orderStateName != null">
        #{orderStateName,jdbcType=VARCHAR},
      </if>
      <if test="settlementType != null">
        #{settlementType,jdbcType=TINYINT},
      </if>
      <if test="appraiseState != null">
        #{appraiseState,jdbcType=TINYINT},
      </if>
      <if test="sourceChannel != null">
        #{sourceChannel,jdbcType=TINYINT},
      </if>
      <if test="otherParams != null">
        #{otherParams,jdbcType=VARCHAR},
      </if>
      <if test="userType != null">
        #{userType,jdbcType=VARCHAR},
      </if>
      <if test="userName != null">
        #{userName,jdbcType=VARCHAR},
      </if>
      <if test="invState != null">
        #{invState,jdbcType=TINYINT},
      </if>
      <if test="invNumber != null">
        #{invNumber,jdbcType=VARCHAR},
      </if>
      <if test="invSn != null">
        #{invSn,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        #{updateUserId,jdbcType=BIGINT},
      </if>
      <if test="recUserid != null">
        #{recUserid,jdbcType=BIGINT},
      </if>
      <if test="recUserName != null">
        #{recUserName,jdbcType=VARCHAR},
      </if>
      <if test="recUserPhone != null">
        #{recUserPhone,jdbcType=VARCHAR},
      </if>
      <if test="recAddress != null">
        #{recAddress,jdbcType=VARCHAR},
      </if>
      <if test="remarks != null">
        #{remarks,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.score.ScoreOrderExample" resultType="java.lang.Long">
    
    select count(*) from score_order
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    
    update score_order
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.orderSn != null">
        order_sn = #{record.orderSn,jdbcType=VARCHAR},
      </if>
      <if test="record.orderSnOutTrade != null">
        order_sn_out_trade = #{record.orderSnOutTrade,jdbcType=VARCHAR},
      </if>
      <if test="record.serviceName != null">
        service_name = #{record.serviceName,jdbcType=VARCHAR},
      </if>
      <if test="record.serviceNo != null">
        service_no = #{record.serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="record.projectId != null">
        project_id = #{record.projectId,jdbcType=BIGINT},
      </if>
      <if test="record.projectName != null">
        project_name = #{record.projectName,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseVirtId != null">
        purchase_virt_id = #{record.purchaseVirtId,jdbcType=BIGINT},
      </if>
      <if test="record.purchaseVirtName != null">
        purchase_virt_name = #{record.purchaseVirtName,jdbcType=VARCHAR},
      </if>
      <if test="record.purchaseUserId != null">
        purchase_user_id = #{record.purchaseUserId,jdbcType=BIGINT},
      </if>
      <if test="record.purchaseUserName != null">
        purchase_user_name = #{record.purchaseUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.purchasePhone != null">
        purchase_phone = #{record.purchasePhone,jdbcType=VARCHAR},
      </if>
      <if test="record.saleId != null">
        sale_id = #{record.saleId,jdbcType=BIGINT},
      </if>
      <if test="record.saleName != null">
        sale_name = #{record.saleName,jdbcType=VARCHAR},
      </if>
      <if test="record.amount != null">
        amount = #{record.amount,jdbcType=DECIMAL},
      </if>
      <if test="record.costAmount != null">
        cost_amount = #{record.costAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.transportAmount != null">
        transport_amount = #{record.transportAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.completState != null">
        complet_state = #{record.completState,jdbcType=TINYINT},
      </if>
      <if test="record.saleAccountState != null">
        sale_account_state = #{record.saleAccountState,jdbcType=TINYINT},
      </if>
      <if test="record.accountState != null">
        account_state = #{record.accountState,jdbcType=TINYINT},
      </if>
      <if test="record.paymentType != null">
        payment_type = #{record.paymentType,jdbcType=TINYINT},
      </if>
      <if test="record.payState != null">
        pay_state = #{record.payState,jdbcType=TINYINT},
      </if>
      <if test="record.orderState != null">
        order_state = #{record.orderState,jdbcType=TINYINT},
      </if>
      <if test="record.orderStateName != null">
        order_state_name = #{record.orderStateName,jdbcType=VARCHAR},
      </if>
      <if test="record.settlementType != null">
        settlement_type = #{record.settlementType,jdbcType=TINYINT},
      </if>
      <if test="record.appraiseState != null">
        appraise_state = #{record.appraiseState,jdbcType=TINYINT},
      </if>
      <if test="record.sourceChannel != null">
        source_channel = #{record.sourceChannel,jdbcType=TINYINT},
      </if>
      <if test="record.otherParams != null">
        other_params = #{record.otherParams,jdbcType=VARCHAR},
      </if>
      <if test="record.userType != null">
        user_type = #{record.userType,jdbcType=VARCHAR},
      </if>
      <if test="record.userName != null">
        user_name = #{record.userName,jdbcType=VARCHAR},
      </if>
      <if test="record.invState != null">
        inv_state = #{record.invState,jdbcType=TINYINT},
      </if>
      <if test="record.invNumber != null">
        inv_number = #{record.invNumber,jdbcType=VARCHAR},
      </if>
      <if test="record.invSn != null">
        inv_sn = #{record.invSn,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createUserId != null">
        create_user_id = #{record.createUserId,jdbcType=BIGINT},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateUserId != null">
        update_user_id = #{record.updateUserId,jdbcType=BIGINT},
      </if>
      <if test="record.recUserid != null">
        rec_userid = #{record.recUserid,jdbcType=BIGINT},
      </if>
      <if test="record.recUserName != null">
        rec_user_name = #{record.recUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.recUserPhone != null">
        rec_user_phone = #{record.recUserPhone,jdbcType=VARCHAR},
      </if>
      <if test="record.recAddress != null">
        rec_address = #{record.recAddress,jdbcType=VARCHAR},
      </if>
      <if test="record.remarks != null">
        remarks = #{record.remarks,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    
    update score_order
    set id = #{record.id,jdbcType=BIGINT},
      order_sn = #{record.orderSn,jdbcType=VARCHAR},
      order_sn_out_trade = #{record.orderSnOutTrade,jdbcType=VARCHAR},
      service_name = #{record.serviceName,jdbcType=VARCHAR},
      service_no = #{record.serviceNo,jdbcType=VARCHAR},
      project_id = #{record.projectId,jdbcType=BIGINT},
      project_name = #{record.projectName,jdbcType=VARCHAR},
      purchase_virt_id = #{record.purchaseVirtId,jdbcType=BIGINT},
      purchase_virt_name = #{record.purchaseVirtName,jdbcType=VARCHAR},
      purchase_user_id = #{record.purchaseUserId,jdbcType=BIGINT},
      purchase_user_name = #{record.purchaseUserName,jdbcType=VARCHAR},
      purchase_phone = #{record.purchasePhone,jdbcType=VARCHAR},
      sale_id = #{record.saleId,jdbcType=BIGINT},
      sale_name = #{record.saleName,jdbcType=VARCHAR},
      amount = #{record.amount,jdbcType=DECIMAL},
      cost_amount = #{record.costAmount,jdbcType=DECIMAL},
      transport_amount = #{record.transportAmount,jdbcType=DECIMAL},
      complet_state = #{record.completState,jdbcType=TINYINT},
      sale_account_state = #{record.saleAccountState,jdbcType=TINYINT},
      account_state = #{record.accountState,jdbcType=TINYINT},
      payment_type = #{record.paymentType,jdbcType=TINYINT},
      pay_state = #{record.payState,jdbcType=TINYINT},
      order_state = #{record.orderState,jdbcType=TINYINT},
      order_state_name = #{record.orderStateName,jdbcType=VARCHAR},
      settlement_type = #{record.settlementType,jdbcType=TINYINT},
      appraise_state = #{record.appraiseState,jdbcType=TINYINT},
      source_channel = #{record.sourceChannel,jdbcType=TINYINT},
      other_params = #{record.otherParams,jdbcType=VARCHAR},
      user_type = #{record.userType,jdbcType=VARCHAR},
      user_name = #{record.userName,jdbcType=VARCHAR},
      inv_state = #{record.invState,jdbcType=TINYINT},
      inv_number = #{record.invNumber,jdbcType=VARCHAR},
      inv_sn = #{record.invSn,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      create_user_id = #{record.createUserId,jdbcType=BIGINT},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{record.updateUserId,jdbcType=BIGINT},
      rec_userid = #{record.recUserid,jdbcType=BIGINT},
      rec_user_name = #{record.recUserName,jdbcType=VARCHAR},
      rec_user_phone = #{record.recUserPhone,jdbcType=VARCHAR},
      rec_address = #{record.recAddress,jdbcType=VARCHAR},
      remarks = #{record.remarks,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.score.ScoreOrder">
    
    update score_order
    <set>
      <if test="orderSn != null">
        order_sn = #{orderSn,jdbcType=VARCHAR},
      </if>
      <if test="orderSnOutTrade != null">
        order_sn_out_trade = #{orderSnOutTrade,jdbcType=VARCHAR},
      </if>
      <if test="serviceName != null">
        service_name = #{serviceName,jdbcType=VARCHAR},
      </if>
      <if test="serviceNo != null">
        service_no = #{serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="projectId != null">
        project_id = #{projectId,jdbcType=BIGINT},
      </if>
      <if test="projectName != null">
        project_name = #{projectName,jdbcType=VARCHAR},
      </if>
      <if test="purchaseVirtId != null">
        purchase_virt_id = #{purchaseVirtId,jdbcType=BIGINT},
      </if>
      <if test="purchaseVirtName != null">
        purchase_virt_name = #{purchaseVirtName,jdbcType=VARCHAR},
      </if>
      <if test="purchaseUserId != null">
        purchase_user_id = #{purchaseUserId,jdbcType=BIGINT},
      </if>
      <if test="purchaseUserName != null">
        purchase_user_name = #{purchaseUserName,jdbcType=VARCHAR},
      </if>
      <if test="purchasePhone != null">
        purchase_phone = #{purchasePhone,jdbcType=VARCHAR},
      </if>
      <if test="saleId != null">
        sale_id = #{saleId,jdbcType=BIGINT},
      </if>
      <if test="saleName != null">
        sale_name = #{saleName,jdbcType=VARCHAR},
      </if>
      <if test="amount != null">
        amount = #{amount,jdbcType=DECIMAL},
      </if>
      <if test="costAmount != null">
        cost_amount = #{costAmount,jdbcType=DECIMAL},
      </if>
      <if test="transportAmount != null">
        transport_amount = #{transportAmount,jdbcType=DECIMAL},
      </if>
      <if test="completState != null">
        complet_state = #{completState,jdbcType=TINYINT},
      </if>
      <if test="saleAccountState != null">
        sale_account_state = #{saleAccountState,jdbcType=TINYINT},
      </if>
      <if test="accountState != null">
        account_state = #{accountState,jdbcType=TINYINT},
      </if>
      <if test="paymentType != null">
        payment_type = #{paymentType,jdbcType=TINYINT},
      </if>
      <if test="payState != null">
        pay_state = #{payState,jdbcType=TINYINT},
      </if>
      <if test="orderState != null">
        order_state = #{orderState,jdbcType=TINYINT},
      </if>
      <if test="orderStateName != null">
        order_state_name = #{orderStateName,jdbcType=VARCHAR},
      </if>
      <if test="settlementType != null">
        settlement_type = #{settlementType,jdbcType=TINYINT},
      </if>
      <if test="appraiseState != null">
        appraise_state = #{appraiseState,jdbcType=TINYINT},
      </if>
      <if test="sourceChannel != null">
        source_channel = #{sourceChannel,jdbcType=TINYINT},
      </if>
      <if test="otherParams != null">
        other_params = #{otherParams,jdbcType=VARCHAR},
      </if>
      <if test="userType != null">
        user_type = #{userType,jdbcType=VARCHAR},
      </if>
      <if test="userName != null">
        user_name = #{userName,jdbcType=VARCHAR},
      </if>
      <if test="invState != null">
        inv_state = #{invState,jdbcType=TINYINT},
      </if>
      <if test="invNumber != null">
        inv_number = #{invNumber,jdbcType=VARCHAR},
      </if>
      <if test="invSn != null">
        inv_sn = #{invSn,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        create_user_id = #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        update_user_id = #{updateUserId,jdbcType=BIGINT},
      </if>
      <if test="recUserid != null">
        rec_userid = #{recUserid,jdbcType=BIGINT},
      </if>
      <if test="recUserName != null">
        rec_user_name = #{recUserName,jdbcType=VARCHAR},
      </if>
      <if test="recUserPhone != null">
        rec_user_phone = #{recUserPhone,jdbcType=VARCHAR},
      </if>
      <if test="recAddress != null">
        rec_address = #{recAddress,jdbcType=VARCHAR},
      </if>
      <if test="remarks != null">
        remarks = #{remarks,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.score.ScoreOrder">
    
    update score_order
    set order_sn = #{orderSn,jdbcType=VARCHAR},
      order_sn_out_trade = #{orderSnOutTrade,jdbcType=VARCHAR},
      service_name = #{serviceName,jdbcType=VARCHAR},
      service_no = #{serviceNo,jdbcType=VARCHAR},
      project_id = #{projectId,jdbcType=BIGINT},
      project_name = #{projectName,jdbcType=VARCHAR},
      purchase_virt_id = #{purchaseVirtId,jdbcType=BIGINT},
      purchase_virt_name = #{purchaseVirtName,jdbcType=VARCHAR},
      purchase_user_id = #{purchaseUserId,jdbcType=BIGINT},
      purchase_user_name = #{purchaseUserName,jdbcType=VARCHAR},
      purchase_phone = #{purchasePhone,jdbcType=VARCHAR},
      sale_id = #{saleId,jdbcType=BIGINT},
      sale_name = #{saleName,jdbcType=VARCHAR},
      amount = #{amount,jdbcType=DECIMAL},
      cost_amount = #{costAmount,jdbcType=DECIMAL},
      transport_amount = #{transportAmount,jdbcType=DECIMAL},
      complet_state = #{completState,jdbcType=TINYINT},
      sale_account_state = #{saleAccountState,jdbcType=TINYINT},
      account_state = #{accountState,jdbcType=TINYINT},
      payment_type = #{paymentType,jdbcType=TINYINT},
      pay_state = #{payState,jdbcType=TINYINT},
      order_state = #{orderState,jdbcType=TINYINT},
      order_state_name = #{orderStateName,jdbcType=VARCHAR},
      settlement_type = #{settlementType,jdbcType=TINYINT},
      appraise_state = #{appraiseState,jdbcType=TINYINT},
      source_channel = #{sourceChannel,jdbcType=TINYINT},
      other_params = #{otherParams,jdbcType=VARCHAR},
      user_type = #{userType,jdbcType=VARCHAR},
      user_name = #{userName,jdbcType=VARCHAR},
      inv_state = #{invState,jdbcType=TINYINT},
      inv_number = #{invNumber,jdbcType=VARCHAR},
      inv_sn = #{invSn,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_user_id = #{createUserId,jdbcType=BIGINT},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{updateUserId,jdbcType=BIGINT},
      rec_userid = #{recUserid,jdbcType=BIGINT},
      rec_user_name = #{recUserName,jdbcType=VARCHAR},
      rec_user_phone = #{recUserPhone,jdbcType=VARCHAR},
      rec_address = #{recAddress,jdbcType=VARCHAR},
      remarks = #{remarks,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>