<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
		"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.base.system.menu.dao.ibatis.MenuDaoImpl">

	<!-- 字段和属性映射 -->
	<resultMap type="MenuEntity" id="MenuEntity-Map">
		<id  property="id" column="id" />
		<result property="name" column="name" />
		<result property="url" column="url" />
		<result property="ancestors" column="ancestors" />
		<result property="parentId" column="parentId" />
		<result property="orderId" column="orderId" />
		<result property="status" column="status" />
		<result property="linkType" column="linkType" />
		<result property="groupId" column="groupId" />
		<result property="groupName" column="groupName" />
		<result property="imgPath" column="imgPath" />
		<result property="buttonImgPath" column="buttonImgPath" />
		<result property="imgCommPath" column="imgCommPath" />
		<result property="commMenu" column="commMenu" />
		<result property="menuType" column="menuType" />
		<result property="authType" column="authType" />
		<result property="createTime" column="createTime" />
		<result property="createUserId" column="createUserId" />
		<result property="createUserName" column="createUserName" />

	</resultMap>


	<!-- 表所有列 -->
	<sql id="_columns">
		<trim suffixOverrides="," suffix="">
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))">
				a.id,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('name') or colPickMode == 1 and data.containsKey('name')))">
				a.name,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('url') or colPickMode == 1 and data.containsKey('url')))">
				a.url,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('ancestors') or colPickMode == 1 and data.containsKey('ancestors')))">
				a.ancestors,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('parentId') or colPickMode == 1 and data.containsKey('parentId')))">
				a.parentId,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('orderId') or colPickMode == 1 and data.containsKey('orderId')))">
				a.orderId,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('status') or colPickMode == 1 and data.containsKey('status')))">
				a.status,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('linkType') or colPickMode == 1 and data.containsKey('linkType')))">
				a.linkType,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('groupId') or colPickMode == 1 and data.containsKey('groupId')))">
				a.groupId,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('groupName') or colPickMode == 1 and data.containsKey('groupName')))">
				a.groupName,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('imgPath') or colPickMode == 1 and data.containsKey('imgPath')))">
				a.imgPath,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('buttonImgPath') or colPickMode == 1 and data.containsKey('buttonImgPath')))">
				a.buttonImgPath,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('imgCommPath') or colPickMode == 1 and data.containsKey('imgCommPath')))">
				a.imgCommPath,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('commMenu') or colPickMode == 1 and data.containsKey('commMenu')))">
				a.commMenu,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('menuType') or colPickMode == 1 and data.containsKey('menuType')))">
				a.menuType,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('authType') or colPickMode == 1 and data.containsKey('authType')))">
				a.authType,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
				a.createTime,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createUserId') or colPickMode == 1 and data.containsKey('createUserId')))">
				a.createUserId,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createUserName') or colPickMode == 1 and data.containsKey('createUserName')))">
				a.createUserName,
			</if>
		</trim>
	</sql>
	<!-- 新增 区分主键自增加还是业务插入 -->
	<insert id="insert" parameterType="MenuEntity"  useGeneratedKeys="true" keyProperty="id">
		insert into mortals_xhx_menu
		(name,url,ancestors,parentId,orderId,status,linkType,groupId,groupName,imgPath,buttonImgPath,imgCommPath,commMenu,menuType,authType,createTime,createUserId,createUserName)
		VALUES
		(#{name},#{url},#{ancestors},#{parentId},#{orderId},#{status},#{linkType},#{groupId},#{groupName},#{imgPath},#{buttonImgPath},#{imgCommPath},#{commMenu},#{menuType},#{authType},#{createTime},#{createUserId},#{createUserName})
	</insert>

	<!-- 批量新增 -->
	<insert id="insertBatch" parameterType="paramDto">
		insert into mortals_xhx_menu
		(name,url,ancestors,parentId,orderId,status,linkType,groupId,groupName,imgPath,buttonImgPath,imgCommPath,commMenu,menuType,authType,createTime,createUserId,createUserName)
		VALUES
		<foreach collection="data.dataList" item="item" index="index" separator="," >
			(#{item.name},#{item.url},#{item.ancestors},#{item.parentId},#{item.orderId},#{item.status},#{item.linkType},#{item.groupId},#{item.groupName},#{item.imgPath},#{item.buttonImgPath},#{item.imgCommPath},#{item.commMenu},#{item.menuType},#{item.authType},#{item.createTime},#{item.createUserId},#{item.createUserName})
		</foreach>
	</insert>


	<!-- 根据ParamDto更新 -->
	<update id="update" parameterType="paramDto">
		update mortals_xhx_menu as a
		set
		<trim suffixOverrides="," suffix="">
			<if test="(colPickMode==0 and data.containsKey('name')) or (colPickMode==1 and !data.containsKey('name'))">
				a.name=#{data.name},
			</if>
			<if test="(colPickMode==0 and data.containsKey('url')) or (colPickMode==1 and !data.containsKey('url'))">
				a.url=#{data.url},
			</if>
			<if test="(colPickMode==0 and data.containsKey('ancestors')) or (colPickMode==1 and !data.containsKey('ancestors'))">
				a.ancestors=#{data.ancestors},
			</if>
			<if test="(colPickMode==0 and data.containsKey('parentId')) or (colPickMode==1 and !data.containsKey('parentId'))">
				a.parentId=#{data.parentId},
			</if>
			<if test="(colPickMode==0 and data.containsKey('parentIdIncrement')) or (colPickMode==1 and !data.containsKey('parentIdIncrement'))">
				a.parentId=ifnull(a.parentId,0) + #{data.parentIdIncrement},
			</if>
			<if test="(colPickMode==0 and data.containsKey('orderId')) or (colPickMode==1 and !data.containsKey('orderId'))">
				a.orderId=#{data.orderId},
			</if>
			<if test="(colPickMode==0 and data.containsKey('orderIdIncrement')) or (colPickMode==1 and !data.containsKey('orderIdIncrement'))">
				a.orderId=ifnull(a.orderId,0) + #{data.orderIdIncrement},
			</if>
			<if test="(colPickMode==0 and data.containsKey('status')) or (colPickMode==1 and !data.containsKey('status'))">
				a.status=#{data.status},
			</if>
			<if test="(colPickMode==0 and data.containsKey('statusIncrement')) or (colPickMode==1 and !data.containsKey('statusIncrement'))">
				a.status=ifnull(a.status,0) + #{data.statusIncrement},
			</if>
			<if test="(colPickMode==0 and data.containsKey('linkType')) or (colPickMode==1 and !data.containsKey('linkType'))">
				a.linkType=#{data.linkType},
			</if>
			<if test="(colPickMode==0 and data.containsKey('linkTypeIncrement')) or (colPickMode==1 and !data.containsKey('linkTypeIncrement'))">
				a.linkType=ifnull(a.linkType,0) + #{data.linkTypeIncrement},
			</if>
			<if test="(colPickMode==0 and data.containsKey('groupId')) or (colPickMode==1 and !data.containsKey('groupId'))">
				a.groupId=#{data.groupId},
			</if>
			<if test="(colPickMode==0 and data.containsKey('groupIdIncrement')) or (colPickMode==1 and !data.containsKey('groupIdIncrement'))">
				a.groupId=ifnull(a.groupId,0) + #{data.groupIdIncrement},
			</if>
			<if test="(colPickMode==0 and data.containsKey('groupName')) or (colPickMode==1 and !data.containsKey('groupName'))">
				a.groupName=#{data.groupName},
			</if>
			<if test="(colPickMode==0 and data.containsKey('imgPath')) or (colPickMode==1 and !data.containsKey('imgPath'))">
				a.imgPath=#{data.imgPath},
			</if>
			<if test="(colPickMode==0 and data.containsKey('buttonImgPath')) or (colPickMode==1 and !data.containsKey('buttonImgPath'))">
				a.buttonImgPath=#{data.buttonImgPath},
			</if>
			<if test="(colPickMode==0 and data.containsKey('imgCommPath')) or (colPickMode==1 and !data.containsKey('imgCommPath'))">
				a.imgCommPath=#{data.imgCommPath},
			</if>
			<if test="(colPickMode==0 and data.containsKey('commMenu')) or (colPickMode==1 and !data.containsKey('commMenu'))">
				a.commMenu=#{data.commMenu},
			</if>
			<if test="(colPickMode==0 and data.containsKey('commMenuIncrement')) or (colPickMode==1 and !data.containsKey('commMenuIncrement'))">
				a.commMenu=ifnull(a.commMenu,0) + #{data.commMenuIncrement},
			</if>
			<if test="(colPickMode==0 and data.containsKey('menuType')) or (colPickMode==1 and !data.containsKey('menuType'))">
				a.menuType=#{data.menuType},
			</if>
			<if test="(colPickMode==0 and data.containsKey('menuTypeIncrement')) or (colPickMode==1 and !data.containsKey('menuTypeIncrement'))">
				a.menuType=ifnull(a.menuType,0) + #{data.menuTypeIncrement},
			</if>
			<if test="(colPickMode==0 and data.containsKey('authType')) or (colPickMode==1 and !data.containsKey('authType'))">
				a.authType=#{data.authType},
			</if>
			<if test="(colPickMode==0 and data.containsKey('authTypeIncrement')) or (colPickMode==1 and !data.containsKey('authTypeIncrement'))">
				a.authType=ifnull(a.authType,0) + #{data.authTypeIncrement},
			</if>
			<if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))">
				a.createTime=#{data.createTime},
			</if>
			<if test="(colPickMode==0 and data.containsKey('createUserId')) or (colPickMode==1 and !data.containsKey('createUserId'))">
				a.createUserId=#{data.createUserId},
			</if>
			<if test="(colPickMode==0 and data.containsKey('createUserIdIncrement')) or (colPickMode==1 and !data.containsKey('createUserIdIncrement'))">
				a.createUserId=ifnull(a.createUserId,0) + #{data.createUserIdIncrement},
			</if>
			<if test="(colPickMode==0 and data.containsKey('createUserName')) or (colPickMode==1 and !data.containsKey('createUserName'))">
				a.createUserName=#{data.createUserName},
			</if>
		</trim>
		<trim suffixOverrides="where" suffix="">
			where
			<trim prefixOverrides="and" prefix="">
				<include refid="_condition_"/>
			</trim>
		</trim>
	</update>
	<!-- 批量更新 -->
	<update id="updateBatch" parameterType="paramDto">
		update mortals_xhx_menu as a
		<trim prefix="set" suffixOverrides=",">
			<trim prefix="name=(case" suffix="ELSE name end),">
				<foreach collection="data.dataList" item="item" index="index" separator="" >
					<if test="(colPickMode==0 and item.containsKey('name')) or (colPickMode==1 and !item.containsKey('name'))">
						when a.id=#{item.id} then #{item.name}
					</if>
				</foreach>
			</trim>
			<trim prefix="url=(case" suffix="ELSE url end),">
				<foreach collection="data.dataList" item="item" index="index" separator="" >
					<if test="(colPickMode==0 and item.containsKey('url')) or (colPickMode==1 and !item.containsKey('url'))">
						when a.id=#{item.id} then #{item.url}
					</if>
				</foreach>
			</trim>
			<trim prefix="ancestors=(case" suffix="ELSE ancestors end),">
				<foreach collection="data.dataList" item="item" index="index" separator="" >
					<if test="(colPickMode==0 and item.containsKey('ancestors')) or (colPickMode==1 and !item.containsKey('ancestors'))">
						when a.id=#{item.id} then #{item.ancestors}
					</if>
				</foreach>
			</trim>
			<trim prefix="parentId=(case" suffix="ELSE parentId end),">
				<foreach collection="data.dataList" item="item" index="index" separator="" >
					<choose>
						<when test="(colPickMode==0 and item.containsKey('parentId')) or (colPickMode==1 and !item.containsKey('parentId'))">
							when a.id=#{item.id} then #{item.parentId}
						</when>
						<when test="(colPickMode==0 and item.containsKey('parentIdIncrement')) or (colPickMode==1 and !item.containsKey('parentIdIncrement'))">
							when a.id=#{item.id} then ifnull(a.parentId,0) + #{item.parentIdIncrement}
						</when>
					</choose>
				</foreach>
			</trim>
			<trim prefix="orderId=(case" suffix="ELSE orderId end),">
				<foreach collection="data.dataList" item="item" index="index" separator="" >
					<choose>
						<when test="(colPickMode==0 and item.containsKey('orderId')) or (colPickMode==1 and !item.containsKey('orderId'))">
							when a.id=#{item.id} then #{item.orderId}
						</when>
						<when test="(colPickMode==0 and item.containsKey('orderIdIncrement')) or (colPickMode==1 and !item.containsKey('orderIdIncrement'))">
							when a.id=#{item.id} then ifnull(a.orderId,0) + #{item.orderIdIncrement}
						</when>
					</choose>
				</foreach>
			</trim>
			<trim prefix="status=(case" suffix="ELSE status end),">
				<foreach collection="data.dataList" item="item" index="index" separator="" >
					<choose>
						<when test="(colPickMode==0 and item.containsKey('status')) or (colPickMode==1 and !item.containsKey('status'))">
							when a.id=#{item.id} then #{item.status}
						</when>
						<when test="(colPickMode==0 and item.containsKey('statusIncrement')) or (colPickMode==1 and !item.containsKey('statusIncrement'))">
							when a.id=#{item.id} then ifnull(a.status,0) + #{item.statusIncrement}
						</when>
					</choose>
				</foreach>
			</trim>
			<trim prefix="linkType=(case" suffix="ELSE linkType end),">
				<foreach collection="data.dataList" item="item" index="index" separator="" >
					<choose>
						<when test="(colPickMode==0 and item.containsKey('linkType')) or (colPickMode==1 and !item.containsKey('linkType'))">
							when a.id=#{item.id} then #{item.linkType}
						</when>
						<when test="(colPickMode==0 and item.containsKey('linkTypeIncrement')) or (colPickMode==1 and !item.containsKey('linkTypeIncrement'))">
							when a.id=#{item.id} then ifnull(a.linkType,0) + #{item.linkTypeIncrement}
						</when>
					</choose>
				</foreach>
			</trim>
			<trim prefix="groupId=(case" suffix="ELSE groupId end),">
				<foreach collection="data.dataList" item="item" index="index" separator="" >
					<choose>
						<when test="(colPickMode==0 and item.containsKey('groupId')) or (colPickMode==1 and !item.containsKey('groupId'))">
							when a.id=#{item.id} then #{item.groupId}
						</when>
						<when test="(colPickMode==0 and item.containsKey('groupIdIncrement')) or (colPickMode==1 and !item.containsKey('groupIdIncrement'))">
							when a.id=#{item.id} then ifnull(a.groupId,0) + #{item.groupIdIncrement}
						</when>
					</choose>
				</foreach>
			</trim>
			<trim prefix="groupName=(case" suffix="ELSE groupName end),">
				<foreach collection="data.dataList" item="item" index="index" separator="" >
					<if test="(colPickMode==0 and item.containsKey('groupName')) or (colPickMode==1 and !item.containsKey('groupName'))">
						when a.id=#{item.id} then #{item.groupName}
					</if>
				</foreach>
			</trim>
			<trim prefix="imgPath=(case" suffix="ELSE imgPath end),">
				<foreach collection="data.dataList" item="item" index="index" separator="" >
					<if test="(colPickMode==0 and item.containsKey('imgPath')) or (colPickMode==1 and !item.containsKey('imgPath'))">
						when a.id=#{item.id} then #{item.imgPath}
					</if>
				</foreach>
			</trim>
			<trim prefix="buttonImgPath=(case" suffix="ELSE buttonImgPath end),">
				<foreach collection="data.dataList" item="item" index="index" separator="" >
					<if test="(colPickMode==0 and item.containsKey('buttonImgPath')) or (colPickMode==1 and !item.containsKey('buttonImgPath'))">
						when a.id=#{item.id} then #{item.buttonImgPath}
					</if>
				</foreach>
			</trim>
			<trim prefix="imgCommPath=(case" suffix="ELSE imgCommPath end),">
				<foreach collection="data.dataList" item="item" index="index" separator="" >
					<if test="(colPickMode==0 and item.containsKey('imgCommPath')) or (colPickMode==1 and !item.containsKey('imgCommPath'))">
						when a.id=#{item.id} then #{item.imgCommPath}
					</if>
				</foreach>
			</trim>
			<trim prefix="commMenu=(case" suffix="ELSE commMenu end),">
				<foreach collection="data.dataList" item="item" index="index" separator="" >
					<choose>
						<when test="(colPickMode==0 and item.containsKey('commMenu')) or (colPickMode==1 and !item.containsKey('commMenu'))">
							when a.id=#{item.id} then #{item.commMenu}
						</when>
						<when test="(colPickMode==0 and item.containsKey('commMenuIncrement')) or (colPickMode==1 and !item.containsKey('commMenuIncrement'))">
							when a.id=#{item.id} then ifnull(a.commMenu,0) + #{item.commMenuIncrement}
						</when>
					</choose>
				</foreach>
			</trim>
			<trim prefix="menuType=(case" suffix="ELSE menuType end),">
				<foreach collection="data.dataList" item="item" index="index" separator="" >
					<choose>
						<when test="(colPickMode==0 and item.containsKey('menuType')) or (colPickMode==1 and !item.containsKey('menuType'))">
							when a.id=#{item.id} then #{item.menuType}
						</when>
						<when test="(colPickMode==0 and item.containsKey('menuTypeIncrement')) or (colPickMode==1 and !item.containsKey('menuTypeIncrement'))">
							when a.id=#{item.id} then ifnull(a.menuType,0) + #{item.menuTypeIncrement}
						</when>
					</choose>
				</foreach>
			</trim>
			<trim prefix="authType=(case" suffix="ELSE authType end),">
				<foreach collection="data.dataList" item="item" index="index" separator="" >
					<choose>
						<when test="(colPickMode==0 and item.containsKey('authType')) or (colPickMode==1 and !item.containsKey('authType'))">
							when a.id=#{item.id} then #{item.authType}
						</when>
						<when test="(colPickMode==0 and item.containsKey('authTypeIncrement')) or (colPickMode==1 and !item.containsKey('authTypeIncrement'))">
							when a.id=#{item.id} then ifnull(a.authType,0) + #{item.authTypeIncrement}
						</when>
					</choose>
				</foreach>
			</trim>
			<trim prefix="createTime=(case" suffix="ELSE createTime end),">
				<foreach collection="data.dataList" item="item" index="index" separator="" >
					<if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))">
						when a.id=#{item.id} then #{item.createTime}
					</if>
				</foreach>
			</trim>
			<trim prefix="createUserId=(case" suffix="ELSE createUserId end),">
				<foreach collection="data.dataList" item="item" index="index" separator="" >
					<choose>
						<when test="(colPickMode==0 and item.containsKey('createUserId')) or (colPickMode==1 and !item.containsKey('createUserId'))">
							when a.id=#{item.id} then #{item.createUserId}
						</when>
						<when test="(colPickMode==0 and item.containsKey('createUserIdIncrement')) or (colPickMode==1 and !item.containsKey('createUserIdIncrement'))">
							when a.id=#{item.id} then ifnull(a.createUserId,0) + #{item.createUserIdIncrement}
						</when>
					</choose>
				</foreach>
			</trim>
			<trim prefix="createUserName=(case" suffix="ELSE createUserName end),">
				<foreach collection="data.dataList" item="item" index="index" separator="" >
					<if test="(colPickMode==0 and item.containsKey('createUserName')) or (colPickMode==1 and !item.containsKey('createUserName'))">
						when a.id=#{item.id} then #{item.createUserName}
					</if>
				</foreach>
			</trim>
		</trim>
		where id in
		<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
			#{item.id}
		</foreach>
	</update>
	<!-- 根据主健查询 -->
	<select id="getByKey" parameterType="paramDto" resultMap="MenuEntity-Map">
		select <include refid="_columns"/>
		from mortals_xhx_menu as a
		where a.id=#{condition.id}
	</select>
	<!-- 根据主健删除 -->
	<delete id="deleteByKey" parameterType="paramDto">
		delete a.* from mortals_xhx_menu as a where a.id=#{condition.id}
	</delete>
	<!-- 根据主健删除一批，针对单一主健有效 -->
	<delete id="deleteByKeys">
		delete from mortals_xhx_menu where id in
		<foreach collection="array" item="item" index="index" open="(" separator="," close=")">
			#{item}
		</foreach>
	</delete>
	<!-- 根据主健列表删除一批，针对单一主健有效 -->
	<delete id="deleteByKeyList">
		delete from mortals_xhx_menu where id in
		<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
			#{item}
		</foreach>
	</delete>

	<!-- 根据对象列表删除一批，针对单一主健有效 -->
	<delete id="deleteByEntityList">
		delete from mortals_xhx_menu where id in
		<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
			#{item.id}
		</foreach>
	</delete>
	<!-- 根据paramDto删除一批 -->
	<delete id="deleteByMap" parameterType="paramDto">
		delete a.* from mortals_xhx_menu as a
		<trim suffixOverrides="where" suffix="">
			where
			<trim prefixOverrides="and" prefix="">
				<include refid="_condition_"/>
			</trim>
		</trim>
	</delete>
	<!-- 获取列表 -->
	<select id="getList" parameterType="paramDto" resultMap="MenuEntity-Map">
		select <include refid="_columns"/>
		from mortals_xhx_menu as a
		<trim suffixOverrides="where" suffix="">
			where
			<trim prefixOverrides="and" prefix="">
				<include refid="_condition_"/>
			</trim>
		</trim>
		<include refid="_orderCols_"/>
	</select>


	<!-- 获取子节点 -->
	<select id="selectChildrenMenuById" parameterType="String" resultMap="MenuEntity-Map">
		select * from mortals_xhx_menu as a where find_in_set(#{menuId}, ancestors)
	</select>

	<!-- 获取 -->
	<select id="getListCount" parameterType="paramDto" resultType="int">
		select count(1)
		from mortals_xhx_menu as a
		<trim suffixOverrides="where" suffix="">
			where
			<trim prefixOverrides="and" prefix="">
				<include refid="_condition_"/>
			</trim>
		</trim>
	</select>
	<!-- 条件映射 -->
	<sql id="_condition_">
		<if test="condition != null and !condition.isEmpty()">
			<!-- 条件映射-普通条件 -->
			<include refid="_condition_param_">
				<property name="_conditionParam_" value="condition"/>
				<property name="_conditionType_" value="and"/>
			</include>
			<!-- 条件映射-集合之间使用AND，集合中元素使用OR-(list[0].1 or list[0].2) and (list[1].3 or list[1].4) -->
			<if test="condition.containsKey('andConditionList') and !condition.andConditionList.isEmpty()">
				and
				<foreach collection="condition.andConditionList" open="(" close=")" index="index" item="andCondition" separator=" and ">
					<trim prefixOverrides="or" prefix="(" suffix=")">
						<include refid="_condition_param_">
							<property name="_conditionParam_" value="andCondition"/>
							<property name="_conditionType_" value="or"/>
						</include>
					</trim>
				</foreach>
			</if>
			<!-- 条件映射-集合之间使用OR，集合中元素使用AND-(list[0].1 and list[0].2) or (list[1].3 and list[1].4) -->
			<if test="condition.containsKey('orConditionList') and !condition.orConditionList.isEmpty()">
				and
				<foreach collection="condition.orConditionList" open="(" close=")" index="index" item="orCondition" separator=" or ">
					<trim prefixOverrides="and" prefix="(" suffix=")">
						<include refid="_condition_param_">
							<property name="_conditionParam_" value="orCondition"/>
							<property name="_conditionType_" value="and"/>
						</include>
					</trim>
				</foreach>
			</if>
		</if>
	</sql>
	<!-- 条件映射-代参数 -->
	<sql id="_condition_param_">
		<bind name="conditionParamRef" value="${_conditionParam_}"/>
		<if test="conditionParamRef.containsKey('id')">
			<if test="conditionParamRef.id != null">
				${_conditionType_} a.id=#{${_conditionParam_}.id}
			</if>
		</if>
		<if test="conditionParamRef.containsKey('id')">
			<if test="conditionParamRef.id != null ">
				${_conditionType_} a.id = #{${_conditionParam_}.id}
			</if>
			<if test="conditionParamRef.id == null">
				${_conditionType_} a.id is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
			${_conditionType_} a.id in
			<foreach collection="conditionParamRef.idList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('idNotList') and conditionParamRef.idNotList.size() > 0">
			${_conditionType_} a.id not in
			<foreach collection="conditionParamRef.idNotList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null">
			${_conditionType_} a.id <![CDATA[ >= ]]> #{${_conditionParam_}.idStart}
		</if>
		<if test="conditionParamRef.containsKey('idEnd') and conditionParamRef.idEnd != null">
			${_conditionType_} a.id <![CDATA[ <= ]]> #{${_conditionParam_}.idEnd}
		</if>


		<if test="conditionParamRef.containsKey('name')">
			<if test="conditionParamRef.name != null and conditionParamRef.name != ''">
				${_conditionType_} a.name like #{${_conditionParam_}.name}
			</if>
			<if test="conditionParamRef.name == null">
				${_conditionType_} a.name is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('nameList') and conditionParamRef.nameList.size() > 0">
			${_conditionType_} a.name in
			<foreach collection="conditionParamRef.nameList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('nameNotList') and conditionParamRef.nameNotList.size() > 0">
			${_conditionType_} a.name not in
			<foreach collection="conditionParamRef.nameNotList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>

		<if test="conditionParamRef.containsKey('url')">
			<if test="conditionParamRef.url != null and conditionParamRef.url != ''">
				${_conditionType_} a.url like #{${_conditionParam_}.url}
			</if>
			<if test="conditionParamRef.url == null">
				${_conditionType_} a.url is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('urlList') and conditionParamRef.urlList.size() > 0">
			${_conditionType_} a.url in
			<foreach collection="conditionParamRef.urlList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('urlNotList') and conditionParamRef.urlNotList.size() > 0">
			${_conditionType_} a.url not in
			<foreach collection="conditionParamRef.urlNotList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>

		<if test="conditionParamRef.containsKey('ancestors')">
			<if test="conditionParamRef.ancestors != null and conditionParamRef.ancestors != ''">
				${_conditionType_} a.ancestors like #{${_conditionParam_}.ancestors}
			</if>
			<if test="conditionParamRef.ancestors == null">
				${_conditionType_} a.ancestors is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('ancestorsList') and conditionParamRef.ancestorsList.size() > 0">
			${_conditionType_} a.ancestors in
			<foreach collection="conditionParamRef.ancestorsList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('ancestorsNotList') and conditionParamRef.ancestorsNotList.size() > 0">
			${_conditionType_} a.ancestors not in
			<foreach collection="conditionParamRef.ancestorsNotList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('parentId')">
			<if test="conditionParamRef.parentId != null ">
				${_conditionType_} a.parentId = #{${_conditionParam_}.parentId}
			</if>
			<if test="conditionParamRef.parentId == null">
				${_conditionType_} a.parentId is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('parentIdList') and conditionParamRef.parentIdList.size() > 0">
			${_conditionType_} a.parentId in
			<foreach collection="conditionParamRef.parentIdList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('parentIdNotList') and conditionParamRef.parentIdNotList.size() > 0">
			${_conditionType_} a.parentId not in
			<foreach collection="conditionParamRef.parentIdNotList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('parentIdStart') and conditionParamRef.parentIdStart != null">
			${_conditionType_} a.parentId <![CDATA[ >= ]]> #{${_conditionParam_}.parentIdStart}
		</if>
		<if test="conditionParamRef.containsKey('parentIdEnd') and conditionParamRef.parentIdEnd != null">
			${_conditionType_} a.parentId <![CDATA[ <= ]]> #{${_conditionParam_}.parentIdEnd}
		</if>

		<if test="conditionParamRef.containsKey('orderId')">
			<if test="conditionParamRef.orderId != null ">
				${_conditionType_} a.orderId = #{${_conditionParam_}.orderId}
			</if>
			<if test="conditionParamRef.orderId == null">
				${_conditionType_} a.orderId is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('orderIdList') and conditionParamRef.orderIdList.size() > 0">
			${_conditionType_} a.orderId in
			<foreach collection="conditionParamRef.orderIdList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('orderIdNotList') and conditionParamRef.orderIdNotList.size() > 0">
			${_conditionType_} a.orderId not in
			<foreach collection="conditionParamRef.orderIdNotList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('orderIdStart') and conditionParamRef.orderIdStart != null">
			${_conditionType_} a.orderId <![CDATA[ >= ]]> #{${_conditionParam_}.orderIdStart}
		</if>
		<if test="conditionParamRef.containsKey('orderIdEnd') and conditionParamRef.orderIdEnd != null">
			${_conditionType_} a.orderId <![CDATA[ <= ]]> #{${_conditionParam_}.orderIdEnd}
		</if>

		<if test="conditionParamRef.containsKey('status')">
			<if test="conditionParamRef.status != null ">
				${_conditionType_} a.status = #{${_conditionParam_}.status}
			</if>
			<if test="conditionParamRef.status == null">
				${_conditionType_} a.status is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('statusList') and conditionParamRef.statusList.size() > 0">
			${_conditionType_} a.status in
			<foreach collection="conditionParamRef.statusList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('statusNotList') and conditionParamRef.statusNotList.size() > 0">
			${_conditionType_} a.status not in
			<foreach collection="conditionParamRef.statusNotList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('statusStart') and conditionParamRef.statusStart != null">
			${_conditionType_} a.status <![CDATA[ >= ]]> #{${_conditionParam_}.statusStart}
		</if>
		<if test="conditionParamRef.containsKey('statusEnd') and conditionParamRef.statusEnd != null">
			${_conditionType_} a.status <![CDATA[ <= ]]> #{${_conditionParam_}.statusEnd}
		</if>

		<if test="conditionParamRef.containsKey('linkType')">
			<if test="conditionParamRef.linkType != null ">
				${_conditionType_} a.linkType = #{${_conditionParam_}.linkType}
			</if>
			<if test="conditionParamRef.linkType == null">
				${_conditionType_} a.linkType is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('linkTypeList') and conditionParamRef.linkTypeList.size() > 0">
			${_conditionType_} a.linkType in
			<foreach collection="conditionParamRef.linkTypeList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('linkTypeNotList') and conditionParamRef.linkTypeNotList.size() > 0">
			${_conditionType_} a.linkType not in
			<foreach collection="conditionParamRef.linkTypeNotList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('linkTypeStart') and conditionParamRef.linkTypeStart != null">
			${_conditionType_} a.linkType <![CDATA[ >= ]]> #{${_conditionParam_}.linkTypeStart}
		</if>
		<if test="conditionParamRef.containsKey('linkTypeEnd') and conditionParamRef.linkTypeEnd != null">
			${_conditionType_} a.linkType <![CDATA[ <= ]]> #{${_conditionParam_}.linkTypeEnd}
		</if>

		<if test="conditionParamRef.containsKey('groupId')">
			<if test="conditionParamRef.groupId != null ">
				${_conditionType_} a.groupId = #{${_conditionParam_}.groupId}
			</if>
			<if test="conditionParamRef.groupId == null">
				${_conditionType_} a.groupId is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('groupIdList') and conditionParamRef.groupIdList.size() > 0">
			${_conditionType_} a.groupId in
			<foreach collection="conditionParamRef.groupIdList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('groupIdNotList') and conditionParamRef.groupIdNotList.size() > 0">
			${_conditionType_} a.groupId not in
			<foreach collection="conditionParamRef.groupIdNotList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('groupIdStart') and conditionParamRef.groupIdStart != null">
			${_conditionType_} a.groupId <![CDATA[ >= ]]> #{${_conditionParam_}.groupIdStart}
		</if>
		<if test="conditionParamRef.containsKey('groupIdEnd') and conditionParamRef.groupIdEnd != null">
			${_conditionType_} a.groupId <![CDATA[ <= ]]> #{${_conditionParam_}.groupIdEnd}
		</if>


		<if test="conditionParamRef.containsKey('groupName')">
			<if test="conditionParamRef.groupName != null and conditionParamRef.groupName != ''">
				${_conditionType_} a.groupName like #{${_conditionParam_}.groupName}
			</if>
			<if test="conditionParamRef.groupName == null">
				${_conditionType_} a.groupName is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('groupNameList') and conditionParamRef.groupNameList.size() > 0">
			${_conditionType_} a.groupName in
			<foreach collection="conditionParamRef.groupNameList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('groupNameNotList') and conditionParamRef.groupNameNotList.size() > 0">
			${_conditionType_} a.groupName not in
			<foreach collection="conditionParamRef.groupNameNotList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>

		<if test="conditionParamRef.containsKey('imgPath')">
			<if test="conditionParamRef.imgPath != null and conditionParamRef.imgPath != ''">
				${_conditionType_} a.imgPath like #{${_conditionParam_}.imgPath}
			</if>
			<if test="conditionParamRef.imgPath == null">
				${_conditionType_} a.imgPath is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('imgPathList') and conditionParamRef.imgPathList.size() > 0">
			${_conditionType_} a.imgPath in
			<foreach collection="conditionParamRef.imgPathList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('imgPathNotList') and conditionParamRef.imgPathNotList.size() > 0">
			${_conditionType_} a.imgPath not in
			<foreach collection="conditionParamRef.imgPathNotList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>

		<if test="conditionParamRef.containsKey('buttonImgPath')">
			<if test="conditionParamRef.buttonImgPath != null and conditionParamRef.buttonImgPath != ''">
				${_conditionType_} a.buttonImgPath like #{${_conditionParam_}.buttonImgPath}
			</if>
			<if test="conditionParamRef.buttonImgPath == null">
				${_conditionType_} a.buttonImgPath is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('buttonImgPathList') and conditionParamRef.buttonImgPathList.size() > 0">
			${_conditionType_} a.buttonImgPath in
			<foreach collection="conditionParamRef.buttonImgPathList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('buttonImgPathNotList') and conditionParamRef.buttonImgPathNotList.size() > 0">
			${_conditionType_} a.buttonImgPath not in
			<foreach collection="conditionParamRef.buttonImgPathNotList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>

		<if test="conditionParamRef.containsKey('imgCommPath')">
			<if test="conditionParamRef.imgCommPath != null and conditionParamRef.imgCommPath != ''">
				${_conditionType_} a.imgCommPath like #{${_conditionParam_}.imgCommPath}
			</if>
			<if test="conditionParamRef.imgCommPath == null">
				${_conditionType_} a.imgCommPath is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('imgCommPathList') and conditionParamRef.imgCommPathList.size() > 0">
			${_conditionType_} a.imgCommPath in
			<foreach collection="conditionParamRef.imgCommPathList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('imgCommPathNotList') and conditionParamRef.imgCommPathNotList.size() > 0">
			${_conditionType_} a.imgCommPath not in
			<foreach collection="conditionParamRef.imgCommPathNotList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('commMenu')">
			<if test="conditionParamRef.commMenu != null ">
				${_conditionType_} a.commMenu = #{${_conditionParam_}.commMenu}
			</if>
			<if test="conditionParamRef.commMenu == null">
				${_conditionType_} a.commMenu is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('commMenuList') and conditionParamRef.commMenuList.size() > 0">
			${_conditionType_} a.commMenu in
			<foreach collection="conditionParamRef.commMenuList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('commMenuNotList') and conditionParamRef.commMenuNotList.size() > 0">
			${_conditionType_} a.commMenu not in
			<foreach collection="conditionParamRef.commMenuNotList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('commMenuStart') and conditionParamRef.commMenuStart != null">
			${_conditionType_} a.commMenu <![CDATA[ >= ]]> #{${_conditionParam_}.commMenuStart}
		</if>
		<if test="conditionParamRef.containsKey('commMenuEnd') and conditionParamRef.commMenuEnd != null">
			${_conditionType_} a.commMenu <![CDATA[ <= ]]> #{${_conditionParam_}.commMenuEnd}
		</if>

		<if test="conditionParamRef.containsKey('menuType')">
			<if test="conditionParamRef.menuType != null ">
				${_conditionType_} a.menuType = #{${_conditionParam_}.menuType}
			</if>
			<if test="conditionParamRef.menuType == null">
				${_conditionType_} a.menuType is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('menuTypeList') and conditionParamRef.menuTypeList.size() > 0">
			${_conditionType_} a.menuType in
			<foreach collection="conditionParamRef.menuTypeList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('menuTypeNotList') and conditionParamRef.menuTypeNotList.size() > 0">
			${_conditionType_} a.menuType not in
			<foreach collection="conditionParamRef.menuTypeNotList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('menuTypeStart') and conditionParamRef.menuTypeStart != null">
			${_conditionType_} a.menuType <![CDATA[ >= ]]> #{${_conditionParam_}.menuTypeStart}
		</if>
		<if test="conditionParamRef.containsKey('menuTypeEnd') and conditionParamRef.menuTypeEnd != null">
			${_conditionType_} a.menuType <![CDATA[ <= ]]> #{${_conditionParam_}.menuTypeEnd}
		</if>

		<if test="conditionParamRef.containsKey('authType')">
			<if test="conditionParamRef.authType != null ">
				${_conditionType_} a.authType = #{${_conditionParam_}.authType}
			</if>
			<if test="conditionParamRef.authType == null">
				${_conditionType_} a.authType is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('authTypeList') and conditionParamRef.authTypeList.size() > 0">
			${_conditionType_} a.authType in
			<foreach collection="conditionParamRef.authTypeList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('authTypeNotList') and conditionParamRef.authTypeNotList.size() > 0">
			${_conditionType_} a.authType not in
			<foreach collection="conditionParamRef.authTypeNotList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('authTypeStart') and conditionParamRef.authTypeStart != null">
			${_conditionType_} a.authType <![CDATA[ >= ]]> #{${_conditionParam_}.authTypeStart}
		</if>
		<if test="conditionParamRef.containsKey('authTypeEnd') and conditionParamRef.authTypeEnd != null">
			${_conditionType_} a.authType <![CDATA[ <= ]]> #{${_conditionParam_}.authTypeEnd}
		</if>


		<if test="conditionParamRef.containsKey('createTime')">
			<if test="conditionParamRef.createTime != null ">
				${_conditionType_} a.createTime = #{${_conditionParam_}.createTime}
			</if>
			<if test="conditionParamRef.createTime == null">
				${_conditionType_} a.createTime is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('createTimeStart') and conditionParamRef.createTimeStart != null and conditionParamRef.createTimeStart!=''">
			${_conditionType_} a.createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
		</if>
		<if test="conditionParamRef.containsKey('createTimeEnd') and conditionParamRef.createTimeEnd != null and conditionParamRef.createTimeEnd!=''">
			${_conditionType_} a.createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
		</if>
		<if test="conditionParamRef.containsKey('createUserId')">
			<if test="conditionParamRef.createUserId != null ">
				${_conditionType_} a.createUserId = #{${_conditionParam_}.createUserId}
			</if>
			<if test="conditionParamRef.createUserId == null">
				${_conditionType_} a.createUserId is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
			${_conditionType_} a.createUserId in
			<foreach collection="conditionParamRef.createUserIdList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('createUserIdNotList') and conditionParamRef.createUserIdNotList.size() > 0">
			${_conditionType_} a.createUserId not in
			<foreach collection="conditionParamRef.createUserIdNotList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('createUserIdStart') and conditionParamRef.createUserIdStart != null">
			${_conditionType_} a.createUserId <![CDATA[ >= ]]> #{${_conditionParam_}.createUserIdStart}
		</if>
		<if test="conditionParamRef.containsKey('createUserIdEnd') and conditionParamRef.createUserIdEnd != null">
			${_conditionType_} a.createUserId <![CDATA[ <= ]]> #{${_conditionParam_}.createUserIdEnd}
		</if>


		<if test="conditionParamRef.containsKey('createUserName')">
			<if test="conditionParamRef.createUserName != null and conditionParamRef.createUserName != ''">
				${_conditionType_} a.createUserName like #{${_conditionParam_}.createUserName}
			</if>
			<if test="conditionParamRef.createUserName == null">
				${_conditionType_} a.createUserName is null
			</if>
		</if>
		<if test="conditionParamRef.containsKey('createUserNameList') and conditionParamRef.createUserNameList.size() > 0">
			${_conditionType_} a.createUserName in
			<foreach collection="conditionParamRef.createUserNameList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
		<if test="conditionParamRef.containsKey('createUserNameNotList') and conditionParamRef.createUserNameNotList.size() > 0">
			${_conditionType_} a.createUserName not in
			<foreach collection="conditionParamRef.createUserNameNotList" open="(" close=")" index="index" item="item" separator=",">
				#{item}
			</foreach>
		</if>
	</sql>
	<sql id="_orderCols_">
		<if test="orderColList != null and !orderColList.isEmpty()">
			order by
			<trim suffixOverrides=","  suffix="">
				<foreach collection="orderColList" open="" close="" index="index" item="item" separator=",">
					${item.colName} ${item.sortKind}
				</foreach>
			</trim>
		</if>
		<if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()">
			order by
			<trim suffixOverrides=","  suffix="">
				<if test="orderCol.containsKey('id')">
					a.id
					<if test='orderCol.id != null and "DESC".equalsIgnoreCase(orderCol.id)'>DESC</if>
					,
				</if>
				<if test="orderCol.containsKey('name')">
					a.name
					<if test='orderCol.name != null and "DESC".equalsIgnoreCase(orderCol.name)'>DESC</if>
					,
				</if>
				<if test="orderCol.containsKey('url')">
					a.url
					<if test='orderCol.url != null and "DESC".equalsIgnoreCase(orderCol.url)'>DESC</if>
					,
				</if>
				<if test="orderCol.containsKey('ancestors')">
					a.ancestors
					<if test='orderCol.ancestors != null and "DESC".equalsIgnoreCase(orderCol.ancestors)'>DESC</if>
					,
				</if>
				<if test="orderCol.containsKey('parentId')">
					a.parentId
					<if test='orderCol.parentId != null and "DESC".equalsIgnoreCase(orderCol.parentId)'>DESC</if>
					,
				</if>
				<if test="orderCol.containsKey('orderId')">
					a.orderId
					<if test='orderCol.orderId != null and "DESC".equalsIgnoreCase(orderCol.orderId)'>DESC</if>
					,
				</if>
				<if test="orderCol.containsKey('status')">
					a.status
					<if test='orderCol.status != null and "DESC".equalsIgnoreCase(orderCol.status)'>DESC</if>
					,
				</if>
				<if test="orderCol.containsKey('linkType')">
					a.linkType
					<if test='orderCol.linkType != null and "DESC".equalsIgnoreCase(orderCol.linkType)'>DESC</if>
					,
				</if>
				<if test="orderCol.containsKey('groupId')">
					a.groupId
					<if test='orderCol.groupId != null and "DESC".equalsIgnoreCase(orderCol.groupId)'>DESC</if>
					,
				</if>
				<if test="orderCol.containsKey('groupName')">
					a.groupName
					<if test='orderCol.groupName != null and "DESC".equalsIgnoreCase(orderCol.groupName)'>DESC</if>
					,
				</if>
				<if test="orderCol.containsKey('imgPath')">
					a.imgPath
					<if test='orderCol.imgPath != null and "DESC".equalsIgnoreCase(orderCol.imgPath)'>DESC</if>
					,
				</if>
				<if test="orderCol.containsKey('buttonImgPath')">
					a.buttonImgPath
					<if test='orderCol.buttonImgPath != null and "DESC".equalsIgnoreCase(orderCol.buttonImgPath)'>DESC</if>
					,
				</if>
				<if test="orderCol.containsKey('imgCommPath')">
					a.imgCommPath
					<if test='orderCol.imgCommPath != null and "DESC".equalsIgnoreCase(orderCol.imgCommPath)'>DESC</if>
					,
				</if>
				<if test="orderCol.containsKey('commMenu')">
					a.commMenu
					<if test='orderCol.commMenu != null and "DESC".equalsIgnoreCase(orderCol.commMenu)'>DESC</if>
					,
				</if>
				<if test="orderCol.containsKey('menuType')">
					a.menuType
					<if test='orderCol.menuType != null and "DESC".equalsIgnoreCase(orderCol.menuType)'>DESC</if>
					,
				</if>
				<if test="orderCol.containsKey('authType')">
					a.authType
					<if test='orderCol.authType != null and "DESC".equalsIgnoreCase(orderCol.authType)'>DESC</if>
					,
				</if>
				<if test="orderCol.containsKey('createTime')">
					a.createTime
					<if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
					,
				</if>
				<if test="orderCol.containsKey('createUserId')">
					a.createUserId
					<if test='orderCol.createUserId != null and "DESC".equalsIgnoreCase(orderCol.createUserId)'>DESC</if>
					,
				</if>
				<if test="orderCol.containsKey('createUserName')">
					a.createUserName
					<if test='orderCol.createUserName != null and "DESC".equalsIgnoreCase(orderCol.createUserName)'>DESC</if>
					,
				</if>
			</trim>
		</if>
	</sql>
	<sql id="_group_by_">
		<if test="groupList != null and !groupList.isEmpty()">
			GROUP BY
			<trim suffixOverrides=","  suffix="">
				<foreach collection="groupList" open="" close="" index="index" item="item" separator=",">
					${item}
				</foreach>
			</trim>
		</if>
	</sql>
</mapper>