<?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._statistics.StReceivableDayDataEntityMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.statistics.receivable.StReceivableDayDataEntity">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="pertain_month" jdbcType="VARCHAR" property="pertainMonth" />
    <result column="account_at" jdbcType="TIMESTAMP" property="accountAt" />
    <result column="account_type" jdbcType="TINYINT" property="accountType" />
    <result column="credit_id" jdbcType="BIGINT" property="creditId" />
    <result column="settlement_id" jdbcType="BIGINT" property="settlementId" />
    <result column="settlement_name" jdbcType="VARCHAR" property="settlementName" />
    <result column="credit_type" jdbcType="TINYINT" property="creditType" />
    <result column="credit_name" jdbcType="VARCHAR" property="creditName" />
    <result column="operation_tax_rate" jdbcType="DECIMAL" property="operationTaxRate" />
    <result column="income_no_tax" jdbcType="DECIMAL" property="incomeNoTax" />
    <result column="tax_amount" jdbcType="DECIMAL" property="taxAmount" />
    <result column="receivable_amount" jdbcType="DECIMAL" property="receivableAmount" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="create_user_name" jdbcType="VARCHAR" property="createUserName" />
    <result column="create_user_id" jdbcType="BIGINT" property="createUserId" />
    <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
    <result column="update_user_name" jdbcType="VARCHAR" property="updateUserName" />
    <result column="update_user_id" jdbcType="BIGINT" property="updateUserId" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="detail_id" jdbcType="VARCHAR" property="detailId" />
    <result column="service_no" jdbcType="VARCHAR" property="serviceNo" />
    <result column="service_no_name" jdbcType="VARCHAR" property="serviceNoName" />
    <result column="account_way" jdbcType="TINYINT" property="accountWay" />
    <result column="accounting_order_sn" jdbcType="VARCHAR" property="accountingOrderSn" />
  </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, pertain_month, account_at, account_type, credit_id, settlement_id, settlement_name, 
    credit_type, credit_name, operation_tax_rate, income_no_tax, tax_amount, receivable_amount, 
    remark, create_user_name, create_user_id, created_at, update_user_name, update_user_id, 
    update_time, detail_id, service_no, service_no_name, account_way, accounting_order_sn
  </sql>
  <select id="selectByExample" parameterType="cn.superdesk.uniorder.dao.entity.statistics.receivable.StReceivableDayDataEntityExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from st_receivable_day_data
    <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 st_receivable_day_data
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from st_receivable_day_data
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.statistics.receivable.StReceivableDayDataEntityExample">
    delete from st_receivable_day_data
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.statistics.receivable.StReceivableDayDataEntity">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into st_receivable_day_data (id, pertain_month, account_at, 
      account_type, credit_id, settlement_id, 
      settlement_name, credit_type, credit_name, 
      operation_tax_rate, income_no_tax, tax_amount, 
      receivable_amount, remark, create_user_name, 
      create_user_id, created_at, update_user_name, 
      update_user_id, update_time, detail_id, 
      service_no, service_no_name, account_way, 
      accounting_order_sn)
    values (#{id,jdbcType=BIGINT}, #{pertainMonth,jdbcType=VARCHAR}, #{accountAt,jdbcType=TIMESTAMP}, 
      #{accountType,jdbcType=TINYINT}, #{creditId,jdbcType=BIGINT}, #{settlementId,jdbcType=BIGINT}, 
      #{settlementName,jdbcType=VARCHAR}, #{creditType,jdbcType=TINYINT}, #{creditName,jdbcType=VARCHAR}, 
      #{operationTaxRate,jdbcType=DECIMAL}, #{incomeNoTax,jdbcType=DECIMAL}, #{taxAmount,jdbcType=DECIMAL}, 
      #{receivableAmount,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, #{createUserName,jdbcType=VARCHAR}, 
      #{createUserId,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updateUserName,jdbcType=VARCHAR}, 
      #{updateUserId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{detailId,jdbcType=VARCHAR}, 
      #{serviceNo,jdbcType=VARCHAR}, #{serviceNoName,jdbcType=VARCHAR}, #{accountWay,jdbcType=TINYINT}, 
      #{accountingOrderSn,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.statistics.receivable.StReceivableDayDataEntity">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into st_receivable_day_data
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="pertainMonth != null">
        pertain_month,
      </if>
      <if test="accountAt != null">
        account_at,
      </if>
      <if test="accountType != null">
        account_type,
      </if>
      <if test="creditId != null">
        credit_id,
      </if>
      <if test="settlementId != null">
        settlement_id,
      </if>
      <if test="settlementName != null">
        settlement_name,
      </if>
      <if test="creditType != null">
        credit_type,
      </if>
      <if test="creditName != null">
        credit_name,
      </if>
      <if test="operationTaxRate != null">
        operation_tax_rate,
      </if>
      <if test="incomeNoTax != null">
        income_no_tax,
      </if>
      <if test="taxAmount != null">
        tax_amount,
      </if>
      <if test="receivableAmount != null">
        receivable_amount,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="createUserName != null">
        create_user_name,
      </if>
      <if test="createUserId != null">
        create_user_id,
      </if>
      <if test="createdAt != null">
        created_at,
      </if>
      <if test="updateUserName != null">
        update_user_name,
      </if>
      <if test="updateUserId != null">
        update_user_id,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="detailId != null">
        detail_id,
      </if>
      <if test="serviceNo != null">
        service_no,
      </if>
      <if test="serviceNoName != null">
        service_no_name,
      </if>
      <if test="accountWay != null">
        account_way,
      </if>
      <if test="accountingOrderSn != null">
        accounting_order_sn,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="pertainMonth != null">
        #{pertainMonth,jdbcType=VARCHAR},
      </if>
      <if test="accountAt != null">
        #{accountAt,jdbcType=TIMESTAMP},
      </if>
      <if test="accountType != null">
        #{accountType,jdbcType=TINYINT},
      </if>
      <if test="creditId != null">
        #{creditId,jdbcType=BIGINT},
      </if>
      <if test="settlementId != null">
        #{settlementId,jdbcType=BIGINT},
      </if>
      <if test="settlementName != null">
        #{settlementName,jdbcType=VARCHAR},
      </if>
      <if test="creditType != null">
        #{creditType,jdbcType=TINYINT},
      </if>
      <if test="creditName != null">
        #{creditName,jdbcType=VARCHAR},
      </if>
      <if test="operationTaxRate != null">
        #{operationTaxRate,jdbcType=DECIMAL},
      </if>
      <if test="incomeNoTax != null">
        #{incomeNoTax,jdbcType=DECIMAL},
      </if>
      <if test="taxAmount != null">
        #{taxAmount,jdbcType=DECIMAL},
      </if>
      <if test="receivableAmount != null">
        #{receivableAmount,jdbcType=DECIMAL},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="createUserName != null">
        #{createUserName,jdbcType=VARCHAR},
      </if>
      <if test="createUserId != null">
        #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="createdAt != null">
        #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserName != null">
        #{updateUserName,jdbcType=VARCHAR},
      </if>
      <if test="updateUserId != null">
        #{updateUserId,jdbcType=BIGINT},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="detailId != null">
        #{detailId,jdbcType=VARCHAR},
      </if>
      <if test="serviceNo != null">
        #{serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="serviceNoName != null">
        #{serviceNoName,jdbcType=VARCHAR},
      </if>
      <if test="accountWay != null">
        #{accountWay,jdbcType=TINYINT},
      </if>
      <if test="accountingOrderSn != null">
        #{accountingOrderSn,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.statistics.receivable.StReceivableDayDataEntityExample" resultType="java.lang.Long">
    select count(*) from st_receivable_day_data
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update st_receivable_day_data
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.pertainMonth != null">
        pertain_month = #{record.pertainMonth,jdbcType=VARCHAR},
      </if>
      <if test="record.accountAt != null">
        account_at = #{record.accountAt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.accountType != null">
        account_type = #{record.accountType,jdbcType=TINYINT},
      </if>
      <if test="record.creditId != null">
        credit_id = #{record.creditId,jdbcType=BIGINT},
      </if>
      <if test="record.settlementId != null">
        settlement_id = #{record.settlementId,jdbcType=BIGINT},
      </if>
      <if test="record.settlementName != null">
        settlement_name = #{record.settlementName,jdbcType=VARCHAR},
      </if>
      <if test="record.creditType != null">
        credit_type = #{record.creditType,jdbcType=TINYINT},
      </if>
      <if test="record.creditName != null">
        credit_name = #{record.creditName,jdbcType=VARCHAR},
      </if>
      <if test="record.operationTaxRate != null">
        operation_tax_rate = #{record.operationTaxRate,jdbcType=DECIMAL},
      </if>
      <if test="record.incomeNoTax != null">
        income_no_tax = #{record.incomeNoTax,jdbcType=DECIMAL},
      </if>
      <if test="record.taxAmount != null">
        tax_amount = #{record.taxAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.receivableAmount != null">
        receivable_amount = #{record.receivableAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
      <if test="record.createUserName != null">
        create_user_name = #{record.createUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.createUserId != null">
        create_user_id = #{record.createUserId,jdbcType=BIGINT},
      </if>
      <if test="record.createdAt != null">
        created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateUserName != null">
        update_user_name = #{record.updateUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.updateUserId != null">
        update_user_id = #{record.updateUserId,jdbcType=BIGINT},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.detailId != null">
        detail_id = #{record.detailId,jdbcType=VARCHAR},
      </if>
      <if test="record.serviceNo != null">
        service_no = #{record.serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="record.serviceNoName != null">
        service_no_name = #{record.serviceNoName,jdbcType=VARCHAR},
      </if>
      <if test="record.accountWay != null">
        account_way = #{record.accountWay,jdbcType=TINYINT},
      </if>
      <if test="record.accountingOrderSn != null">
        accounting_order_sn = #{record.accountingOrderSn,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update st_receivable_day_data
    set id = #{record.id,jdbcType=BIGINT},
      pertain_month = #{record.pertainMonth,jdbcType=VARCHAR},
      account_at = #{record.accountAt,jdbcType=TIMESTAMP},
      account_type = #{record.accountType,jdbcType=TINYINT},
      credit_id = #{record.creditId,jdbcType=BIGINT},
      settlement_id = #{record.settlementId,jdbcType=BIGINT},
      settlement_name = #{record.settlementName,jdbcType=VARCHAR},
      credit_type = #{record.creditType,jdbcType=TINYINT},
      credit_name = #{record.creditName,jdbcType=VARCHAR},
      operation_tax_rate = #{record.operationTaxRate,jdbcType=DECIMAL},
      income_no_tax = #{record.incomeNoTax,jdbcType=DECIMAL},
      tax_amount = #{record.taxAmount,jdbcType=DECIMAL},
      receivable_amount = #{record.receivableAmount,jdbcType=DECIMAL},
      remark = #{record.remark,jdbcType=VARCHAR},
      create_user_name = #{record.createUserName,jdbcType=VARCHAR},
      create_user_id = #{record.createUserId,jdbcType=BIGINT},
      created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      update_user_name = #{record.updateUserName,jdbcType=VARCHAR},
      update_user_id = #{record.updateUserId,jdbcType=BIGINT},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      detail_id = #{record.detailId,jdbcType=VARCHAR},
      service_no = #{record.serviceNo,jdbcType=VARCHAR},
      service_no_name = #{record.serviceNoName,jdbcType=VARCHAR},
      account_way = #{record.accountWay,jdbcType=TINYINT},
      accounting_order_sn = #{record.accountingOrderSn,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.statistics.receivable.StReceivableDayDataEntity">
    update st_receivable_day_data
    <set>
      <if test="pertainMonth != null">
        pertain_month = #{pertainMonth,jdbcType=VARCHAR},
      </if>
      <if test="accountAt != null">
        account_at = #{accountAt,jdbcType=TIMESTAMP},
      </if>
      <if test="accountType != null">
        account_type = #{accountType,jdbcType=TINYINT},
      </if>
      <if test="creditId != null">
        credit_id = #{creditId,jdbcType=BIGINT},
      </if>
      <if test="settlementId != null">
        settlement_id = #{settlementId,jdbcType=BIGINT},
      </if>
      <if test="settlementName != null">
        settlement_name = #{settlementName,jdbcType=VARCHAR},
      </if>
      <if test="creditType != null">
        credit_type = #{creditType,jdbcType=TINYINT},
      </if>
      <if test="creditName != null">
        credit_name = #{creditName,jdbcType=VARCHAR},
      </if>
      <if test="operationTaxRate != null">
        operation_tax_rate = #{operationTaxRate,jdbcType=DECIMAL},
      </if>
      <if test="incomeNoTax != null">
        income_no_tax = #{incomeNoTax,jdbcType=DECIMAL},
      </if>
      <if test="taxAmount != null">
        tax_amount = #{taxAmount,jdbcType=DECIMAL},
      </if>
      <if test="receivableAmount != null">
        receivable_amount = #{receivableAmount,jdbcType=DECIMAL},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="createUserName != null">
        create_user_name = #{createUserName,jdbcType=VARCHAR},
      </if>
      <if test="createUserId != null">
        create_user_id = #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="createdAt != null">
        created_at = #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserName != null">
        update_user_name = #{updateUserName,jdbcType=VARCHAR},
      </if>
      <if test="updateUserId != null">
        update_user_id = #{updateUserId,jdbcType=BIGINT},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="detailId != null">
        detail_id = #{detailId,jdbcType=VARCHAR},
      </if>
      <if test="serviceNo != null">
        service_no = #{serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="serviceNoName != null">
        service_no_name = #{serviceNoName,jdbcType=VARCHAR},
      </if>
      <if test="accountWay != null">
        account_way = #{accountWay,jdbcType=TINYINT},
      </if>
      <if test="accountingOrderSn != null">
        accounting_order_sn = #{accountingOrderSn,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.statistics.receivable.StReceivableDayDataEntity">
    update st_receivable_day_data
    set pertain_month = #{pertainMonth,jdbcType=VARCHAR},
      account_at = #{accountAt,jdbcType=TIMESTAMP},
      account_type = #{accountType,jdbcType=TINYINT},
      credit_id = #{creditId,jdbcType=BIGINT},
      settlement_id = #{settlementId,jdbcType=BIGINT},
      settlement_name = #{settlementName,jdbcType=VARCHAR},
      credit_type = #{creditType,jdbcType=TINYINT},
      credit_name = #{creditName,jdbcType=VARCHAR},
      operation_tax_rate = #{operationTaxRate,jdbcType=DECIMAL},
      income_no_tax = #{incomeNoTax,jdbcType=DECIMAL},
      tax_amount = #{taxAmount,jdbcType=DECIMAL},
      receivable_amount = #{receivableAmount,jdbcType=DECIMAL},
      remark = #{remark,jdbcType=VARCHAR},
      create_user_name = #{createUserName,jdbcType=VARCHAR},
      create_user_id = #{createUserId,jdbcType=BIGINT},
      created_at = #{createdAt,jdbcType=TIMESTAMP},
      update_user_name = #{updateUserName,jdbcType=VARCHAR},
      update_user_id = #{updateUserId,jdbcType=BIGINT},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      detail_id = #{detailId,jdbcType=VARCHAR},
      service_no = #{serviceNo,jdbcType=VARCHAR},
      service_no_name = #{serviceNoName,jdbcType=VARCHAR},
      account_way = #{accountWay,jdbcType=TINYINT},
      accounting_order_sn = #{accountingOrderSn,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>