<?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.PeriodApproveMapper">
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.PeriodApprove">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="ID" jdbcType="VARCHAR" property="id" />
    <result column="PROJECT_ID" jdbcType="VARCHAR" property="projectId" />
    <result column="PERIOD" jdbcType="DECIMAL" property="period" />
    <result column="REPORT_IDS" jdbcType="VARCHAR" property="reportIds" />
    <result column="REPORT_PATHS" jdbcType="VARCHAR" property="reportPaths" />
    <result column="STATUS" jdbcType="VARCHAR" property="status" />
    <result column="INSTANCE_ID" jdbcType="VARCHAR" property="instanceId" />
    <result column="YEAR" jdbcType="DECIMAL" property="year" />
    <result column="TEMPLATE_IDS" jdbcType="VARCHAR" property="templateIds" />
    <result column="CREATE_BY" jdbcType="VARCHAR" property="createBy" />
    <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
    <result column="APPROVAL_BY" jdbcType="VARCHAR" property="approvalBy" />
    <result column="APPROVAL_TIME" jdbcType="TIMESTAMP" property="approvalTime" />
    <result column="APPROVAL_RESUALT" jdbcType="VARCHAR" property="approvalResualt" />
  </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, PROJECT_ID, PERIOD, REPORT_IDS, REPORT_PATHS, "STATUS", INSTANCE_ID, "YEAR", 
    TEMPLATE_IDS, CREATE_BY, CREATE_TIME, APPROVAL_BY, APPROVAL_TIME, APPROVAL_RESUALT
  </sql>
  <select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.PeriodApproveExample" 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 PERIOD_APPROVE
    <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.String" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from PERIOD_APPROVE
    where ID = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from PERIOD_APPROVE
    where ID = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.PeriodApproveExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from PERIOD_APPROVE
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="pwc.taxtech.atms.vat.entity.PeriodApprove">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into PERIOD_APPROVE (ID, PROJECT_ID, PERIOD, 
      REPORT_IDS, REPORT_PATHS, "STATUS", 
      INSTANCE_ID, "YEAR", TEMPLATE_IDS, 
      CREATE_BY, CREATE_TIME, APPROVAL_BY, 
      APPROVAL_TIME, APPROVAL_RESUALT)
    values (#{id,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, #{period,jdbcType=DECIMAL}, 
      #{reportIds,jdbcType=VARCHAR}, #{reportPaths,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, 
      #{instanceId,jdbcType=VARCHAR}, #{year,jdbcType=DECIMAL}, #{templateIds,jdbcType=VARCHAR}, 
      #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{approvalBy,jdbcType=VARCHAR}, 
      #{approvalTime,jdbcType=TIMESTAMP}, #{approvalResualt,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.PeriodApprove">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into PERIOD_APPROVE
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="projectId != null">
        PROJECT_ID,
      </if>
      <if test="period != null">
        PERIOD,
      </if>
      <if test="reportIds != null">
        REPORT_IDS,
      </if>
      <if test="reportPaths != null">
        REPORT_PATHS,
      </if>
      <if test="status != null">
        "STATUS",
      </if>
      <if test="instanceId != null">
        INSTANCE_ID,
      </if>
      <if test="year != null">
        "YEAR",
      </if>
      <if test="templateIds != null">
        TEMPLATE_IDS,
      </if>
      <if test="createBy != null">
        CREATE_BY,
      </if>
      <if test="createTime != null">
        CREATE_TIME,
      </if>
      <if test="approvalBy != null">
        APPROVAL_BY,
      </if>
      <if test="approvalTime != null">
        APPROVAL_TIME,
      </if>
      <if test="approvalResualt != null">
        APPROVAL_RESUALT,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="projectId != null">
        #{projectId,jdbcType=VARCHAR},
      </if>
      <if test="period != null">
        #{period,jdbcType=DECIMAL},
      </if>
      <if test="reportIds != null">
        #{reportIds,jdbcType=VARCHAR},
      </if>
      <if test="reportPaths != null">
        #{reportPaths,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="instanceId != null">
        #{instanceId,jdbcType=VARCHAR},
      </if>
      <if test="year != null">
        #{year,jdbcType=DECIMAL},
      </if>
      <if test="templateIds != null">
        #{templateIds,jdbcType=VARCHAR},
      </if>
      <if test="createBy != null">
        #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="approvalBy != null">
        #{approvalBy,jdbcType=VARCHAR},
      </if>
      <if test="approvalTime != null">
        #{approvalTime,jdbcType=TIMESTAMP},
      </if>
      <if test="approvalResualt != null">
        #{approvalResualt,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.PeriodApproveExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from PERIOD_APPROVE
    <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 PERIOD_APPROVE
    <set>
      <if test="record.id != null">
        ID = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.projectId != null">
        PROJECT_ID = #{record.projectId,jdbcType=VARCHAR},
      </if>
      <if test="record.period != null">
        PERIOD = #{record.period,jdbcType=DECIMAL},
      </if>
      <if test="record.reportIds != null">
        REPORT_IDS = #{record.reportIds,jdbcType=VARCHAR},
      </if>
      <if test="record.reportPaths != null">
        REPORT_PATHS = #{record.reportPaths,jdbcType=VARCHAR},
      </if>
      <if test="record.status != null">
        "STATUS" = #{record.status,jdbcType=VARCHAR},
      </if>
      <if test="record.instanceId != null">
        INSTANCE_ID = #{record.instanceId,jdbcType=VARCHAR},
      </if>
      <if test="record.year != null">
        "YEAR" = #{record.year,jdbcType=DECIMAL},
      </if>
      <if test="record.templateIds != null">
        TEMPLATE_IDS = #{record.templateIds,jdbcType=VARCHAR},
      </if>
      <if test="record.createBy != null">
        CREATE_BY = #{record.createBy,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.approvalBy != null">
        APPROVAL_BY = #{record.approvalBy,jdbcType=VARCHAR},
      </if>
      <if test="record.approvalTime != null">
        APPROVAL_TIME = #{record.approvalTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.approvalResualt != null">
        APPROVAL_RESUALT = #{record.approvalResualt,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 PERIOD_APPROVE
    set ID = #{record.id,jdbcType=VARCHAR},
      PROJECT_ID = #{record.projectId,jdbcType=VARCHAR},
      PERIOD = #{record.period,jdbcType=DECIMAL},
      REPORT_IDS = #{record.reportIds,jdbcType=VARCHAR},
      REPORT_PATHS = #{record.reportPaths,jdbcType=VARCHAR},
      "STATUS" = #{record.status,jdbcType=VARCHAR},
      INSTANCE_ID = #{record.instanceId,jdbcType=VARCHAR},
      "YEAR" = #{record.year,jdbcType=DECIMAL},
      TEMPLATE_IDS = #{record.templateIds,jdbcType=VARCHAR},
      CREATE_BY = #{record.createBy,jdbcType=VARCHAR},
      CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
      APPROVAL_BY = #{record.approvalBy,jdbcType=VARCHAR},
      APPROVAL_TIME = #{record.approvalTime,jdbcType=TIMESTAMP},
      APPROVAL_RESUALT = #{record.approvalResualt,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.vat.entity.PeriodApprove">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update PERIOD_APPROVE
    <set>
      <if test="projectId != null">
        PROJECT_ID = #{projectId,jdbcType=VARCHAR},
      </if>
      <if test="period != null">
        PERIOD = #{period,jdbcType=DECIMAL},
      </if>
      <if test="reportIds != null">
        REPORT_IDS = #{reportIds,jdbcType=VARCHAR},
      </if>
      <if test="reportPaths != null">
        REPORT_PATHS = #{reportPaths,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        "STATUS" = #{status,jdbcType=VARCHAR},
      </if>
      <if test="instanceId != null">
        INSTANCE_ID = #{instanceId,jdbcType=VARCHAR},
      </if>
      <if test="year != null">
        "YEAR" = #{year,jdbcType=DECIMAL},
      </if>
      <if test="templateIds != null">
        TEMPLATE_IDS = #{templateIds,jdbcType=VARCHAR},
      </if>
      <if test="createBy != null">
        CREATE_BY = #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="approvalBy != null">
        APPROVAL_BY = #{approvalBy,jdbcType=VARCHAR},
      </if>
      <if test="approvalTime != null">
        APPROVAL_TIME = #{approvalTime,jdbcType=TIMESTAMP},
      </if>
      <if test="approvalResualt != null">
        APPROVAL_RESUALT = #{approvalResualt,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.vat.entity.PeriodApprove">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update PERIOD_APPROVE
    set PROJECT_ID = #{projectId,jdbcType=VARCHAR},
      PERIOD = #{period,jdbcType=DECIMAL},
      REPORT_IDS = #{reportIds,jdbcType=VARCHAR},
      REPORT_PATHS = #{reportPaths,jdbcType=VARCHAR},
      "STATUS" = #{status,jdbcType=VARCHAR},
      INSTANCE_ID = #{instanceId,jdbcType=VARCHAR},
      "YEAR" = #{year,jdbcType=DECIMAL},
      TEMPLATE_IDS = #{templateIds,jdbcType=VARCHAR},
      CREATE_BY = #{createBy,jdbcType=VARCHAR},
      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      APPROVAL_BY = #{approvalBy,jdbcType=VARCHAR},
      APPROVAL_TIME = #{approvalTime,jdbcType=TIMESTAMP},
      APPROVAL_RESUALT = #{approvalResualt,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.PeriodApproveExample" 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 PERIOD_APPROVE
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>