<?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.TemplateMapper">
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.entity.Template">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="ID" jdbcType="DECIMAL" property="id" />
    <result column="NAME" jdbcType="VARCHAR" property="name" />
    <result column="CODE" jdbcType="VARCHAR" property="code" />
    <result column="PATH" jdbcType="VARCHAR" property="path" />
    <result column="REPORT_TYPE" jdbcType="DECIMAL" property="reportType" />
    <result column="TEMPLATE_GROUP_ID" jdbcType="DECIMAL" property="templateGroupId" />
    <result column="ORDER_INDEX" jdbcType="DECIMAL" property="orderIndex" />
    <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="IS_SYSTEM_TYPE" jdbcType="DECIMAL" property="isSystemType" />
    <result column="IS_ACTIVE_ASSOCIATION" jdbcType="DECIMAL" property="isActiveAssociation" />
    <result column="PARENT_ID" jdbcType="VARCHAR" property="parentId" />
    <result column="CREATE_BY" jdbcType="VARCHAR" property="createBy" />
    <result column="UPDATE_BY" jdbcType="VARCHAR" property="updateBy" />
  </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, "NAME", CODE, "PATH", REPORT_TYPE, TEMPLATE_GROUP_ID, ORDER_INDEX, CREATE_TIME, 
    UPDATE_TIME, IS_SYSTEM_TYPE, IS_ACTIVE_ASSOCIATION, PARENT_ID, CREATE_BY, UPDATE_BY
  </sql>
  <select id="selectByExample" parameterType="pwc.taxtech.atms.entity.TemplateExample" 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 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 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 TEMPLATE
    where ID = #{id,jdbcType=DECIMAL}
  </delete>
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.entity.TemplateExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from TEMPLATE
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="pwc.taxtech.atms.entity.Template">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into TEMPLATE (ID, "NAME", CODE, 
      "PATH", REPORT_TYPE, TEMPLATE_GROUP_ID, 
      ORDER_INDEX, CREATE_TIME, UPDATE_TIME, 
      IS_SYSTEM_TYPE, IS_ACTIVE_ASSOCIATION, PARENT_ID, 
      CREATE_BY, UPDATE_BY)
    values (#{id,jdbcType=DECIMAL}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, 
      #{path,jdbcType=VARCHAR}, #{reportType,jdbcType=DECIMAL}, #{templateGroupId,jdbcType=DECIMAL}, 
      #{orderIndex,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, 
      #{isSystemType,jdbcType=DECIMAL}, #{isActiveAssociation,jdbcType=DECIMAL}, #{parentId,jdbcType=VARCHAR}, 
      #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.Template">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into TEMPLATE
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="name != null">
        "NAME",
      </if>
      <if test="code != null">
        CODE,
      </if>
      <if test="path != null">
        "PATH",
      </if>
      <if test="reportType != null">
        REPORT_TYPE,
      </if>
      <if test="templateGroupId != null">
        TEMPLATE_GROUP_ID,
      </if>
      <if test="orderIndex != null">
        ORDER_INDEX,
      </if>
      <if test="createTime != null">
        CREATE_TIME,
      </if>
      <if test="updateTime != null">
        UPDATE_TIME,
      </if>
      <if test="isSystemType != null">
        IS_SYSTEM_TYPE,
      </if>
      <if test="isActiveAssociation != null">
        IS_ACTIVE_ASSOCIATION,
      </if>
      <if test="parentId != null">
        PARENT_ID,
      </if>
      <if test="createBy != null">
        CREATE_BY,
      </if>
      <if test="updateBy != null">
        UPDATE_BY,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=DECIMAL},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="code != null">
        #{code,jdbcType=VARCHAR},
      </if>
      <if test="path != null">
        #{path,jdbcType=VARCHAR},
      </if>
      <if test="reportType != null">
        #{reportType,jdbcType=DECIMAL},
      </if>
      <if test="templateGroupId != null">
        #{templateGroupId,jdbcType=DECIMAL},
      </if>
      <if test="orderIndex != null">
        #{orderIndex,jdbcType=DECIMAL},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="isSystemType != null">
        #{isSystemType,jdbcType=DECIMAL},
      </if>
      <if test="isActiveAssociation != null">
        #{isActiveAssociation,jdbcType=DECIMAL},
      </if>
      <if test="parentId != null">
        #{parentId,jdbcType=VARCHAR},
      </if>
      <if test="createBy != null">
        #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="updateBy != null">
        #{updateBy,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="pwc.taxtech.atms.entity.TemplateExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from 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 TEMPLATE
    <set>
      <if test="record.id != null">
        ID = #{record.id,jdbcType=DECIMAL},
      </if>
      <if test="record.name != null">
        "NAME" = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.code != null">
        CODE = #{record.code,jdbcType=VARCHAR},
      </if>
      <if test="record.path != null">
        "PATH" = #{record.path,jdbcType=VARCHAR},
      </if>
      <if test="record.reportType != null">
        REPORT_TYPE = #{record.reportType,jdbcType=DECIMAL},
      </if>
      <if test="record.templateGroupId != null">
        TEMPLATE_GROUP_ID = #{record.templateGroupId,jdbcType=DECIMAL},
      </if>
      <if test="record.orderIndex != null">
        ORDER_INDEX = #{record.orderIndex,jdbcType=DECIMAL},
      </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.isSystemType != null">
        IS_SYSTEM_TYPE = #{record.isSystemType,jdbcType=DECIMAL},
      </if>
      <if test="record.isActiveAssociation != null">
        IS_ACTIVE_ASSOCIATION = #{record.isActiveAssociation,jdbcType=DECIMAL},
      </if>
      <if test="record.parentId != null">
        PARENT_ID = #{record.parentId,jdbcType=VARCHAR},
      </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>
    </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 TEMPLATE
    set ID = #{record.id,jdbcType=DECIMAL},
      "NAME" = #{record.name,jdbcType=VARCHAR},
      CODE = #{record.code,jdbcType=VARCHAR},
      "PATH" = #{record.path,jdbcType=VARCHAR},
      REPORT_TYPE = #{record.reportType,jdbcType=DECIMAL},
      TEMPLATE_GROUP_ID = #{record.templateGroupId,jdbcType=DECIMAL},
      ORDER_INDEX = #{record.orderIndex,jdbcType=DECIMAL},
      CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
      UPDATE_TIME = #{record.updateTime,jdbcType=TIMESTAMP},
      IS_SYSTEM_TYPE = #{record.isSystemType,jdbcType=DECIMAL},
      IS_ACTIVE_ASSOCIATION = #{record.isActiveAssociation,jdbcType=DECIMAL},
      PARENT_ID = #{record.parentId,jdbcType=VARCHAR},
      CREATE_BY = #{record.createBy,jdbcType=VARCHAR},
      UPDATE_BY = #{record.updateBy,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.entity.Template">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update TEMPLATE
    <set>
      <if test="name != null">
        "NAME" = #{name,jdbcType=VARCHAR},
      </if>
      <if test="code != null">
        CODE = #{code,jdbcType=VARCHAR},
      </if>
      <if test="path != null">
        "PATH" = #{path,jdbcType=VARCHAR},
      </if>
      <if test="reportType != null">
        REPORT_TYPE = #{reportType,jdbcType=DECIMAL},
      </if>
      <if test="templateGroupId != null">
        TEMPLATE_GROUP_ID = #{templateGroupId,jdbcType=DECIMAL},
      </if>
      <if test="orderIndex != null">
        ORDER_INDEX = #{orderIndex,jdbcType=DECIMAL},
      </if>
      <if test="createTime != null">
        CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="isSystemType != null">
        IS_SYSTEM_TYPE = #{isSystemType,jdbcType=DECIMAL},
      </if>
      <if test="isActiveAssociation != null">
        IS_ACTIVE_ASSOCIATION = #{isActiveAssociation,jdbcType=DECIMAL},
      </if>
      <if test="parentId != null">
        PARENT_ID = #{parentId,jdbcType=VARCHAR},
      </if>
      <if test="createBy != null">
        CREATE_BY = #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="updateBy != null">
        UPDATE_BY = #{updateBy,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=DECIMAL}
  </update>
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.entity.Template">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update TEMPLATE
    set "NAME" = #{name,jdbcType=VARCHAR},
      CODE = #{code,jdbcType=VARCHAR},
      "PATH" = #{path,jdbcType=VARCHAR},
      REPORT_TYPE = #{reportType,jdbcType=DECIMAL},
      TEMPLATE_GROUP_ID = #{templateGroupId,jdbcType=DECIMAL},
      ORDER_INDEX = #{orderIndex,jdbcType=DECIMAL},
      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
      IS_SYSTEM_TYPE = #{isSystemType,jdbcType=DECIMAL},
      IS_ACTIVE_ASSOCIATION = #{isActiveAssociation,jdbcType=DECIMAL},
      PARENT_ID = #{parentId,jdbcType=VARCHAR},
      CREATE_BY = #{createBy,jdbcType=VARCHAR},
      UPDATE_BY = #{updateBy,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=DECIMAL}
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entity.TemplateExample" 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 TEMPLATE
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>