<?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.TemplateGroupMapper">
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.entitiy.TemplateGroup">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="ID" jdbcType="VARCHAR" property="ID" />
    <result column="Name" jdbcType="VARCHAR" property="name" />
    <result column="ServiceTypeID" jdbcType="VARCHAR" property="serviceTypeID" />
    <result column="IndustryIDs" jdbcType="VARCHAR" property="industryIDs" />
    <result column="PayTaxType" jdbcType="INTEGER" property="payTaxType" />
    <result column="GroupType" jdbcType="INTEGER" property="groupType" />
    <result column="CopyFrom" jdbcType="VARCHAR" property="copyFrom" />
    <result column="UpdateTime" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="CreateTime" jdbcType="TIMESTAMP" property="createTime" />
    <result column="IsSystemType" jdbcType="INTEGER" property="isSystemType" />
  </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, ServiceTypeID, IndustryIDs, PayTaxType, GroupType, CopyFrom, UpdateTime, 
    CreateTime, IsSystemType
  </sql>
  <select id="selectByExample" parameterType="pwc.taxtech.atms.entitiy.TemplateGroupExample" 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 TemplateGroup
    <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 TemplateGroup
    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 TemplateGroup
    where ID = #{ID,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.entitiy.TemplateGroupExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from TemplateGroup
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="pwc.taxtech.atms.entitiy.TemplateGroup">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into TemplateGroup (ID, Name, ServiceTypeID, 
      IndustryIDs, PayTaxType, GroupType, 
      CopyFrom, UpdateTime, CreateTime, 
      IsSystemType)
    values (#{ID,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{serviceTypeID,jdbcType=VARCHAR}, 
      #{industryIDs,jdbcType=VARCHAR}, #{payTaxType,jdbcType=INTEGER}, #{groupType,jdbcType=INTEGER}, 
      #{copyFrom,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, 
      #{isSystemType,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.entitiy.TemplateGroup">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into TemplateGroup
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="ID != null">
        ID,
      </if>
      <if test="name != null">
        Name,
      </if>
      <if test="serviceTypeID != null">
        ServiceTypeID,
      </if>
      <if test="industryIDs != null">
        IndustryIDs,
      </if>
      <if test="payTaxType != null">
        PayTaxType,
      </if>
      <if test="groupType != null">
        GroupType,
      </if>
      <if test="copyFrom != null">
        CopyFrom,
      </if>
      <if test="updateTime != null">
        UpdateTime,
      </if>
      <if test="createTime != null">
        CreateTime,
      </if>
      <if test="isSystemType != null">
        IsSystemType,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="ID != null">
        #{ID,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="serviceTypeID != null">
        #{serviceTypeID,jdbcType=VARCHAR},
      </if>
      <if test="industryIDs != null">
        #{industryIDs,jdbcType=VARCHAR},
      </if>
      <if test="payTaxType != null">
        #{payTaxType,jdbcType=INTEGER},
      </if>
      <if test="groupType != null">
        #{groupType,jdbcType=INTEGER},
      </if>
      <if test="copyFrom != null">
        #{copyFrom,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="isSystemType != null">
        #{isSystemType,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="pwc.taxtech.atms.entitiy.TemplateGroupExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from TemplateGroup
    <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 TemplateGroup
    <set>
      <if test="record.ID != null">
        ID = #{record.ID,jdbcType=VARCHAR},
      </if>
      <if test="record.name != null">
        Name = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.serviceTypeID != null">
        ServiceTypeID = #{record.serviceTypeID,jdbcType=VARCHAR},
      </if>
      <if test="record.industryIDs != null">
        IndustryIDs = #{record.industryIDs,jdbcType=VARCHAR},
      </if>
      <if test="record.payTaxType != null">
        PayTaxType = #{record.payTaxType,jdbcType=INTEGER},
      </if>
      <if test="record.groupType != null">
        GroupType = #{record.groupType,jdbcType=INTEGER},
      </if>
      <if test="record.copyFrom != null">
        CopyFrom = #{record.copyFrom,jdbcType=VARCHAR},
      </if>
      <if test="record.updateTime != null">
        UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createTime != null">
        CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.isSystemType != null">
        IsSystemType = #{record.isSystemType,jdbcType=INTEGER},
      </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 TemplateGroup
    set ID = #{record.ID,jdbcType=VARCHAR},
      Name = #{record.name,jdbcType=VARCHAR},
      ServiceTypeID = #{record.serviceTypeID,jdbcType=VARCHAR},
      IndustryIDs = #{record.industryIDs,jdbcType=VARCHAR},
      PayTaxType = #{record.payTaxType,jdbcType=INTEGER},
      GroupType = #{record.groupType,jdbcType=INTEGER},
      CopyFrom = #{record.copyFrom,jdbcType=VARCHAR},
      UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP},
      CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
      IsSystemType = #{record.isSystemType,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.entitiy.TemplateGroup">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update TemplateGroup
    <set>
      <if test="name != null">
        Name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="serviceTypeID != null">
        ServiceTypeID = #{serviceTypeID,jdbcType=VARCHAR},
      </if>
      <if test="industryIDs != null">
        IndustryIDs = #{industryIDs,jdbcType=VARCHAR},
      </if>
      <if test="payTaxType != null">
        PayTaxType = #{payTaxType,jdbcType=INTEGER},
      </if>
      <if test="groupType != null">
        GroupType = #{groupType,jdbcType=INTEGER},
      </if>
      <if test="copyFrom != null">
        CopyFrom = #{copyFrom,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        UpdateTime = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null">
        CreateTime = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="isSystemType != null">
        IsSystemType = #{isSystemType,jdbcType=INTEGER},
      </if>
    </set>
    where ID = #{ID,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.entitiy.TemplateGroup">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update TemplateGroup
    set Name = #{name,jdbcType=VARCHAR},
      ServiceTypeID = #{serviceTypeID,jdbcType=VARCHAR},
      IndustryIDs = #{industryIDs,jdbcType=VARCHAR},
      PayTaxType = #{payTaxType,jdbcType=INTEGER},
      GroupType = #{groupType,jdbcType=INTEGER},
      CopyFrom = #{copyFrom,jdbcType=VARCHAR},
      UpdateTime = #{updateTime,jdbcType=TIMESTAMP},
      CreateTime = #{createTime,jdbcType=TIMESTAMP},
      IsSystemType = #{isSystemType,jdbcType=INTEGER}
    where ID = #{ID,jdbcType=VARCHAR}
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entitiy.TemplateGroupExample" 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 TemplateGroup
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>