<?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.dao.CitDraftAccountMappingMapper">
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.entity.CitDraftAccountMapping">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
    <result column="project_id" jdbcType="VARCHAR" property="projectId" />
    <result column="period" jdbcType="INTEGER" property="period" />
    <result column="source" jdbcType="VARCHAR" property="source" />
    <result column="draft_code" jdbcType="VARCHAR" property="draftCode" />
    <result column="draft_name" jdbcType="VARCHAR" property="draftName" />
    <result column="large_attribute" jdbcType="VARCHAR" property="largeAttribute" />
    <result column="attribute" jdbcType="VARCHAR" property="attribute" />
    <result column="wp_position" jdbcType="VARCHAR" property="wpPosition" />
    <result column="acct_code" jdbcType="VARCHAR" property="acctCode" />
    <result column="account_name" jdbcType="VARCHAR" property="accountName" />
    <result column="pl_row_set" jdbcType="VARCHAR" property="plRowSet" />
    <result column="bs_row_set" jdbcType="VARCHAR" property="bsRowSet" />
    <result column="fetch_number" jdbcType="VARCHAR" property="fetchNumber" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="created_by" jdbcType="VARCHAR" property="createdBy" />
    <result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  </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, organization_id, project_id, period, source, draft_code, draft_name, large_attribute, 
    attribute, wp_position, acct_code, account_name, pl_row_set, bs_row_set, fetch_number, 
    remark, created_by, updated_by, create_time, update_time
  </sql>
  <select id="selectByExample" parameterType="pwc.taxtech.atms.entity.CitDraftAccountMappingExample" 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 cit_draft_account_mapping
    <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 cit_draft_account_mapping
    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 cit_draft_account_mapping
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.entity.CitDraftAccountMappingExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from cit_draft_account_mapping
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="pwc.taxtech.atms.entity.CitDraftAccountMapping">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into cit_draft_account_mapping (id, organization_id, project_id, 
      period, source, draft_code, 
      draft_name, large_attribute, attribute, 
      wp_position, acct_code, account_name, 
      pl_row_set, bs_row_set, fetch_number, 
      remark, created_by, updated_by, 
      create_time, update_time)
    values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, 
      #{period,jdbcType=INTEGER}, #{source,jdbcType=VARCHAR}, #{draftCode,jdbcType=VARCHAR}, 
      #{draftName,jdbcType=VARCHAR}, #{largeAttribute,jdbcType=VARCHAR}, #{attribute,jdbcType=VARCHAR}, 
      #{wpPosition,jdbcType=VARCHAR}, #{acctCode,jdbcType=VARCHAR}, #{accountName,jdbcType=VARCHAR}, 
      #{plRowSet,jdbcType=VARCHAR}, #{bsRowSet,jdbcType=VARCHAR}, #{fetchNumber,jdbcType=VARCHAR}, 
      #{remark,jdbcType=VARCHAR}, #{createdBy,jdbcType=VARCHAR}, #{updatedBy,jdbcType=VARCHAR}, 
      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.CitDraftAccountMapping">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into cit_draft_account_mapping
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="organizationId != null">
        organization_id,
      </if>
      <if test="projectId != null">
        project_id,
      </if>
      <if test="period != null">
        period,
      </if>
      <if test="source != null">
        source,
      </if>
      <if test="draftCode != null">
        draft_code,
      </if>
      <if test="draftName != null">
        draft_name,
      </if>
      <if test="largeAttribute != null">
        large_attribute,
      </if>
      <if test="attribute != null">
        attribute,
      </if>
      <if test="wpPosition != null">
        wp_position,
      </if>
      <if test="acctCode != null">
        acct_code,
      </if>
      <if test="accountName != null">
        account_name,
      </if>
      <if test="plRowSet != null">
        pl_row_set,
      </if>
      <if test="bsRowSet != null">
        bs_row_set,
      </if>
      <if test="fetchNumber != null">
        fetch_number,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="createdBy != null">
        created_by,
      </if>
      <if test="updatedBy != null">
        updated_by,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="organizationId != null">
        #{organizationId,jdbcType=VARCHAR},
      </if>
      <if test="projectId != null">
        #{projectId,jdbcType=VARCHAR},
      </if>
      <if test="period != null">
        #{period,jdbcType=INTEGER},
      </if>
      <if test="source != null">
        #{source,jdbcType=VARCHAR},
      </if>
      <if test="draftCode != null">
        #{draftCode,jdbcType=VARCHAR},
      </if>
      <if test="draftName != null">
        #{draftName,jdbcType=VARCHAR},
      </if>
      <if test="largeAttribute != null">
        #{largeAttribute,jdbcType=VARCHAR},
      </if>
      <if test="attribute != null">
        #{attribute,jdbcType=VARCHAR},
      </if>
      <if test="wpPosition != null">
        #{wpPosition,jdbcType=VARCHAR},
      </if>
      <if test="acctCode != null">
        #{acctCode,jdbcType=VARCHAR},
      </if>
      <if test="accountName != null">
        #{accountName,jdbcType=VARCHAR},
      </if>
      <if test="plRowSet != null">
        #{plRowSet,jdbcType=VARCHAR},
      </if>
      <if test="bsRowSet != null">
        #{bsRowSet,jdbcType=VARCHAR},
      </if>
      <if test="fetchNumber != null">
        #{fetchNumber,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="createdBy != null">
        #{createdBy,jdbcType=VARCHAR},
      </if>
      <if test="updatedBy != null">
        #{updatedBy,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="pwc.taxtech.atms.entity.CitDraftAccountMappingExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from cit_draft_account_mapping
    <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 cit_draft_account_mapping
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.organizationId != null">
        organization_id = #{record.organizationId,jdbcType=VARCHAR},
      </if>
      <if test="record.projectId != null">
        project_id = #{record.projectId,jdbcType=VARCHAR},
      </if>
      <if test="record.period != null">
        period = #{record.period,jdbcType=INTEGER},
      </if>
      <if test="record.source != null">
        source = #{record.source,jdbcType=VARCHAR},
      </if>
      <if test="record.draftCode != null">
        draft_code = #{record.draftCode,jdbcType=VARCHAR},
      </if>
      <if test="record.draftName != null">
        draft_name = #{record.draftName,jdbcType=VARCHAR},
      </if>
      <if test="record.largeAttribute != null">
        large_attribute = #{record.largeAttribute,jdbcType=VARCHAR},
      </if>
      <if test="record.attribute != null">
        attribute = #{record.attribute,jdbcType=VARCHAR},
      </if>
      <if test="record.wpPosition != null">
        wp_position = #{record.wpPosition,jdbcType=VARCHAR},
      </if>
      <if test="record.acctCode != null">
        acct_code = #{record.acctCode,jdbcType=VARCHAR},
      </if>
      <if test="record.accountName != null">
        account_name = #{record.accountName,jdbcType=VARCHAR},
      </if>
      <if test="record.plRowSet != null">
        pl_row_set = #{record.plRowSet,jdbcType=VARCHAR},
      </if>
      <if test="record.bsRowSet != null">
        bs_row_set = #{record.bsRowSet,jdbcType=VARCHAR},
      </if>
      <if test="record.fetchNumber != null">
        fetch_number = #{record.fetchNumber,jdbcType=VARCHAR},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
      <if test="record.createdBy != null">
        created_by = #{record.createdBy,jdbcType=VARCHAR},
      </if>
      <if test="record.updatedBy != null">
        updated_by = #{record.updatedBy,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </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 cit_draft_account_mapping
    set id = #{record.id,jdbcType=BIGINT},
      organization_id = #{record.organizationId,jdbcType=VARCHAR},
      project_id = #{record.projectId,jdbcType=VARCHAR},
      period = #{record.period,jdbcType=INTEGER},
      source = #{record.source,jdbcType=VARCHAR},
      draft_code = #{record.draftCode,jdbcType=VARCHAR},
      draft_name = #{record.draftName,jdbcType=VARCHAR},
      large_attribute = #{record.largeAttribute,jdbcType=VARCHAR},
      attribute = #{record.attribute,jdbcType=VARCHAR},
      wp_position = #{record.wpPosition,jdbcType=VARCHAR},
      acct_code = #{record.acctCode,jdbcType=VARCHAR},
      account_name = #{record.accountName,jdbcType=VARCHAR},
      pl_row_set = #{record.plRowSet,jdbcType=VARCHAR},
      bs_row_set = #{record.bsRowSet,jdbcType=VARCHAR},
      fetch_number = #{record.fetchNumber,jdbcType=VARCHAR},
      remark = #{record.remark,jdbcType=VARCHAR},
      created_by = #{record.createdBy,jdbcType=VARCHAR},
      updated_by = #{record.updatedBy,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.entity.CitDraftAccountMapping">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update cit_draft_account_mapping
    <set>
      <if test="organizationId != null">
        organization_id = #{organizationId,jdbcType=VARCHAR},
      </if>
      <if test="projectId != null">
        project_id = #{projectId,jdbcType=VARCHAR},
      </if>
      <if test="period != null">
        period = #{period,jdbcType=INTEGER},
      </if>
      <if test="source != null">
        source = #{source,jdbcType=VARCHAR},
      </if>
      <if test="draftCode != null">
        draft_code = #{draftCode,jdbcType=VARCHAR},
      </if>
      <if test="draftName != null">
        draft_name = #{draftName,jdbcType=VARCHAR},
      </if>
      <if test="largeAttribute != null">
        large_attribute = #{largeAttribute,jdbcType=VARCHAR},
      </if>
      <if test="attribute != null">
        attribute = #{attribute,jdbcType=VARCHAR},
      </if>
      <if test="wpPosition != null">
        wp_position = #{wpPosition,jdbcType=VARCHAR},
      </if>
      <if test="acctCode != null">
        acct_code = #{acctCode,jdbcType=VARCHAR},
      </if>
      <if test="accountName != null">
        account_name = #{accountName,jdbcType=VARCHAR},
      </if>
      <if test="plRowSet != null">
        pl_row_set = #{plRowSet,jdbcType=VARCHAR},
      </if>
      <if test="bsRowSet != null">
        bs_row_set = #{bsRowSet,jdbcType=VARCHAR},
      </if>
      <if test="fetchNumber != null">
        fetch_number = #{fetchNumber,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="createdBy != null">
        created_by = #{createdBy,jdbcType=VARCHAR},
      </if>
      <if test="updatedBy != null">
        updated_by = #{updatedBy,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.entity.CitDraftAccountMapping">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update cit_draft_account_mapping
    set organization_id = #{organizationId,jdbcType=VARCHAR},
      project_id = #{projectId,jdbcType=VARCHAR},
      period = #{period,jdbcType=INTEGER},
      source = #{source,jdbcType=VARCHAR},
      draft_code = #{draftCode,jdbcType=VARCHAR},
      draft_name = #{draftName,jdbcType=VARCHAR},
      large_attribute = #{largeAttribute,jdbcType=VARCHAR},
      attribute = #{attribute,jdbcType=VARCHAR},
      wp_position = #{wpPosition,jdbcType=VARCHAR},
      acct_code = #{acctCode,jdbcType=VARCHAR},
      account_name = #{accountName,jdbcType=VARCHAR},
      pl_row_set = #{plRowSet,jdbcType=VARCHAR},
      bs_row_set = #{bsRowSet,jdbcType=VARCHAR},
      fetch_number = #{fetchNumber,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR},
      created_by = #{createdBy,jdbcType=VARCHAR},
      updated_by = #{updatedBy,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entity.CitDraftAccountMappingExample" 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 cit_draft_account_mapping
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>