<?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.OperationLogBasicDataMapper">
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.entitiy.OperationLogBasicData">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="ID" jdbcType="VARCHAR" property="ID" />
    <result column="OperationContent" jdbcType="VARCHAR" property="operationContent" />
    <result column="ModuleName" jdbcType="VARCHAR" property="moduleName" />
    <result column="OperationObject" jdbcType="VARCHAR" property="operationObject" />
    <result column="OperationAction" jdbcType="VARCHAR" property="operationAction" />
    <result column="OriginalState" jdbcType="VARCHAR" property="originalState" />
    <result column="UpdateState" jdbcType="VARCHAR" property="updateState" />
    <result column="OperationUser" jdbcType="VARCHAR" property="operationUser" />
    <result column="IP" jdbcType="VARCHAR" property="IP" />
    <result column="Comment" jdbcType="VARCHAR" property="comment" />
    <result column="CreateTime" jdbcType="TIMESTAMP" property="createTime" />
  </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, OperationContent, ModuleName, OperationObject, OperationAction, OriginalState, 
    UpdateState, OperationUser, IP, Comment, CreateTime
  </sql>
  <select id="selectByExample" parameterType="pwc.taxtech.atms.entitiy.OperationLogBasicDataExample" 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 OperationLogBasicData
    <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 OperationLogBasicData
    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 OperationLogBasicData
    where ID = #{ID,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.entitiy.OperationLogBasicDataExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from OperationLogBasicData
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="pwc.taxtech.atms.entitiy.OperationLogBasicData">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into OperationLogBasicData (ID, OperationContent, ModuleName, 
      OperationObject, OperationAction, OriginalState, 
      UpdateState, OperationUser, IP, 
      Comment, CreateTime)
    values (#{ID,jdbcType=VARCHAR}, #{operationContent,jdbcType=VARCHAR}, #{moduleName,jdbcType=VARCHAR}, 
      #{operationObject,jdbcType=VARCHAR}, #{operationAction,jdbcType=VARCHAR}, #{originalState,jdbcType=VARCHAR}, 
      #{updateState,jdbcType=VARCHAR}, #{operationUser,jdbcType=VARCHAR}, #{IP,jdbcType=VARCHAR}, 
      #{comment,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.entitiy.OperationLogBasicData">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into OperationLogBasicData
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="ID != null">
        ID,
      </if>
      <if test="operationContent != null">
        OperationContent,
      </if>
      <if test="moduleName != null">
        ModuleName,
      </if>
      <if test="operationObject != null">
        OperationObject,
      </if>
      <if test="operationAction != null">
        OperationAction,
      </if>
      <if test="originalState != null">
        OriginalState,
      </if>
      <if test="updateState != null">
        UpdateState,
      </if>
      <if test="operationUser != null">
        OperationUser,
      </if>
      <if test="IP != null">
        IP,
      </if>
      <if test="comment != null">
        Comment,
      </if>
      <if test="createTime != null">
        CreateTime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="ID != null">
        #{ID,jdbcType=VARCHAR},
      </if>
      <if test="operationContent != null">
        #{operationContent,jdbcType=VARCHAR},
      </if>
      <if test="moduleName != null">
        #{moduleName,jdbcType=VARCHAR},
      </if>
      <if test="operationObject != null">
        #{operationObject,jdbcType=VARCHAR},
      </if>
      <if test="operationAction != null">
        #{operationAction,jdbcType=VARCHAR},
      </if>
      <if test="originalState != null">
        #{originalState,jdbcType=VARCHAR},
      </if>
      <if test="updateState != null">
        #{updateState,jdbcType=VARCHAR},
      </if>
      <if test="operationUser != null">
        #{operationUser,jdbcType=VARCHAR},
      </if>
      <if test="IP != null">
        #{IP,jdbcType=VARCHAR},
      </if>
      <if test="comment != null">
        #{comment,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="pwc.taxtech.atms.entitiy.OperationLogBasicDataExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from OperationLogBasicData
    <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 OperationLogBasicData
    <set>
      <if test="record.ID != null">
        ID = #{record.ID,jdbcType=VARCHAR},
      </if>
      <if test="record.operationContent != null">
        OperationContent = #{record.operationContent,jdbcType=VARCHAR},
      </if>
      <if test="record.moduleName != null">
        ModuleName = #{record.moduleName,jdbcType=VARCHAR},
      </if>
      <if test="record.operationObject != null">
        OperationObject = #{record.operationObject,jdbcType=VARCHAR},
      </if>
      <if test="record.operationAction != null">
        OperationAction = #{record.operationAction,jdbcType=VARCHAR},
      </if>
      <if test="record.originalState != null">
        OriginalState = #{record.originalState,jdbcType=VARCHAR},
      </if>
      <if test="record.updateState != null">
        UpdateState = #{record.updateState,jdbcType=VARCHAR},
      </if>
      <if test="record.operationUser != null">
        OperationUser = #{record.operationUser,jdbcType=VARCHAR},
      </if>
      <if test="record.IP != null">
        IP = #{record.IP,jdbcType=VARCHAR},
      </if>
      <if test="record.comment != null">
        Comment = #{record.comment,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        CreateTime = #{record.createTime,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 OperationLogBasicData
    set ID = #{record.ID,jdbcType=VARCHAR},
      OperationContent = #{record.operationContent,jdbcType=VARCHAR},
      ModuleName = #{record.moduleName,jdbcType=VARCHAR},
      OperationObject = #{record.operationObject,jdbcType=VARCHAR},
      OperationAction = #{record.operationAction,jdbcType=VARCHAR},
      OriginalState = #{record.originalState,jdbcType=VARCHAR},
      UpdateState = #{record.updateState,jdbcType=VARCHAR},
      OperationUser = #{record.operationUser,jdbcType=VARCHAR},
      IP = #{record.IP,jdbcType=VARCHAR},
      Comment = #{record.comment,jdbcType=VARCHAR},
      CreateTime = #{record.createTime,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.entitiy.OperationLogBasicData">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update OperationLogBasicData
    <set>
      <if test="operationContent != null">
        OperationContent = #{operationContent,jdbcType=VARCHAR},
      </if>
      <if test="moduleName != null">
        ModuleName = #{moduleName,jdbcType=VARCHAR},
      </if>
      <if test="operationObject != null">
        OperationObject = #{operationObject,jdbcType=VARCHAR},
      </if>
      <if test="operationAction != null">
        OperationAction = #{operationAction,jdbcType=VARCHAR},
      </if>
      <if test="originalState != null">
        OriginalState = #{originalState,jdbcType=VARCHAR},
      </if>
      <if test="updateState != null">
        UpdateState = #{updateState,jdbcType=VARCHAR},
      </if>
      <if test="operationUser != null">
        OperationUser = #{operationUser,jdbcType=VARCHAR},
      </if>
      <if test="IP != null">
        IP = #{IP,jdbcType=VARCHAR},
      </if>
      <if test="comment != null">
        Comment = #{comment,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        CreateTime = #{createTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where ID = #{ID,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.entitiy.OperationLogBasicData">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update OperationLogBasicData
    set OperationContent = #{operationContent,jdbcType=VARCHAR},
      ModuleName = #{moduleName,jdbcType=VARCHAR},
      OperationObject = #{operationObject,jdbcType=VARCHAR},
      OperationAction = #{operationAction,jdbcType=VARCHAR},
      OriginalState = #{originalState,jdbcType=VARCHAR},
      UpdateState = #{updateState,jdbcType=VARCHAR},
      OperationUser = #{operationUser,jdbcType=VARCHAR},
      IP = #{IP,jdbcType=VARCHAR},
      Comment = #{comment,jdbcType=VARCHAR},
      CreateTime = #{createTime,jdbcType=TIMESTAMP}
    where ID = #{ID,jdbcType=VARCHAR}
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entitiy.OperationLogBasicDataExample" 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 OperationLogBasicData
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  
  <!--  TODO Remove below codes about selectByLimit -->
  <select id="selectByLimit" resultMap="BaseResultMap">
    SELECT top ${pagesize} *   
      from OperationLogBasicData  
        where id not in (  
          select top (${pagesize} * (${pageindex} -1)) id from OperationLogBasicData  
        )  
    order by id  
  </select>
  
   <insert id="insertSmart" parameterType="pwc.taxtech.atms.entitiy.OperationLogSmart">
    insert into ${tableName}
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="ID != null">
         ID,
       </if>
       <if test="operationContent != null">
         OperationContent,
       </if>
       <if test="moduleName != null">
         ModuleName,
       </if>
       <if test="operationObject != null">
         OperationObject,
       </if>
       <if test="operationAction != null">
         OperationAction,
       </if>
       <if test="originalState != null">
         OriginalState,
       </if>
       <if test="updateState != null">
         UpdateState,
       </if>
       <if test="operationUser != null">
         OperationUser,
       </if>
       <if test="IP != null">
         IP,
       </if>
       <if test="comment != null">
         Comment,
       </if>
       <if test="createTime != null">
         CreateTime,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="ID != null">
         #{ID,jdbcType=VARCHAR},
       </if>
       <if test="operationContent != null">
         #{operationContent,jdbcType=VARCHAR},
       </if>
       <if test="moduleName != null">
         #{moduleName,jdbcType=VARCHAR},
       </if>
       <if test="operationObject != null">
         #{operationObject,jdbcType=VARCHAR},
       </if>
       <if test="operationAction != null">
         #{operationAction,jdbcType=VARCHAR},
       </if>
       <if test="originalState != null">
         #{originalState,jdbcType=VARCHAR},
       </if>
       <if test="updateState != null">
         #{updateState,jdbcType=VARCHAR},
       </if>
       <if test="operationUser != null">
         #{operationUser,jdbcType=VARCHAR},
       </if>
       <if test="IP != null">
         #{IP,jdbcType=VARCHAR},
       </if>
       <if test="comment != null">
         #{comment,jdbcType=VARCHAR},
       </if>
       <if test="createTime != null">
         #{createTime,jdbcType=TIMESTAMP},
       </if>
     </trim>
  </insert>
  
  
  <select id="countByExampleSmart" parameterType="pwc.taxtech.atms.entitiy.OperationLogSmartExample" resultType="java.lang.Long">
    select count(*) from ${tableName}
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  
  
  <select id="selectByExampleWithRowboundsSmart" parameterType="pwc.taxtech.atms.entitiy.OperationLogSmartExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from ${tableName}
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>