<?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.CitAssetGroupResultMapper">
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.entity.CitAssetGroupResult">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="project_id" jdbcType="VARCHAR" property="projectId" />
    <result column="period" jdbcType="INTEGER" property="period" />
    <result column="asset_name" jdbcType="VARCHAR" property="assetName" />
    <result column="asset_group_id" jdbcType="BIGINT" property="assetGroupId" />
    <result column="asset_detail_group_id" jdbcType="BIGINT" property="assetDetailGroupId" />
    <result column="tax_depreciation_period" jdbcType="INTEGER" property="taxDepreciationPeriod" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  </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, asset_name, asset_group_id, asset_detail_group_id, tax_depreciation_period, 
    create_time, update_time
  </sql>
  <select id="selectByExample" parameterType="pwc.taxtech.atms.entity.CitAssetGroupResultExample" 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 asset_group_result
    <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 asset_group_result
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from asset_group_result
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.entity.CitAssetGroupResultExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from asset_group_result
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="pwc.taxtech.atms.entity.CitAssetGroupResult">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into asset_group_result (id, project_id, period, 
      asset_name, asset_group_id, asset_detail_group_id, 
      tax_depreciation_period, create_time, update_time
      )
    values (#{id,jdbcType=BIGINT}, #{projectId,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER}, 
      #{assetName,jdbcType=VARCHAR}, #{assetGroupId,jdbcType=BIGINT}, #{assetDetailGroupId,jdbcType=BIGINT}, 
      #{taxDepreciationPeriod,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.CitAssetGroupResult">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into asset_group_result
    <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="assetName != null">
        asset_name,
      </if>
      <if test="assetGroupId != null">
        asset_group_id,
      </if>
      <if test="assetDetailGroupId != null">
        asset_detail_group_id,
      </if>
      <if test="taxDepreciationPeriod != null">
        tax_depreciation_period,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="projectId != null">
        #{projectId,jdbcType=VARCHAR},
      </if>
      <if test="period != null">
        #{period,jdbcType=INTEGER},
      </if>
      <if test="assetName != null">
        #{assetName,jdbcType=VARCHAR},
      </if>
      <if test="assetGroupId != null">
        #{assetGroupId,jdbcType=BIGINT},
      </if>
      <if test="assetDetailGroupId != null">
        #{assetDetailGroupId,jdbcType=BIGINT},
      </if>
      <if test="taxDepreciationPeriod != null">
        #{taxDepreciationPeriod,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="pwc.taxtech.atms.entity.CitAssetGroupResultExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from asset_group_result
    <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 asset_group_result
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.projectId != null">
        project_id = #{record.projectId,jdbcType=VARCHAR},
      </if>
      <if test="record.period != null">
        period = #{record.period,jdbcType=INTEGER},
      </if>
      <if test="record.assetName != null">
        asset_name = #{record.assetName,jdbcType=VARCHAR},
      </if>
      <if test="record.assetGroupId != null">
        asset_group_id = #{record.assetGroupId,jdbcType=BIGINT},
      </if>
      <if test="record.assetDetailGroupId != null">
        asset_detail_group_id = #{record.assetDetailGroupId,jdbcType=BIGINT},
      </if>
      <if test="record.taxDepreciationPeriod != null">
        tax_depreciation_period = #{record.taxDepreciationPeriod,jdbcType=INTEGER},
      </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>
    </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 asset_group_result
    set id = #{record.id,jdbcType=BIGINT},
      project_id = #{record.projectId,jdbcType=VARCHAR},
      period = #{record.period,jdbcType=INTEGER},
      asset_name = #{record.assetName,jdbcType=VARCHAR},
      asset_group_id = #{record.assetGroupId,jdbcType=BIGINT},
      asset_detail_group_id = #{record.assetDetailGroupId,jdbcType=BIGINT},
      tax_depreciation_period = #{record.taxDepreciationPeriod,jdbcType=INTEGER},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.entity.CitAssetGroupResult">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update asset_group_result
    <set>
      <if test="projectId != null">
        project_id = #{projectId,jdbcType=VARCHAR},
      </if>
      <if test="period != null">
        period = #{period,jdbcType=INTEGER},
      </if>
      <if test="assetName != null">
        asset_name = #{assetName,jdbcType=VARCHAR},
      </if>
      <if test="assetGroupId != null">
        asset_group_id = #{assetGroupId,jdbcType=BIGINT},
      </if>
      <if test="assetDetailGroupId != null">
        asset_detail_group_id = #{assetDetailGroupId,jdbcType=BIGINT},
      </if>
      <if test="taxDepreciationPeriod != null">
        tax_depreciation_period = #{taxDepreciationPeriod,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.entity.CitAssetGroupResult">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update asset_group_result
    set project_id = #{projectId,jdbcType=VARCHAR},
      period = #{period,jdbcType=INTEGER},
      asset_name = #{assetName,jdbcType=VARCHAR},
      asset_group_id = #{assetGroupId,jdbcType=BIGINT},
      asset_detail_group_id = #{assetDetailGroupId,jdbcType=BIGINT},
      tax_depreciation_period = #{taxDepreciationPeriod,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entity.CitAssetGroupResultExample" 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 asset_group_result
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>