<?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.ProjectMapper">
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.entity.Project">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="code" jdbcType="VARCHAR" property="code" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="year" jdbcType="INTEGER" property="year" />
    <result column="client_code" jdbcType="VARCHAR" property="clientCode" />
    <result column="is_active" jdbcType="BIT" property="isActive" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="region_id" jdbcType="VARCHAR" property="regionId" />
    <result column="industry_id" jdbcType="VARCHAR" property="industryId" />
    <result column="rule_type" jdbcType="INTEGER" property="ruleType" />
    <result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
    <result column="db_name" jdbcType="VARCHAR" property="dbName" />
    <result column="enterprise_account_set_id" jdbcType="VARCHAR" property="enterpriseAccountSetId" />
    <result column="start_period" jdbcType="INTEGER" property="startPeriod" />
    <result column="end_period" jdbcType="INTEGER" property="endPeriod" />
  </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, code, name, year, client_code, is_active, create_time, update_time, region_id, 
    industry_id, rule_type, organization_id, db_name, enterprise_account_set_id, start_period, 
    end_period
  </sql>
  <select id="selectByExample" parameterType="pwc.taxtech.atms.entity.ProjectExample" 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 project
    <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 project
    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 project
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.entity.ProjectExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from project
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="pwc.taxtech.atms.entity.Project">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into project (id, code, name, 
      year, client_code, is_active, 
      create_time, update_time, region_id, 
      industry_id, rule_type, organization_id, 
      db_name, enterprise_account_set_id, start_period, 
      end_period)
    values (#{id,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
      #{year,jdbcType=INTEGER}, #{clientCode,jdbcType=VARCHAR}, #{isActive,jdbcType=BIT}, 
      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{regionId,jdbcType=VARCHAR}, 
      #{industryId,jdbcType=VARCHAR}, #{ruleType,jdbcType=INTEGER}, #{organizationId,jdbcType=VARCHAR}, 
      #{dbName,jdbcType=VARCHAR}, #{enterpriseAccountSetId,jdbcType=VARCHAR}, #{startPeriod,jdbcType=INTEGER}, 
      #{endPeriod,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.Project">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into project
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="code != null">
        code,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="year != null">
        year,
      </if>
      <if test="clientCode != null">
        client_code,
      </if>
      <if test="isActive != null">
        is_active,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="regionId != null">
        region_id,
      </if>
      <if test="industryId != null">
        industry_id,
      </if>
      <if test="ruleType != null">
        rule_type,
      </if>
      <if test="organizationId != null">
        organization_id,
      </if>
      <if test="dbName != null">
        db_name,
      </if>
      <if test="enterpriseAccountSetId != null">
        enterprise_account_set_id,
      </if>
      <if test="startPeriod != null">
        start_period,
      </if>
      <if test="endPeriod != null">
        end_period,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="code != null">
        #{code,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="year != null">
        #{year,jdbcType=INTEGER},
      </if>
      <if test="clientCode != null">
        #{clientCode,jdbcType=VARCHAR},
      </if>
      <if test="isActive != null">
        #{isActive,jdbcType=BIT},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="regionId != null">
        #{regionId,jdbcType=VARCHAR},
      </if>
      <if test="industryId != null">
        #{industryId,jdbcType=VARCHAR},
      </if>
      <if test="ruleType != null">
        #{ruleType,jdbcType=INTEGER},
      </if>
      <if test="organizationId != null">
        #{organizationId,jdbcType=VARCHAR},
      </if>
      <if test="dbName != null">
        #{dbName,jdbcType=VARCHAR},
      </if>
      <if test="enterpriseAccountSetId != null">
        #{enterpriseAccountSetId,jdbcType=VARCHAR},
      </if>
      <if test="startPeriod != null">
        #{startPeriod,jdbcType=INTEGER},
      </if>
      <if test="endPeriod != null">
        #{endPeriod,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="pwc.taxtech.atms.entity.ProjectExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from project
    <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 project
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.code != null">
        code = #{record.code,jdbcType=VARCHAR},
      </if>
      <if test="record.name != null">
        name = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.year != null">
        year = #{record.year,jdbcType=INTEGER},
      </if>
      <if test="record.clientCode != null">
        client_code = #{record.clientCode,jdbcType=VARCHAR},
      </if>
      <if test="record.isActive != null">
        is_active = #{record.isActive,jdbcType=BIT},
      </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.regionId != null">
        region_id = #{record.regionId,jdbcType=VARCHAR},
      </if>
      <if test="record.industryId != null">
        industry_id = #{record.industryId,jdbcType=VARCHAR},
      </if>
      <if test="record.ruleType != null">
        rule_type = #{record.ruleType,jdbcType=INTEGER},
      </if>
      <if test="record.organizationId != null">
        organization_id = #{record.organizationId,jdbcType=VARCHAR},
      </if>
      <if test="record.dbName != null">
        db_name = #{record.dbName,jdbcType=VARCHAR},
      </if>
      <if test="record.enterpriseAccountSetId != null">
        enterprise_account_set_id = #{record.enterpriseAccountSetId,jdbcType=VARCHAR},
      </if>
      <if test="record.startPeriod != null">
        start_period = #{record.startPeriod,jdbcType=INTEGER},
      </if>
      <if test="record.endPeriod != null">
        end_period = #{record.endPeriod,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 project
    set id = #{record.id,jdbcType=VARCHAR},
      code = #{record.code,jdbcType=VARCHAR},
      name = #{record.name,jdbcType=VARCHAR},
      year = #{record.year,jdbcType=INTEGER},
      client_code = #{record.clientCode,jdbcType=VARCHAR},
      is_active = #{record.isActive,jdbcType=BIT},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      region_id = #{record.regionId,jdbcType=VARCHAR},
      industry_id = #{record.industryId,jdbcType=VARCHAR},
      rule_type = #{record.ruleType,jdbcType=INTEGER},
      organization_id = #{record.organizationId,jdbcType=VARCHAR},
      db_name = #{record.dbName,jdbcType=VARCHAR},
      enterprise_account_set_id = #{record.enterpriseAccountSetId,jdbcType=VARCHAR},
      start_period = #{record.startPeriod,jdbcType=INTEGER},
      end_period = #{record.endPeriod,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.entity.Project">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update project
    <set>
      <if test="code != null">
        code = #{code,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="year != null">
        year = #{year,jdbcType=INTEGER},
      </if>
      <if test="clientCode != null">
        client_code = #{clientCode,jdbcType=VARCHAR},
      </if>
      <if test="isActive != null">
        is_active = #{isActive,jdbcType=BIT},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="regionId != null">
        region_id = #{regionId,jdbcType=VARCHAR},
      </if>
      <if test="industryId != null">
        industry_id = #{industryId,jdbcType=VARCHAR},
      </if>
      <if test="ruleType != null">
        rule_type = #{ruleType,jdbcType=INTEGER},
      </if>
      <if test="organizationId != null">
        organization_id = #{organizationId,jdbcType=VARCHAR},
      </if>
      <if test="dbName != null">
        db_name = #{dbName,jdbcType=VARCHAR},
      </if>
      <if test="enterpriseAccountSetId != null">
        enterprise_account_set_id = #{enterpriseAccountSetId,jdbcType=VARCHAR},
      </if>
      <if test="startPeriod != null">
        start_period = #{startPeriod,jdbcType=INTEGER},
      </if>
      <if test="endPeriod != null">
        end_period = #{endPeriod,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.entity.Project">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update project
    set code = #{code,jdbcType=VARCHAR},
      name = #{name,jdbcType=VARCHAR},
      year = #{year,jdbcType=INTEGER},
      client_code = #{clientCode,jdbcType=VARCHAR},
      is_active = #{isActive,jdbcType=BIT},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      region_id = #{regionId,jdbcType=VARCHAR},
      industry_id = #{industryId,jdbcType=VARCHAR},
      rule_type = #{ruleType,jdbcType=INTEGER},
      organization_id = #{organizationId,jdbcType=VARCHAR},
      db_name = #{dbName,jdbcType=VARCHAR},
      enterprise_account_set_id = #{enterpriseAccountSetId,jdbcType=VARCHAR},
      start_period = #{startPeriod,jdbcType=INTEGER},
      end_period = #{endPeriod,jdbcType=INTEGER}
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entity.ProjectExample" 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 project
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>