<?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.invoice.common.InvoiceTypeModeConfigSzhtxxPaperInvoiceMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.invoice.common.InvoiceTypeModeConfigSzhtxxPaperInvoice">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="invoice_type_id" jdbcType="BIGINT" property="invoiceTypeId" />
    <result column="invoice_type_module" jdbcType="VARCHAR" property="invoiceTypeModule" />
    <result column="base_info_taxpayers_i_d_code" jdbcType="VARCHAR" property="baseInfoTaxpayersIDCode" />
    <result column="base_info_company_name" jdbcType="VARCHAR" property="baseInfoCompanyName" />
    <result column="base_info_encrypted_version_number" jdbcType="VARCHAR" property="baseInfoEncryptedVersionNumber" />
    <result column="base_info_base_url" jdbcType="VARCHAR" property="baseInfoBaseUrl" />
    <result column="base_info_registration_code" jdbcType="VARCHAR" property="baseInfoRegistrationCode" />
    <result column="base_info_authorization_code" jdbcType="VARCHAR" property="baseInfoAuthorizationCode" />
    <result column="base_info_platform_code" jdbcType="VARCHAR" property="baseInfoPlatformCode" />
    <result column="base_info_secret_key" jdbcType="VARCHAR" property="baseInfoSecretKey" />
    <result column="rule_enable" jdbcType="TINYINT" property="ruleEnable" />
    <result column="rule_goods_lines" jdbcType="INTEGER" property="ruleGoodsLines" />
    <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>
  <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, invoice_type_id, invoice_type_module, base_info_taxpayers_i_d_code, base_info_company_name, 
    base_info_encrypted_version_number, base_info_base_url, base_info_registration_code, 
    base_info_authorization_code, base_info_platform_code, base_info_secret_key, rule_enable, 
    rule_goods_lines, create_time, create_user_id, update_time, update_user_id
  </sql>
  <select id="selectByExample" parameterType="cn.superdesk.uniorder.dao.entity.invoice.common.InvoiceTypeModeConfigSzhtxxPaperInvoiceExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from invoice_type_mode_config_szhtxx_paper_invoice
    <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 invoice_type_mode_config_szhtxx_paper_invoice
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from invoice_type_mode_config_szhtxx_paper_invoice
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.invoice.common.InvoiceTypeModeConfigSzhtxxPaperInvoiceExample">
    delete from invoice_type_mode_config_szhtxx_paper_invoice
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.invoice.common.InvoiceTypeModeConfigSzhtxxPaperInvoice">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into invoice_type_mode_config_szhtxx_paper_invoice (invoice_type_id, invoice_type_module, 
      base_info_taxpayers_i_d_code, base_info_company_name, 
      base_info_encrypted_version_number, base_info_base_url, 
      base_info_registration_code, base_info_authorization_code, 
      base_info_platform_code, base_info_secret_key, 
      rule_enable, rule_goods_lines, create_time, 
      create_user_id, update_time, update_user_id
      )
    values (#{invoiceTypeId,jdbcType=BIGINT}, #{invoiceTypeModule,jdbcType=VARCHAR}, 
      #{baseInfoTaxpayersIDCode,jdbcType=VARCHAR}, #{baseInfoCompanyName,jdbcType=VARCHAR}, 
      #{baseInfoEncryptedVersionNumber,jdbcType=VARCHAR}, #{baseInfoBaseUrl,jdbcType=VARCHAR}, 
      #{baseInfoRegistrationCode,jdbcType=VARCHAR}, #{baseInfoAuthorizationCode,jdbcType=VARCHAR}, 
      #{baseInfoPlatformCode,jdbcType=VARCHAR}, #{baseInfoSecretKey,jdbcType=VARCHAR}, 
      #{ruleEnable,jdbcType=TINYINT}, #{ruleGoodsLines,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
      #{createUserId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{updateUserId,jdbcType=BIGINT}
      )
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.invoice.common.InvoiceTypeModeConfigSzhtxxPaperInvoice">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into invoice_type_mode_config_szhtxx_paper_invoice
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="invoiceTypeId != null">
        invoice_type_id,
      </if>
      <if test="invoiceTypeModule != null">
        invoice_type_module,
      </if>
      <if test="baseInfoTaxpayersIDCode != null">
        base_info_taxpayers_i_d_code,
      </if>
      <if test="baseInfoCompanyName != null">
        base_info_company_name,
      </if>
      <if test="baseInfoEncryptedVersionNumber != null">
        base_info_encrypted_version_number,
      </if>
      <if test="baseInfoBaseUrl != null">
        base_info_base_url,
      </if>
      <if test="baseInfoRegistrationCode != null">
        base_info_registration_code,
      </if>
      <if test="baseInfoAuthorizationCode != null">
        base_info_authorization_code,
      </if>
      <if test="baseInfoPlatformCode != null">
        base_info_platform_code,
      </if>
      <if test="baseInfoSecretKey != null">
        base_info_secret_key,
      </if>
      <if test="ruleEnable != null">
        rule_enable,
      </if>
      <if test="ruleGoodsLines != null">
        rule_goods_lines,
      </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>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="invoiceTypeId != null">
        #{invoiceTypeId,jdbcType=BIGINT},
      </if>
      <if test="invoiceTypeModule != null">
        #{invoiceTypeModule,jdbcType=VARCHAR},
      </if>
      <if test="baseInfoTaxpayersIDCode != null">
        #{baseInfoTaxpayersIDCode,jdbcType=VARCHAR},
      </if>
      <if test="baseInfoCompanyName != null">
        #{baseInfoCompanyName,jdbcType=VARCHAR},
      </if>
      <if test="baseInfoEncryptedVersionNumber != null">
        #{baseInfoEncryptedVersionNumber,jdbcType=VARCHAR},
      </if>
      <if test="baseInfoBaseUrl != null">
        #{baseInfoBaseUrl,jdbcType=VARCHAR},
      </if>
      <if test="baseInfoRegistrationCode != null">
        #{baseInfoRegistrationCode,jdbcType=VARCHAR},
      </if>
      <if test="baseInfoAuthorizationCode != null">
        #{baseInfoAuthorizationCode,jdbcType=VARCHAR},
      </if>
      <if test="baseInfoPlatformCode != null">
        #{baseInfoPlatformCode,jdbcType=VARCHAR},
      </if>
      <if test="baseInfoSecretKey != null">
        #{baseInfoSecretKey,jdbcType=VARCHAR},
      </if>
      <if test="ruleEnable != null">
        #{ruleEnable,jdbcType=TINYINT},
      </if>
      <if test="ruleGoodsLines != null">
        #{ruleGoodsLines,jdbcType=INTEGER},
      </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>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.invoice.common.InvoiceTypeModeConfigSzhtxxPaperInvoiceExample" resultType="java.lang.Long">
    select count(*) from invoice_type_mode_config_szhtxx_paper_invoice
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update invoice_type_mode_config_szhtxx_paper_invoice
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.invoiceTypeId != null">
        invoice_type_id = #{record.invoiceTypeId,jdbcType=BIGINT},
      </if>
      <if test="record.invoiceTypeModule != null">
        invoice_type_module = #{record.invoiceTypeModule,jdbcType=VARCHAR},
      </if>
      <if test="record.baseInfoTaxpayersIDCode != null">
        base_info_taxpayers_i_d_code = #{record.baseInfoTaxpayersIDCode,jdbcType=VARCHAR},
      </if>
      <if test="record.baseInfoCompanyName != null">
        base_info_company_name = #{record.baseInfoCompanyName,jdbcType=VARCHAR},
      </if>
      <if test="record.baseInfoEncryptedVersionNumber != null">
        base_info_encrypted_version_number = #{record.baseInfoEncryptedVersionNumber,jdbcType=VARCHAR},
      </if>
      <if test="record.baseInfoBaseUrl != null">
        base_info_base_url = #{record.baseInfoBaseUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.baseInfoRegistrationCode != null">
        base_info_registration_code = #{record.baseInfoRegistrationCode,jdbcType=VARCHAR},
      </if>
      <if test="record.baseInfoAuthorizationCode != null">
        base_info_authorization_code = #{record.baseInfoAuthorizationCode,jdbcType=VARCHAR},
      </if>
      <if test="record.baseInfoPlatformCode != null">
        base_info_platform_code = #{record.baseInfoPlatformCode,jdbcType=VARCHAR},
      </if>
      <if test="record.baseInfoSecretKey != null">
        base_info_secret_key = #{record.baseInfoSecretKey,jdbcType=VARCHAR},
      </if>
      <if test="record.ruleEnable != null">
        rule_enable = #{record.ruleEnable,jdbcType=TINYINT},
      </if>
      <if test="record.ruleGoodsLines != null">
        rule_goods_lines = #{record.ruleGoodsLines,jdbcType=INTEGER},
      </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>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update invoice_type_mode_config_szhtxx_paper_invoice
    set id = #{record.id,jdbcType=BIGINT},
      invoice_type_id = #{record.invoiceTypeId,jdbcType=BIGINT},
      invoice_type_module = #{record.invoiceTypeModule,jdbcType=VARCHAR},
      base_info_taxpayers_i_d_code = #{record.baseInfoTaxpayersIDCode,jdbcType=VARCHAR},
      base_info_company_name = #{record.baseInfoCompanyName,jdbcType=VARCHAR},
      base_info_encrypted_version_number = #{record.baseInfoEncryptedVersionNumber,jdbcType=VARCHAR},
      base_info_base_url = #{record.baseInfoBaseUrl,jdbcType=VARCHAR},
      base_info_registration_code = #{record.baseInfoRegistrationCode,jdbcType=VARCHAR},
      base_info_authorization_code = #{record.baseInfoAuthorizationCode,jdbcType=VARCHAR},
      base_info_platform_code = #{record.baseInfoPlatformCode,jdbcType=VARCHAR},
      base_info_secret_key = #{record.baseInfoSecretKey,jdbcType=VARCHAR},
      rule_enable = #{record.ruleEnable,jdbcType=TINYINT},
      rule_goods_lines = #{record.ruleGoodsLines,jdbcType=INTEGER},
      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.invoice.common.InvoiceTypeModeConfigSzhtxxPaperInvoice">
    update invoice_type_mode_config_szhtxx_paper_invoice
    <set>
      <if test="invoiceTypeId != null">
        invoice_type_id = #{invoiceTypeId,jdbcType=BIGINT},
      </if>
      <if test="invoiceTypeModule != null">
        invoice_type_module = #{invoiceTypeModule,jdbcType=VARCHAR},
      </if>
      <if test="baseInfoTaxpayersIDCode != null">
        base_info_taxpayers_i_d_code = #{baseInfoTaxpayersIDCode,jdbcType=VARCHAR},
      </if>
      <if test="baseInfoCompanyName != null">
        base_info_company_name = #{baseInfoCompanyName,jdbcType=VARCHAR},
      </if>
      <if test="baseInfoEncryptedVersionNumber != null">
        base_info_encrypted_version_number = #{baseInfoEncryptedVersionNumber,jdbcType=VARCHAR},
      </if>
      <if test="baseInfoBaseUrl != null">
        base_info_base_url = #{baseInfoBaseUrl,jdbcType=VARCHAR},
      </if>
      <if test="baseInfoRegistrationCode != null">
        base_info_registration_code = #{baseInfoRegistrationCode,jdbcType=VARCHAR},
      </if>
      <if test="baseInfoAuthorizationCode != null">
        base_info_authorization_code = #{baseInfoAuthorizationCode,jdbcType=VARCHAR},
      </if>
      <if test="baseInfoPlatformCode != null">
        base_info_platform_code = #{baseInfoPlatformCode,jdbcType=VARCHAR},
      </if>
      <if test="baseInfoSecretKey != null">
        base_info_secret_key = #{baseInfoSecretKey,jdbcType=VARCHAR},
      </if>
      <if test="ruleEnable != null">
        rule_enable = #{ruleEnable,jdbcType=TINYINT},
      </if>
      <if test="ruleGoodsLines != null">
        rule_goods_lines = #{ruleGoodsLines,jdbcType=INTEGER},
      </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>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.invoice.common.InvoiceTypeModeConfigSzhtxxPaperInvoice">
    update invoice_type_mode_config_szhtxx_paper_invoice
    set invoice_type_id = #{invoiceTypeId,jdbcType=BIGINT},
      invoice_type_module = #{invoiceTypeModule,jdbcType=VARCHAR},
      base_info_taxpayers_i_d_code = #{baseInfoTaxpayersIDCode,jdbcType=VARCHAR},
      base_info_company_name = #{baseInfoCompanyName,jdbcType=VARCHAR},
      base_info_encrypted_version_number = #{baseInfoEncryptedVersionNumber,jdbcType=VARCHAR},
      base_info_base_url = #{baseInfoBaseUrl,jdbcType=VARCHAR},
      base_info_registration_code = #{baseInfoRegistrationCode,jdbcType=VARCHAR},
      base_info_authorization_code = #{baseInfoAuthorizationCode,jdbcType=VARCHAR},
      base_info_platform_code = #{baseInfoPlatformCode,jdbcType=VARCHAR},
      base_info_secret_key = #{baseInfoSecretKey,jdbcType=VARCHAR},
      rule_enable = #{ruleEnable,jdbcType=TINYINT},
      rule_goods_lines = #{ruleGoodsLines,jdbcType=INTEGER},
      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>