<?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="pwc.taxtech.atms.vat.dao.RevenueConfigMapper">
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.RevenueConfig">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="serial_no" jdbcType="VARCHAR" property="serialNo" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="org_id" jdbcType="VARCHAR" property="orgId" />
    <result column="account_type" jdbcType="TINYINT" property="accountType" />
    <result column="account_name" jdbcType="VARCHAR" property="accountName" />
    <result column="tax_rate" jdbcType="DECIMAL" property="taxRate" />
    <result column="tax_base" jdbcType="TINYINT" property="taxBase" />
    <result column="revenue_type" jdbcType="TINYINT" property="revenueType" />
    <result column="tax_type" jdbcType="TINYINT" property="taxType" />
    <result column="status" jdbcType="TINYINT" property="status" />
    <result column="start_date" jdbcType="VARCHAR" property="startDate" />
    <result column="end_date" jdbcType="VARCHAR" property="endDate" />
    <result column="tb_segment3" jdbcType="VARCHAR" property="tbSegment3" />
    <result column="tb_segment5" jdbcType="VARCHAR" property="tbSegment5" />
    <result column="tb_segment6" jdbcType="VARCHAR" property="tbSegment6" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
    <result column="create_by" jdbcType="VARCHAR" property="createBy" />
    <result column="base_cr_code" jdbcType="VARCHAR" property="baseCrCode" />
    <result column="base_dr_code" jdbcType="VARCHAR" property="baseDrCode" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <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">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <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">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    id, serial_no, `name`, org_id, account_type, account_name, tax_rate, tax_base, revenue_type, 
    tax_type, `status`, start_date, end_date, tb_segment3, tb_segment5, tb_segment6, 
    update_time, create_time, update_by, create_by, base_cr_code, base_dr_code
  </sql>
  <select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.RevenueConfigExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from revenue_config
    <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">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from revenue_config
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from revenue_config
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.RevenueConfigExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from revenue_config
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="pwc.taxtech.atms.vat.entity.RevenueConfig">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into revenue_config (id, serial_no, `name`, 
      org_id, account_type, account_name, 
      tax_rate, tax_base, revenue_type, 
      tax_type, `status`, start_date, 
      end_date, tb_segment3, tb_segment5, 
      tb_segment6, update_time, create_time, 
      update_by, create_by, base_cr_code, 
      base_dr_code)
    values (#{id,jdbcType=BIGINT}, #{serialNo,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
      #{orgId,jdbcType=VARCHAR}, #{accountType,jdbcType=TINYINT}, #{accountName,jdbcType=VARCHAR}, 
      #{taxRate,jdbcType=DECIMAL}, #{taxBase,jdbcType=TINYINT}, #{revenueType,jdbcType=TINYINT}, 
      #{taxType,jdbcType=TINYINT}, #{status,jdbcType=TINYINT}, #{startDate,jdbcType=VARCHAR}, 
      #{endDate,jdbcType=VARCHAR}, #{tbSegment3,jdbcType=VARCHAR}, #{tbSegment5,jdbcType=VARCHAR}, 
      #{tbSegment6,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, 
      #{updateBy,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{baseCrCode,jdbcType=VARCHAR}, 
      #{baseDrCode,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.RevenueConfig">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into revenue_config
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="serialNo != null">
        serial_no,
      </if>
      <if test="name != null">
        `name`,
      </if>
      <if test="orgId != null">
        org_id,
      </if>
      <if test="accountType != null">
        account_type,
      </if>
      <if test="accountName != null">
        account_name,
      </if>
      <if test="taxRate != null">
        tax_rate,
      </if>
      <if test="taxBase != null">
        tax_base,
      </if>
      <if test="revenueType != null">
        revenue_type,
      </if>
      <if test="taxType != null">
        tax_type,
      </if>
      <if test="status != null">
        `status`,
      </if>
      <if test="startDate != null">
        start_date,
      </if>
      <if test="endDate != null">
        end_date,
      </if>
      <if test="tbSegment3 != null">
        tb_segment3,
      </if>
      <if test="tbSegment5 != null">
        tb_segment5,
      </if>
      <if test="tbSegment6 != null">
        tb_segment6,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateBy != null">
        update_by,
      </if>
      <if test="createBy != null">
        create_by,
      </if>
      <if test="baseCrCode != null">
        base_cr_code,
      </if>
      <if test="baseDrCode != null">
        base_dr_code,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="serialNo != null">
        #{serialNo,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="orgId != null">
        #{orgId,jdbcType=VARCHAR},
      </if>
      <if test="accountType != null">
        #{accountType,jdbcType=TINYINT},
      </if>
      <if test="accountName != null">
        #{accountName,jdbcType=VARCHAR},
      </if>
      <if test="taxRate != null">
        #{taxRate,jdbcType=DECIMAL},
      </if>
      <if test="taxBase != null">
        #{taxBase,jdbcType=TINYINT},
      </if>
      <if test="revenueType != null">
        #{revenueType,jdbcType=TINYINT},
      </if>
      <if test="taxType != null">
        #{taxType,jdbcType=TINYINT},
      </if>
      <if test="status != null">
        #{status,jdbcType=TINYINT},
      </if>
      <if test="startDate != null">
        #{startDate,jdbcType=VARCHAR},
      </if>
      <if test="endDate != null">
        #{endDate,jdbcType=VARCHAR},
      </if>
      <if test="tbSegment3 != null">
        #{tbSegment3,jdbcType=VARCHAR},
      </if>
      <if test="tbSegment5 != null">
        #{tbSegment5,jdbcType=VARCHAR},
      </if>
      <if test="tbSegment6 != null">
        #{tbSegment6,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateBy != null">
        #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="createBy != null">
        #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="baseCrCode != null">
        #{baseCrCode,jdbcType=VARCHAR},
      </if>
      <if test="baseDrCode != null">
        #{baseDrCode,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.RevenueConfigExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from revenue_config
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update revenue_config
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.serialNo != null">
        serial_no = #{record.serialNo,jdbcType=VARCHAR},
      </if>
      <if test="record.name != null">
        `name` = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.orgId != null">
        org_id = #{record.orgId,jdbcType=VARCHAR},
      </if>
      <if test="record.accountType != null">
        account_type = #{record.accountType,jdbcType=TINYINT},
      </if>
      <if test="record.accountName != null">
        account_name = #{record.accountName,jdbcType=VARCHAR},
      </if>
      <if test="record.taxRate != null">
        tax_rate = #{record.taxRate,jdbcType=DECIMAL},
      </if>
      <if test="record.taxBase != null">
        tax_base = #{record.taxBase,jdbcType=TINYINT},
      </if>
      <if test="record.revenueType != null">
        revenue_type = #{record.revenueType,jdbcType=TINYINT},
      </if>
      <if test="record.taxType != null">
        tax_type = #{record.taxType,jdbcType=TINYINT},
      </if>
      <if test="record.status != null">
        `status` = #{record.status,jdbcType=TINYINT},
      </if>
      <if test="record.startDate != null">
        start_date = #{record.startDate,jdbcType=VARCHAR},
      </if>
      <if test="record.endDate != null">
        end_date = #{record.endDate,jdbcType=VARCHAR},
      </if>
      <if test="record.tbSegment3 != null">
        tb_segment3 = #{record.tbSegment3,jdbcType=VARCHAR},
      </if>
      <if test="record.tbSegment5 != null">
        tb_segment5 = #{record.tbSegment5,jdbcType=VARCHAR},
      </if>
      <if test="record.tbSegment6 != null">
        tb_segment6 = #{record.tbSegment6,jdbcType=VARCHAR},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateBy != null">
        update_by = #{record.updateBy,jdbcType=VARCHAR},
      </if>
      <if test="record.createBy != null">
        create_by = #{record.createBy,jdbcType=VARCHAR},
      </if>
      <if test="record.baseCrCode != null">
        base_cr_code = #{record.baseCrCode,jdbcType=VARCHAR},
      </if>
      <if test="record.baseDrCode != null">
        base_dr_code = #{record.baseDrCode,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update revenue_config
    set id = #{record.id,jdbcType=BIGINT},
      serial_no = #{record.serialNo,jdbcType=VARCHAR},
      `name` = #{record.name,jdbcType=VARCHAR},
      org_id = #{record.orgId,jdbcType=VARCHAR},
      account_type = #{record.accountType,jdbcType=TINYINT},
      account_name = #{record.accountName,jdbcType=VARCHAR},
      tax_rate = #{record.taxRate,jdbcType=DECIMAL},
      tax_base = #{record.taxBase,jdbcType=TINYINT},
      revenue_type = #{record.revenueType,jdbcType=TINYINT},
      tax_type = #{record.taxType,jdbcType=TINYINT},
      `status` = #{record.status,jdbcType=TINYINT},
      start_date = #{record.startDate,jdbcType=VARCHAR},
      end_date = #{record.endDate,jdbcType=VARCHAR},
      tb_segment3 = #{record.tbSegment3,jdbcType=VARCHAR},
      tb_segment5 = #{record.tbSegment5,jdbcType=VARCHAR},
      tb_segment6 = #{record.tbSegment6,jdbcType=VARCHAR},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_by = #{record.updateBy,jdbcType=VARCHAR},
      create_by = #{record.createBy,jdbcType=VARCHAR},
      base_cr_code = #{record.baseCrCode,jdbcType=VARCHAR},
      base_dr_code = #{record.baseDrCode,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.vat.entity.RevenueConfig">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update revenue_config
    <set>
      <if test="serialNo != null">
        serial_no = #{serialNo,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        `name` = #{name,jdbcType=VARCHAR},
      </if>
      <if test="orgId != null">
        org_id = #{orgId,jdbcType=VARCHAR},
      </if>
      <if test="accountType != null">
        account_type = #{accountType,jdbcType=TINYINT},
      </if>
      <if test="accountName != null">
        account_name = #{accountName,jdbcType=VARCHAR},
      </if>
      <if test="taxRate != null">
        tax_rate = #{taxRate,jdbcType=DECIMAL},
      </if>
      <if test="taxBase != null">
        tax_base = #{taxBase,jdbcType=TINYINT},
      </if>
      <if test="revenueType != null">
        revenue_type = #{revenueType,jdbcType=TINYINT},
      </if>
      <if test="taxType != null">
        tax_type = #{taxType,jdbcType=TINYINT},
      </if>
      <if test="status != null">
        `status` = #{status,jdbcType=TINYINT},
      </if>
      <if test="startDate != null">
        start_date = #{startDate,jdbcType=VARCHAR},
      </if>
      <if test="endDate != null">
        end_date = #{endDate,jdbcType=VARCHAR},
      </if>
      <if test="tbSegment3 != null">
        tb_segment3 = #{tbSegment3,jdbcType=VARCHAR},
      </if>
      <if test="tbSegment5 != null">
        tb_segment5 = #{tbSegment5,jdbcType=VARCHAR},
      </if>
      <if test="tbSegment6 != null">
        tb_segment6 = #{tbSegment6,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateBy != null">
        update_by = #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="createBy != null">
        create_by = #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="baseCrCode != null">
        base_cr_code = #{baseCrCode,jdbcType=VARCHAR},
      </if>
      <if test="baseDrCode != null">
        base_dr_code = #{baseDrCode,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.vat.entity.RevenueConfig">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update revenue_config
    set serial_no = #{serialNo,jdbcType=VARCHAR},
      `name` = #{name,jdbcType=VARCHAR},
      org_id = #{orgId,jdbcType=VARCHAR},
      account_type = #{accountType,jdbcType=TINYINT},
      account_name = #{accountName,jdbcType=VARCHAR},
      tax_rate = #{taxRate,jdbcType=DECIMAL},
      tax_base = #{taxBase,jdbcType=TINYINT},
      revenue_type = #{revenueType,jdbcType=TINYINT},
      tax_type = #{taxType,jdbcType=TINYINT},
      `status` = #{status,jdbcType=TINYINT},
      start_date = #{startDate,jdbcType=VARCHAR},
      end_date = #{endDate,jdbcType=VARCHAR},
      tb_segment3 = #{tbSegment3,jdbcType=VARCHAR},
      tb_segment5 = #{tbSegment5,jdbcType=VARCHAR},
      tb_segment6 = #{tbSegment6,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_by = #{updateBy,jdbcType=VARCHAR},
      create_by = #{createBy,jdbcType=VARCHAR},
      base_cr_code = #{baseCrCode,jdbcType=VARCHAR},
      base_dr_code = #{baseDrCode,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.RevenueConfigExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from revenue_config
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>