<?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.MenuMapper">
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.entity.Menu">
    <!--
      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="route_state_name" jdbcType="VARCHAR" property="routeStateName" />
    <result column="navigation_url" jdbcType="VARCHAR" property="navigationUrl" />
    <result column="icon_class_name" jdbcType="VARCHAR" property="iconClassName" />
    <result column="parent_id" jdbcType="VARCHAR" property="parentId" />
    <result column="order_index" jdbcType="INTEGER" property="orderIndex" />
    <result column="is_active" jdbcType="BIT" property="isActive" />
    <result column="is_visible" jdbcType="BIT" property="isVisible" />
    <result column="service_type_id" jdbcType="VARCHAR" property="serviceTypeId" />
    <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, name, route_state_name, navigation_url, icon_class_name, parent_id, order_index, 
    is_active, is_visible, service_type_id, create_time, update_time
  </sql>
  <select id="selectByExample" parameterType="pwc.taxtech.atms.entity.MenuExample" 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 menu
    <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 menu
    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 menu
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.entity.MenuExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from menu
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="pwc.taxtech.atms.entity.Menu">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into menu (id, name, route_state_name, 
      navigation_url, icon_class_name, parent_id, 
      order_index, is_active, is_visible, 
      service_type_id, create_time, update_time
      )
    values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{routeStateName,jdbcType=VARCHAR}, 
      #{navigationUrl,jdbcType=VARCHAR}, #{iconClassName,jdbcType=VARCHAR}, #{parentId,jdbcType=VARCHAR}, 
      #{orderIndex,jdbcType=INTEGER}, #{isActive,jdbcType=BIT}, #{isVisible,jdbcType=BIT}, 
      #{serviceTypeId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.Menu">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into menu
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="routeStateName != null">
        route_state_name,
      </if>
      <if test="navigationUrl != null">
        navigation_url,
      </if>
      <if test="iconClassName != null">
        icon_class_name,
      </if>
      <if test="parentId != null">
        parent_id,
      </if>
      <if test="orderIndex != null">
        order_index,
      </if>
      <if test="isActive != null">
        is_active,
      </if>
      <if test="isVisible != null">
        is_visible,
      </if>
      <if test="serviceTypeId != null">
        service_type_id,
      </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=VARCHAR},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="routeStateName != null">
        #{routeStateName,jdbcType=VARCHAR},
      </if>
      <if test="navigationUrl != null">
        #{navigationUrl,jdbcType=VARCHAR},
      </if>
      <if test="iconClassName != null">
        #{iconClassName,jdbcType=VARCHAR},
      </if>
      <if test="parentId != null">
        #{parentId,jdbcType=VARCHAR},
      </if>
      <if test="orderIndex != null">
        #{orderIndex,jdbcType=INTEGER},
      </if>
      <if test="isActive != null">
        #{isActive,jdbcType=BIT},
      </if>
      <if test="isVisible != null">
        #{isVisible,jdbcType=BIT},
      </if>
      <if test="serviceTypeId != null">
        #{serviceTypeId,jdbcType=VARCHAR},
      </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.MenuExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from menu
    <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 menu
    <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.routeStateName != null">
        route_state_name = #{record.routeStateName,jdbcType=VARCHAR},
      </if>
      <if test="record.navigationUrl != null">
        navigation_url = #{record.navigationUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.iconClassName != null">
        icon_class_name = #{record.iconClassName,jdbcType=VARCHAR},
      </if>
      <if test="record.parentId != null">
        parent_id = #{record.parentId,jdbcType=VARCHAR},
      </if>
      <if test="record.orderIndex != null">
        order_index = #{record.orderIndex,jdbcType=INTEGER},
      </if>
      <if test="record.isActive != null">
        is_active = #{record.isActive,jdbcType=BIT},
      </if>
      <if test="record.isVisible != null">
        is_visible = #{record.isVisible,jdbcType=BIT},
      </if>
      <if test="record.serviceTypeId != null">
        service_type_id = #{record.serviceTypeId,jdbcType=VARCHAR},
      </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 menu
    set id = #{record.id,jdbcType=VARCHAR},
      name = #{record.name,jdbcType=VARCHAR},
      route_state_name = #{record.routeStateName,jdbcType=VARCHAR},
      navigation_url = #{record.navigationUrl,jdbcType=VARCHAR},
      icon_class_name = #{record.iconClassName,jdbcType=VARCHAR},
      parent_id = #{record.parentId,jdbcType=VARCHAR},
      order_index = #{record.orderIndex,jdbcType=INTEGER},
      is_active = #{record.isActive,jdbcType=BIT},
      is_visible = #{record.isVisible,jdbcType=BIT},
      service_type_id = #{record.serviceTypeId,jdbcType=VARCHAR},
      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.Menu">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update menu
    <set>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="routeStateName != null">
        route_state_name = #{routeStateName,jdbcType=VARCHAR},
      </if>
      <if test="navigationUrl != null">
        navigation_url = #{navigationUrl,jdbcType=VARCHAR},
      </if>
      <if test="iconClassName != null">
        icon_class_name = #{iconClassName,jdbcType=VARCHAR},
      </if>
      <if test="parentId != null">
        parent_id = #{parentId,jdbcType=VARCHAR},
      </if>
      <if test="orderIndex != null">
        order_index = #{orderIndex,jdbcType=INTEGER},
      </if>
      <if test="isActive != null">
        is_active = #{isActive,jdbcType=BIT},
      </if>
      <if test="isVisible != null">
        is_visible = #{isVisible,jdbcType=BIT},
      </if>
      <if test="serviceTypeId != null">
        service_type_id = #{serviceTypeId,jdbcType=VARCHAR},
      </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=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.entity.Menu">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update menu
    set name = #{name,jdbcType=VARCHAR},
      route_state_name = #{routeStateName,jdbcType=VARCHAR},
      navigation_url = #{navigationUrl,jdbcType=VARCHAR},
      icon_class_name = #{iconClassName,jdbcType=VARCHAR},
      parent_id = #{parentId,jdbcType=VARCHAR},
      order_index = #{orderIndex,jdbcType=INTEGER},
      is_active = #{isActive,jdbcType=BIT},
      is_visible = #{isVisible,jdbcType=BIT},
      service_type_id = #{serviceTypeId,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entity.MenuExample" 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 menu
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>