<?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.PeriodCellTemplateMapper">
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.PeriodCellTemplate">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="ID" jdbcType="DECIMAL" property="id" />
    <result column="PERIOD" jdbcType="DECIMAL" property="period" />
    <result column="REPORT_TEMPLATE_ID" jdbcType="DECIMAL" property="reportTemplateId" />
    <result column="ROW_INDEX" jdbcType="DECIMAL" property="rowIndex" />
    <result column="ROW_NAME" jdbcType="VARCHAR" property="rowName" />
    <result column="COLUMN_INDEX" jdbcType="DECIMAL" property="columnIndex" />
    <result column="COLUMN_NAME" jdbcType="VARCHAR" property="columnName" />
    <result column="COMMENT" jdbcType="VARCHAR" property="comment" />
    <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="CELL_TEMPLATE_ID" jdbcType="DECIMAL" property="cellTemplateId" />
    <result column="DATA_TYPE" jdbcType="DECIMAL" property="dataType" />
    <result column="IS_READ_ONLY" jdbcType="DECIMAL" property="isReadOnly" />
    <result column="COPY_FROM_ID" jdbcType="DECIMAL" property="copyFromId" />
    <result column="CREATE_BY" jdbcType="VARCHAR" property="createBy" />
    <result column="UPDATE_BY" jdbcType="VARCHAR" property="updateBy" />
    <result column="PROJECT_ID" jdbcType="VARCHAR" property="projectId" />
  </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, PERIOD, REPORT_TEMPLATE_ID, ROW_INDEX, ROW_NAME, COLUMN_INDEX, "COLUMN_NAME", 
    "COMMENT", CREATE_TIME, UPDATE_TIME, CELL_TEMPLATE_ID, DATA_TYPE, IS_READ_ONLY, COPY_FROM_ID, 
    CREATE_BY, UPDATE_BY, PROJECT_ID
  </sql>
  <select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.PeriodCellTemplateExample" 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_CELL_TEMPLATE
    <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 PERIOD_CELL_TEMPLATE
    where ID = #{id,jdbcType=DECIMAL}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from PERIOD_CELL_TEMPLATE
    where ID = #{id,jdbcType=DECIMAL}
  </delete>
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.PeriodCellTemplateExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from PERIOD_CELL_TEMPLATE
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="pwc.taxtech.atms.vat.entity.PeriodCellTemplate">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into PERIOD_CELL_TEMPLATE (ID, PERIOD, REPORT_TEMPLATE_ID, 
      ROW_INDEX, ROW_NAME, COLUMN_INDEX, 
      "COLUMN_NAME", "COMMENT", CREATE_TIME, 
      UPDATE_TIME, CELL_TEMPLATE_ID, DATA_TYPE, 
      IS_READ_ONLY, COPY_FROM_ID, CREATE_BY, 
      UPDATE_BY, PROJECT_ID)
    values (#{id,jdbcType=DECIMAL}, #{period,jdbcType=DECIMAL}, #{reportTemplateId,jdbcType=DECIMAL}, 
      #{rowIndex,jdbcType=DECIMAL}, #{rowName,jdbcType=VARCHAR}, #{columnIndex,jdbcType=DECIMAL}, 
      #{columnName,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{updateTime,jdbcType=TIMESTAMP}, #{cellTemplateId,jdbcType=DECIMAL}, #{dataType,jdbcType=DECIMAL}, 
      #{isReadOnly,jdbcType=DECIMAL}, #{copyFromId,jdbcType=DECIMAL}, #{createBy,jdbcType=VARCHAR}, 
      #{updateBy,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.PeriodCellTemplate">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into PERIOD_CELL_TEMPLATE
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="period != null">
        PERIOD,
      </if>
      <if test="reportTemplateId != null">
        REPORT_TEMPLATE_ID,
      </if>
      <if test="rowIndex != null">
        ROW_INDEX,
      </if>
      <if test="rowName != null">
        ROW_NAME,
      </if>
      <if test="columnIndex != null">
        COLUMN_INDEX,
      </if>
      <if test="columnName != null">
        "COLUMN_NAME",
      </if>
      <if test="comment != null">
        "COMMENT",
      </if>
      <if test="createTime != null">
        CREATE_TIME,
      </if>
      <if test="updateTime != null">
        UPDATE_TIME,
      </if>
      <if test="cellTemplateId != null">
        CELL_TEMPLATE_ID,
      </if>
      <if test="dataType != null">
        DATA_TYPE,
      </if>
      <if test="isReadOnly != null">
        IS_READ_ONLY,
      </if>
      <if test="copyFromId != null">
        COPY_FROM_ID,
      </if>
      <if test="createBy != null">
        CREATE_BY,
      </if>
      <if test="updateBy != null">
        UPDATE_BY,
      </if>
      <if test="projectId != null">
        PROJECT_ID,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=DECIMAL},
      </if>
      <if test="period != null">
        #{period,jdbcType=DECIMAL},
      </if>
      <if test="reportTemplateId != null">
        #{reportTemplateId,jdbcType=DECIMAL},
      </if>
      <if test="rowIndex != null">
        #{rowIndex,jdbcType=DECIMAL},
      </if>
      <if test="rowName != null">
        #{rowName,jdbcType=VARCHAR},
      </if>
      <if test="columnIndex != null">
        #{columnIndex,jdbcType=DECIMAL},
      </if>
      <if test="columnName != null">
        #{columnName,jdbcType=VARCHAR},
      </if>
      <if test="comment != null">
        #{comment,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="cellTemplateId != null">
        #{cellTemplateId,jdbcType=DECIMAL},
      </if>
      <if test="dataType != null">
        #{dataType,jdbcType=DECIMAL},
      </if>
      <if test="isReadOnly != null">
        #{isReadOnly,jdbcType=DECIMAL},
      </if>
      <if test="copyFromId != null">
        #{copyFromId,jdbcType=DECIMAL},
      </if>
      <if test="createBy != null">
        #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="updateBy != null">
        #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="projectId != null">
        #{projectId,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.PeriodCellTemplateExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from PERIOD_CELL_TEMPLATE
    <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_CELL_TEMPLATE
    <set>
      <if test="record.id != null">
        ID = #{record.id,jdbcType=DECIMAL},
      </if>
      <if test="record.period != null">
        PERIOD = #{record.period,jdbcType=DECIMAL},
      </if>
      <if test="record.reportTemplateId != null">
        REPORT_TEMPLATE_ID = #{record.reportTemplateId,jdbcType=DECIMAL},
      </if>
      <if test="record.rowIndex != null">
        ROW_INDEX = #{record.rowIndex,jdbcType=DECIMAL},
      </if>
      <if test="record.rowName != null">
        ROW_NAME = #{record.rowName,jdbcType=VARCHAR},
      </if>
      <if test="record.columnIndex != null">
        COLUMN_INDEX = #{record.columnIndex,jdbcType=DECIMAL},
      </if>
      <if test="record.columnName != null">
        "COLUMN_NAME" = #{record.columnName,jdbcType=VARCHAR},
      </if>
      <if test="record.comment != null">
        "COMMENT" = #{record.comment,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>
      <if test="record.cellTemplateId != null">
        CELL_TEMPLATE_ID = #{record.cellTemplateId,jdbcType=DECIMAL},
      </if>
      <if test="record.dataType != null">
        DATA_TYPE = #{record.dataType,jdbcType=DECIMAL},
      </if>
      <if test="record.isReadOnly != null">
        IS_READ_ONLY = #{record.isReadOnly,jdbcType=DECIMAL},
      </if>
      <if test="record.copyFromId != null">
        COPY_FROM_ID = #{record.copyFromId,jdbcType=DECIMAL},
      </if>
      <if test="record.createBy != null">
        CREATE_BY = #{record.createBy,jdbcType=VARCHAR},
      </if>
      <if test="record.updateBy != null">
        UPDATE_BY = #{record.updateBy,jdbcType=VARCHAR},
      </if>
      <if test="record.projectId != null">
        PROJECT_ID = #{record.projectId,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_CELL_TEMPLATE
    set ID = #{record.id,jdbcType=DECIMAL},
      PERIOD = #{record.period,jdbcType=DECIMAL},
      REPORT_TEMPLATE_ID = #{record.reportTemplateId,jdbcType=DECIMAL},
      ROW_INDEX = #{record.rowIndex,jdbcType=DECIMAL},
      ROW_NAME = #{record.rowName,jdbcType=VARCHAR},
      COLUMN_INDEX = #{record.columnIndex,jdbcType=DECIMAL},
      "COLUMN_NAME" = #{record.columnName,jdbcType=VARCHAR},
      "COMMENT" = #{record.comment,jdbcType=VARCHAR},
      CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
      UPDATE_TIME = #{record.updateTime,jdbcType=TIMESTAMP},
      CELL_TEMPLATE_ID = #{record.cellTemplateId,jdbcType=DECIMAL},
      DATA_TYPE = #{record.dataType,jdbcType=DECIMAL},
      IS_READ_ONLY = #{record.isReadOnly,jdbcType=DECIMAL},
      COPY_FROM_ID = #{record.copyFromId,jdbcType=DECIMAL},
      CREATE_BY = #{record.createBy,jdbcType=VARCHAR},
      UPDATE_BY = #{record.updateBy,jdbcType=VARCHAR},
      PROJECT_ID = #{record.projectId,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.vat.entity.PeriodCellTemplate">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update PERIOD_CELL_TEMPLATE
    <set>
      <if test="period != null">
        PERIOD = #{period,jdbcType=DECIMAL},
      </if>
      <if test="reportTemplateId != null">
        REPORT_TEMPLATE_ID = #{reportTemplateId,jdbcType=DECIMAL},
      </if>
      <if test="rowIndex != null">
        ROW_INDEX = #{rowIndex,jdbcType=DECIMAL},
      </if>
      <if test="rowName != null">
        ROW_NAME = #{rowName,jdbcType=VARCHAR},
      </if>
      <if test="columnIndex != null">
        COLUMN_INDEX = #{columnIndex,jdbcType=DECIMAL},
      </if>
      <if test="columnName != null">
        "COLUMN_NAME" = #{columnName,jdbcType=VARCHAR},
      </if>
      <if test="comment != null">
        "COMMENT" = #{comment,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="cellTemplateId != null">
        CELL_TEMPLATE_ID = #{cellTemplateId,jdbcType=DECIMAL},
      </if>
      <if test="dataType != null">
        DATA_TYPE = #{dataType,jdbcType=DECIMAL},
      </if>
      <if test="isReadOnly != null">
        IS_READ_ONLY = #{isReadOnly,jdbcType=DECIMAL},
      </if>
      <if test="copyFromId != null">
        COPY_FROM_ID = #{copyFromId,jdbcType=DECIMAL},
      </if>
      <if test="createBy != null">
        CREATE_BY = #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="updateBy != null">
        UPDATE_BY = #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="projectId != null">
        PROJECT_ID = #{projectId,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=DECIMAL}
  </update>
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.vat.entity.PeriodCellTemplate">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update PERIOD_CELL_TEMPLATE
    set PERIOD = #{period,jdbcType=DECIMAL},
      REPORT_TEMPLATE_ID = #{reportTemplateId,jdbcType=DECIMAL},
      ROW_INDEX = #{rowIndex,jdbcType=DECIMAL},
      ROW_NAME = #{rowName,jdbcType=VARCHAR},
      COLUMN_INDEX = #{columnIndex,jdbcType=DECIMAL},
      "COLUMN_NAME" = #{columnName,jdbcType=VARCHAR},
      "COMMENT" = #{comment,jdbcType=VARCHAR},
      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
      CELL_TEMPLATE_ID = #{cellTemplateId,jdbcType=DECIMAL},
      DATA_TYPE = #{dataType,jdbcType=DECIMAL},
      IS_READ_ONLY = #{isReadOnly,jdbcType=DECIMAL},
      COPY_FROM_ID = #{copyFromId,jdbcType=DECIMAL},
      CREATE_BY = #{createBy,jdbcType=VARCHAR},
      UPDATE_BY = #{updateBy,jdbcType=VARCHAR},
      PROJECT_ID = #{projectId,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=DECIMAL}
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.PeriodCellTemplateExample" 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_CELL_TEMPLATE
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>