<?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.accounting.unified.supplier.AccountingUnifiedSupplierIssuesMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplierIssues">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="issues_come_from" jdbcType="TINYINT" property="issuesComeFrom" />
    <result column="accounting_order_id" jdbcType="BIGINT" property="accountingOrderId" />
    <result column="accounting_order_sn" jdbcType="VARCHAR" property="accountingOrderSn" />
    <result column="is_problem" jdbcType="TINYINT" property="isProblem" />
    <result column="is_process" jdbcType="TINYINT" property="isProcess" />
    <result column="is_result" jdbcType="TINYINT" property="isResult" />
    <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" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplierIssues">
    <result column="order_sn_list" jdbcType="LONGVARCHAR" property="orderSnList" />
    <result column="problem_report" jdbcType="LONGVARCHAR" property="problemReport" />
    <result column="process_report" jdbcType="LONGVARCHAR" property="processReport" />
    <result column="result_report" jdbcType="LONGVARCHAR" property="resultReport" />
  </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, issues_come_from, accounting_order_id, accounting_order_sn, is_problem, is_process, 
    is_result, create_time, create_user_id, update_time, update_user_id
  </sql>
  <sql id="Blob_Column_List">
    order_sn_list, problem_report, process_report, result_report
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplierIssuesExample" resultMap="ResultMapWithBLOBs">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from accounting_unified_supplier_issues
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplierIssuesExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from accounting_unified_supplier_issues
    <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="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from accounting_unified_supplier_issues
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from accounting_unified_supplier_issues
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplierIssuesExample">
    delete from accounting_unified_supplier_issues
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplierIssues">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into accounting_unified_supplier_issues (issues_come_from, accounting_order_id, 
      accounting_order_sn, is_problem, is_process, 
      is_result, create_time, create_user_id, 
      update_time, update_user_id, order_sn_list, 
      problem_report, process_report, result_report
      )
    values (#{issuesComeFrom,jdbcType=TINYINT}, #{accountingOrderId,jdbcType=BIGINT}, 
      #{accountingOrderSn,jdbcType=VARCHAR}, #{isProblem,jdbcType=TINYINT}, #{isProcess,jdbcType=TINYINT}, 
      #{isResult,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=BIGINT}, 
      #{updateTime,jdbcType=TIMESTAMP}, #{updateUserId,jdbcType=BIGINT}, #{orderSnList,jdbcType=LONGVARCHAR}, 
      #{problemReport,jdbcType=LONGVARCHAR}, #{processReport,jdbcType=LONGVARCHAR}, #{resultReport,jdbcType=LONGVARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplierIssues">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into accounting_unified_supplier_issues
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="issuesComeFrom != null">
        issues_come_from,
      </if>
      <if test="accountingOrderId != null">
        accounting_order_id,
      </if>
      <if test="accountingOrderSn != null">
        accounting_order_sn,
      </if>
      <if test="isProblem != null">
        is_problem,
      </if>
      <if test="isProcess != null">
        is_process,
      </if>
      <if test="isResult != null">
        is_result,
      </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="orderSnList != null">
        order_sn_list,
      </if>
      <if test="problemReport != null">
        problem_report,
      </if>
      <if test="processReport != null">
        process_report,
      </if>
      <if test="resultReport != null">
        result_report,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="issuesComeFrom != null">
        #{issuesComeFrom,jdbcType=TINYINT},
      </if>
      <if test="accountingOrderId != null">
        #{accountingOrderId,jdbcType=BIGINT},
      </if>
      <if test="accountingOrderSn != null">
        #{accountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="isProblem != null">
        #{isProblem,jdbcType=TINYINT},
      </if>
      <if test="isProcess != null">
        #{isProcess,jdbcType=TINYINT},
      </if>
      <if test="isResult != null">
        #{isResult,jdbcType=TINYINT},
      </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="orderSnList != null">
        #{orderSnList,jdbcType=LONGVARCHAR},
      </if>
      <if test="problemReport != null">
        #{problemReport,jdbcType=LONGVARCHAR},
      </if>
      <if test="processReport != null">
        #{processReport,jdbcType=LONGVARCHAR},
      </if>
      <if test="resultReport != null">
        #{resultReport,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplierIssuesExample" resultType="java.lang.Long">
    select count(*) from accounting_unified_supplier_issues
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update accounting_unified_supplier_issues
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.issuesComeFrom != null">
        issues_come_from = #{record.issuesComeFrom,jdbcType=TINYINT},
      </if>
      <if test="record.accountingOrderId != null">
        accounting_order_id = #{record.accountingOrderId,jdbcType=BIGINT},
      </if>
      <if test="record.accountingOrderSn != null">
        accounting_order_sn = #{record.accountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="record.isProblem != null">
        is_problem = #{record.isProblem,jdbcType=TINYINT},
      </if>
      <if test="record.isProcess != null">
        is_process = #{record.isProcess,jdbcType=TINYINT},
      </if>
      <if test="record.isResult != null">
        is_result = #{record.isResult,jdbcType=TINYINT},
      </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.orderSnList != null">
        order_sn_list = #{record.orderSnList,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.problemReport != null">
        problem_report = #{record.problemReport,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.processReport != null">
        process_report = #{record.processReport,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.resultReport != null">
        result_report = #{record.resultReport,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    update accounting_unified_supplier_issues
    set id = #{record.id,jdbcType=BIGINT},
      issues_come_from = #{record.issuesComeFrom,jdbcType=TINYINT},
      accounting_order_id = #{record.accountingOrderId,jdbcType=BIGINT},
      accounting_order_sn = #{record.accountingOrderSn,jdbcType=VARCHAR},
      is_problem = #{record.isProblem,jdbcType=TINYINT},
      is_process = #{record.isProcess,jdbcType=TINYINT},
      is_result = #{record.isResult,jdbcType=TINYINT},
      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},
      order_sn_list = #{record.orderSnList,jdbcType=LONGVARCHAR},
      problem_report = #{record.problemReport,jdbcType=LONGVARCHAR},
      process_report = #{record.processReport,jdbcType=LONGVARCHAR},
      result_report = #{record.resultReport,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update accounting_unified_supplier_issues
    set id = #{record.id,jdbcType=BIGINT},
      issues_come_from = #{record.issuesComeFrom,jdbcType=TINYINT},
      accounting_order_id = #{record.accountingOrderId,jdbcType=BIGINT},
      accounting_order_sn = #{record.accountingOrderSn,jdbcType=VARCHAR},
      is_problem = #{record.isProblem,jdbcType=TINYINT},
      is_process = #{record.isProcess,jdbcType=TINYINT},
      is_result = #{record.isResult,jdbcType=TINYINT},
      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}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplierIssues">
    update accounting_unified_supplier_issues
    <set>
      <if test="issuesComeFrom != null">
        issues_come_from = #{issuesComeFrom,jdbcType=TINYINT},
      </if>
      <if test="accountingOrderId != null">
        accounting_order_id = #{accountingOrderId,jdbcType=BIGINT},
      </if>
      <if test="accountingOrderSn != null">
        accounting_order_sn = #{accountingOrderSn,jdbcType=VARCHAR},
      </if>
      <if test="isProblem != null">
        is_problem = #{isProblem,jdbcType=TINYINT},
      </if>
      <if test="isProcess != null">
        is_process = #{isProcess,jdbcType=TINYINT},
      </if>
      <if test="isResult != null">
        is_result = #{isResult,jdbcType=TINYINT},
      </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="orderSnList != null">
        order_sn_list = #{orderSnList,jdbcType=LONGVARCHAR},
      </if>
      <if test="problemReport != null">
        problem_report = #{problemReport,jdbcType=LONGVARCHAR},
      </if>
      <if test="processReport != null">
        process_report = #{processReport,jdbcType=LONGVARCHAR},
      </if>
      <if test="resultReport != null">
        result_report = #{resultReport,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplierIssues">
    update accounting_unified_supplier_issues
    set issues_come_from = #{issuesComeFrom,jdbcType=TINYINT},
      accounting_order_id = #{accountingOrderId,jdbcType=BIGINT},
      accounting_order_sn = #{accountingOrderSn,jdbcType=VARCHAR},
      is_problem = #{isProblem,jdbcType=TINYINT},
      is_process = #{isProcess,jdbcType=TINYINT},
      is_result = #{isResult,jdbcType=TINYINT},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_user_id = #{createUserId,jdbcType=BIGINT},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{updateUserId,jdbcType=BIGINT},
      order_sn_list = #{orderSnList,jdbcType=LONGVARCHAR},
      problem_report = #{problemReport,jdbcType=LONGVARCHAR},
      process_report = #{processReport,jdbcType=LONGVARCHAR},
      result_report = #{resultReport,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.accounting.unified.supplier.AccountingUnifiedSupplierIssues">
    update accounting_unified_supplier_issues
    set issues_come_from = #{issuesComeFrom,jdbcType=TINYINT},
      accounting_order_id = #{accountingOrderId,jdbcType=BIGINT},
      accounting_order_sn = #{accountingOrderSn,jdbcType=VARCHAR},
      is_problem = #{isProblem,jdbcType=TINYINT},
      is_process = #{isProcess,jdbcType=TINYINT},
      is_result = #{isResult,jdbcType=TINYINT},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_user_id = #{createUserId,jdbcType=BIGINT},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{updateUserId,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>