<?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.area.dao.ibatis.AreaDaoImpl">
    
	<!-- 字段和属性映射 -->
	<resultMap type="AreaEntity" id="AreaEntity-Map">
		<result property="id" column="id" />
		<result property="parentId" column="parentId" />
		<result property="name" column="name" />
		<result property="level" column="level" />
		<result property="code" column="code" />
		<result property="contactsPeople" column="contactsPeople" />
		<result property="contactsMobile" column="contactsMobile" />
		<result property="childSize" column="childSize" />
		<result property="maxChildId" column="maxChildId" />
		<result property="status" column="status" />
		<result property="remark" column="remark" />
		<result property="createTime" column="createTime" />
		<result property="updateTime" column="updateTime" />
		<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 as id,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('parentId') or colPickMode == 1 and data.containsKey('parentId')))">
				a.parentId as parentId,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('name') or colPickMode == 1 and data.containsKey('name')))">
				a.name as name,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('level') or colPickMode == 1 and data.containsKey('level')))">
				a.level as level,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('code') or colPickMode == 1 and data.containsKey('code')))">
				a.code as code,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('contactsPeople') or colPickMode == 1 and data.containsKey('contactsPeople')))">
				a.contactsPeople as contactsPeople,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('contactsMobile') or colPickMode == 1 and data.containsKey('contactsMobile')))">
				a.contactsMobile as contactsMobile,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('childSize') or colPickMode == 1 and data.containsKey('childSize')))">
				a.childSize as childSize,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('maxChildId') or colPickMode == 1 and data.containsKey('maxChildId')))">
				a.maxChildId as maxChildId,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('status') or colPickMode == 1 and data.containsKey('status')))">
				a.status as status,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('remark') or colPickMode == 1 and data.containsKey('remark')))">
				a.remark as remark,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
				a.createTime as createTime,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
				a.updateTime as updateTime,
			</if>
			<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createUserId') or colPickMode == 1 and data.containsKey('createUserId')))">
				a.createUserId as 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 as createUserName,
			</if>
		</trim>
	</sql>
	<!-- 新增 -->
	<insert id="insert" parameterType="AreaEntity" useGeneratedKeys="true" keyProperty="id">
		insert into mortals_xhx_area 
		(parentId,name,level,code,contactsPeople,
			contactsMobile,childSize,maxChildId,status,remark,
			createTime,updateTime,createUserId,createUserName
		)VALUES(#{parentId},#{name},#{level},#{code},#{contactsPeople},
			#{contactsMobile},#{childSize},#{maxChildId},#{status},#{remark},
			#{createTime},#{updateTime},#{createUserId},#{createUserName})
	</insert>
	<!-- 批量新增 -->
	<insert id="insertBatch" parameterType="paramDto">
		insert into mortals_xhx_area 
		(parentId,name,level,code,contactsPeople,
			contactsMobile,childSize,maxChildId,status,remark,
			createTime,updateTime,createUserId,createUserName
		)
		VALUES
		<foreach collection="data.dataList" item="item" index="index" separator="," >  
		(#{item.parentId},#{item.name},#{item.level},#{item.code},#{item.contactsPeople},
			#{item.contactsMobile},#{item.childSize},#{item.maxChildId},#{item.status},#{item.remark},
			#{item.createTime},#{item.updateTime},#{item.createUserId},#{item.createUserName})
		</foreach>
	</insert>
	<!-- 根据ParamDto更新 -->
	<update id="update" parameterType="paramDto">
		update mortals_xhx_area as a
		   set
		   <trim suffixOverrides="," suffix="">
				<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('name')) or (colPickMode==1 and !data.containsKey('name'))">
					a.name=#{data.name},
				</if>
				<if test="(colPickMode==0 and data.containsKey('level')) or (colPickMode==1 and !data.containsKey('level'))">
					a.level=#{data.level},
				</if>
				<if test="(colPickMode==0 and data.containsKey('levelIncrement')) or (colPickMode==1 and !data.containsKey('levelIncrement'))">
					a.level=ifnull(a.level,0) + #{data.levelIncrement},
				</if>
				<if test="(colPickMode==0 and data.containsKey('code')) or (colPickMode==1 and !data.containsKey('code'))">
					a.code=#{data.code},
				</if>
				<if test="(colPickMode==0 and data.containsKey('contactsPeople')) or (colPickMode==1 and !data.containsKey('contactsPeople'))">
					a.contactsPeople=#{data.contactsPeople},
				</if>
				<if test="(colPickMode==0 and data.containsKey('contactsMobile')) or (colPickMode==1 and !data.containsKey('contactsMobile'))">
					a.contactsMobile=#{data.contactsMobile},
				</if>
				<if test="(colPickMode==0 and data.containsKey('childSize')) or (colPickMode==1 and !data.containsKey('childSize'))">
					a.childSize=#{data.childSize},
				</if>
				<if test="(colPickMode==0 and data.containsKey('childSizeIncrement')) or (colPickMode==1 and !data.containsKey('childSizeIncrement'))">
					a.childSize=ifnull(a.childSize,0) + #{data.childSizeIncrement},
				</if>
				<if test="(colPickMode==0 and data.containsKey('maxChildId')) or (colPickMode==1 and !data.containsKey('maxChildId'))">
					a.maxChildId=#{data.maxChildId},
				</if>
				<if test="(colPickMode==0 and data.containsKey('maxChildIdIncrement')) or (colPickMode==1 and !data.containsKey('maxChildIdIncrement'))">
					a.maxChildId=ifnull(a.maxChildId,0) + #{data.maxChildIdIncrement},
				</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('remark')) or (colPickMode==1 and !data.containsKey('remark'))">
					a.remark=#{data.remark},
				</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('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
					a.updateTime=#{data.updateTime},
				</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>

	<!-- 根据主健查询 -->
	<select id="getByKey" parameterType="paramDto" resultMap="AreaEntity-Map">
		select <include refid="_columns"/>
		from mortals_xhx_area as a
	   where a.id=#{condition.id}
	</select>
	<!-- 根据主健删除 -->
	<delete id="deleteByKey" parameterType="paramDto">
		delete a.* from mortals_xhx_area as a where a.id=#{condition.id}
	</delete>
	<!-- 根据主健删除一批，针对单一主健有效 -->
	<delete id="deleteByKeys">
		delete from mortals_xhx_area where id in
		<foreach collection="array" item="item" index="index" open="(" separator="," close=")">
			#{item}
		</foreach>
	</delete>
	<!-- 根据paramDto删除一批 -->
	<delete id="deleteByMap" parameterType="paramDto">
		delete a.* from mortals_xhx_area as a
		<trim suffixOverrides="where" suffix="">
			 where 
			<trim prefixOverrides="and" prefix="">
				<include refid="_condition_"/>
			</trim>
		</trim>
	</delete>
	<!-- 获取列表 -->
	<select id="getList" parameterType="paramDto" resultMap="AreaEntity-Map">
		select <include refid="_columns"/>
		  from mortals_xhx_area as a
		 <trim suffixOverrides="where" suffix="">
			 where 
			 <trim prefixOverrides="and" prefix="">
			 	<include refid="_condition_"/>
			 </trim>
		 </trim>
		 <include refid="_orderCols_"/>
	</select>
	<!-- 获取 -->
	<select id="getListCount" parameterType="paramDto" resultType="int">
		select count(1)
		  from mortals_xhx_area 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()">
				<if test="condition.containsKey('id')">
					<if test="condition.id != null">
						and a.id=#{condition.id}
					</if>
				</if>
				<if test="condition.containsKey('id')">
					<if test="condition.id != null ">
						and a.id = #{condition.id}
					</if>
					<if test="condition.id == null">
						and a.id is null
					</if>
				</if>
				<if test="condition.containsKey('idList')">
					 and a.id in 
					<foreach collection="condition.idList" open="(" close=")" index="index" item="item" separator=",">
						#{item}
					</foreach>
				</if>
				<if test="condition.containsKey('idStart') and condition.idStart != null">
					<![CDATA[ and a.id >= #{condition.idStart} ]]>
				</if>
				<if test="condition.containsKey('idEnd') and condition.idEnd != null">
					<![CDATA[ and a.id <= #{condition.idEnd} ]]>
				</if>
				<if test="condition.containsKey('parentId')">
					<if test="condition.parentId != null ">
						and a.parentId = #{condition.parentId}
					</if>
					<if test="condition.parentId == null">
						and a.parentId is null
					</if>
				</if>
				<if test="condition.containsKey('parentIdList')">
					 and a.parentId in 
					<foreach collection="condition.parentIdList" open="(" close=")" index="index" item="item" separator=",">
						#{item}
					</foreach>
				</if>
				<if test="condition.containsKey('parentIdStart') and condition.parentIdStart != null">
					<![CDATA[ and a.parentId >= #{condition.parentIdStart} ]]>
				</if>
				<if test="condition.containsKey('parentIdEnd') and condition.parentIdEnd != null">
					<![CDATA[ and a.parentId <= #{condition.parentIdEnd} ]]>
				</if>
				<if test="condition.containsKey('name')">
					<if test="condition.name != null and condition.name != ''">
						and a.name like #{condition.name}
					</if>
					<if test="condition.name == null">
						and a.name is null
					</if>
				</if>
				<if test="condition.containsKey('nameList')">
					 and a.name in 
					<foreach collection="condition.nameList" open="(" close=")" index="index" item="item" separator=",">
						#{item}
					</foreach>
				</if>
				<if test="condition.containsKey('level')">
					<if test="condition.level != null ">
						and a.level = #{condition.level}
					</if>
					<if test="condition.level == null">
						and a.level is null
					</if>
				</if>
				<if test="condition.containsKey('levelList')">
					 and a.level in 
					<foreach collection="condition.levelList" open="(" close=")" index="index" item="item" separator=",">
						#{item}
					</foreach>
				</if>
				<if test="condition.containsKey('levelStart') and condition.levelStart != null">
					<![CDATA[ and a.level >= #{condition.levelStart} ]]>
				</if>
				<if test="condition.containsKey('levelEnd') and condition.levelEnd != null">
					<![CDATA[ and a.level <= #{condition.levelEnd} ]]>
				</if>
				<if test="condition.containsKey('code')">
					<if test="condition.code != null and condition.code != ''">
						and a.code like #{condition.code}
					</if>
					<if test="condition.code == null">
						and a.code is null
					</if>
				</if>
				<if test="condition.containsKey('codeList')">
					 and a.code in 
					<foreach collection="condition.codeList" open="(" close=")" index="index" item="item" separator=",">
						#{item}
					</foreach>
				</if>
				<if test="condition.containsKey('contactsPeople')">
					<if test="condition.contactsPeople != null and condition.contactsPeople != ''">
						and a.contactsPeople like #{condition.contactsPeople}
					</if>
					<if test="condition.contactsPeople == null">
						and a.contactsPeople is null
					</if>
				</if>
				<if test="condition.containsKey('contactsPeopleList')">
					 and a.contactsPeople in 
					<foreach collection="condition.contactsPeopleList" open="(" close=")" index="index" item="item" separator=",">
						#{item}
					</foreach>
				</if>
				<if test="condition.containsKey('contactsMobile')">
					<if test="condition.contactsMobile != null and condition.contactsMobile != ''">
						and a.contactsMobile like #{condition.contactsMobile}
					</if>
					<if test="condition.contactsMobile == null">
						and a.contactsMobile is null
					</if>
				</if>
				<if test="condition.containsKey('contactsMobileList')">
					 and a.contactsMobile in 
					<foreach collection="condition.contactsMobileList" open="(" close=")" index="index" item="item" separator=",">
						#{item}
					</foreach>
				</if>
				<if test="condition.containsKey('childSize')">
					<if test="condition.childSize != null ">
						and a.childSize = #{condition.childSize}
					</if>
					<if test="condition.childSize == null">
						and a.childSize is null
					</if>
				</if>
				<if test="condition.containsKey('childSizeList')">
					 and a.childSize in 
					<foreach collection="condition.childSizeList" open="(" close=")" index="index" item="item" separator=",">
						#{item}
					</foreach>
				</if>
				<if test="condition.containsKey('childSizeStart') and condition.childSizeStart != null">
					<![CDATA[ and a.childSize >= #{condition.childSizeStart} ]]>
				</if>
				<if test="condition.containsKey('childSizeEnd') and condition.childSizeEnd != null">
					<![CDATA[ and a.childSize <= #{condition.childSizeEnd} ]]>
				</if>
				<if test="condition.containsKey('maxChildId')">
					<if test="condition.maxChildId != null ">
						and a.maxChildId = #{condition.maxChildId}
					</if>
					<if test="condition.maxChildId == null">
						and a.maxChildId is null
					</if>
				</if>
				<if test="condition.containsKey('maxChildIdList')">
					 and a.maxChildId in 
					<foreach collection="condition.maxChildIdList" open="(" close=")" index="index" item="item" separator=",">
						#{item}
					</foreach>
				</if>
				<if test="condition.containsKey('maxChildIdStart') and condition.maxChildIdStart != null">
					<![CDATA[ and a.maxChildId >= #{condition.maxChildIdStart} ]]>
				</if>
				<if test="condition.containsKey('maxChildIdEnd') and condition.maxChildIdEnd != null">
					<![CDATA[ and a.maxChildId <= #{condition.maxChildIdEnd} ]]>
				</if>
				<if test="condition.containsKey('status')">
					<if test="condition.status != null ">
						and a.status = #{condition.status}
					</if>
					<if test="condition.status == null">
						and a.status is null
					</if>
				</if>
				<if test="condition.containsKey('statusList')">
					 and a.status in 
					<foreach collection="condition.statusList" open="(" close=")" index="index" item="item" separator=",">
						#{item}
					</foreach>
				</if>
				<if test="condition.containsKey('statusStart') and condition.statusStart != null">
					<![CDATA[ and a.status >= #{condition.statusStart} ]]>
				</if>
				<if test="condition.containsKey('statusEnd') and condition.statusEnd != null">
					<![CDATA[ and a.status <= #{condition.statusEnd} ]]>
				</if>
				<if test="condition.containsKey('remark')">
					<if test="condition.remark != null and condition.remark != ''">
						and a.remark like #{condition.remark}
					</if>
					<if test="condition.remark == null">
						and a.remark is null
					</if>
				</if>
				<if test="condition.containsKey('remarkList')">
					 and a.remark in 
					<foreach collection="condition.remarkList" open="(" close=")" index="index" item="item" separator=",">
						#{item}
					</foreach>
				</if>
				<if test="condition.containsKey('createTime')">
					<if test="condition.createTime != null ">
						and a.createTime = #{condition.createTime}
					</if>
					<if test="condition.createTime == null">
						and a.createTime is null
					</if>
				</if>
				<if test="condition.containsKey('createTimeStart') and condition.createTimeStart != null and condition.createTimeStart!=''">
					<![CDATA[ and a.createTime >= STR_TO_DATE(left(concat(#{condition.createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') ]]>
				</if>
				<if test="condition.containsKey('createTimeEnd') and condition.createTimeEnd != null and condition.createTimeEnd!=''">
					<![CDATA[ and a.createTime <= STR_TO_DATE(left(concat(#{condition.createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') ]]>
				</if>
				<if test="condition.containsKey('updateTime')">
					<if test="condition.updateTime != null ">
						and a.updateTime = #{condition.updateTime}
					</if>
					<if test="condition.updateTime == null">
						and a.updateTime is null
					</if>
				</if>
				<if test="condition.containsKey('updateTimeStart') and condition.updateTimeStart != null and condition.updateTimeStart!=''">
					<![CDATA[ and a.updateTime >= STR_TO_DATE(left(concat(#{condition.updateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') ]]>
				</if>
				<if test="condition.containsKey('updateTimeEnd') and condition.updateTimeEnd != null and condition.updateTimeEnd!=''">
					<![CDATA[ and a.updateTime <= STR_TO_DATE(left(concat(#{condition.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') ]]>
				</if>
				<if test="condition.containsKey('createUserId')">
					<if test="condition.createUserId != null ">
						and a.createUserId = #{condition.createUserId}
					</if>
					<if test="condition.createUserId == null">
						and a.createUserId is null
					</if>
				</if>
				<if test="condition.containsKey('createUserIdList')">
					 and a.createUserId in 
					<foreach collection="condition.createUserIdList" open="(" close=")" index="index" item="item" separator=",">
						#{item}
					</foreach>
				</if>
				<if test="condition.containsKey('createUserIdStart') and condition.createUserIdStart != null">
					<![CDATA[ and a.createUserId >= #{condition.createUserIdStart} ]]>
				</if>
				<if test="condition.containsKey('createUserIdEnd') and condition.createUserIdEnd != null">
					<![CDATA[ and a.createUserId <= #{condition.createUserIdEnd} ]]>
				</if>
				<if test="condition.containsKey('createUserName')">
					<if test="condition.createUserName != null and condition.createUserName != ''">
						and a.createUserName like #{condition.createUserName}
					</if>
					<if test="condition.createUserName == null">
						and a.createUserName is null
					</if>
				</if>
				<if test="condition.containsKey('createUserNameList')">
					 and a.createUserName in 
					<foreach collection="condition.createUserNameList" open="(" close=")" index="index" item="item" separator=",">
						#{item}
					</foreach>
				</if>
		</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">
						${orderCol.id}
					</if>
					,
				</if>
				<if test="orderCol.containsKey('parentId')">
					a.parentId
					<if test="orderCol.parentId!= null">
						${orderCol.parentId}
					</if>
					,
				</if>
				<if test="orderCol.containsKey('name')">
					a.name
					<if test="orderCol.name!= null">
						${orderCol.name}
					</if>
					,
				</if>
				<if test="orderCol.containsKey('level')">
					a.level
					<if test="orderCol.level!= null">
						${orderCol.level}
					</if>
					,
				</if>
				<if test="orderCol.containsKey('code')">
					a.code
					<if test="orderCol.code!= null">
						${orderCol.code}
					</if>
					,
				</if>
				<if test="orderCol.containsKey('contactsPeople')">
					a.contactsPeople
					<if test="orderCol.contactsPeople!= null">
						${orderCol.contactsPeople}
					</if>
					,
				</if>
				<if test="orderCol.containsKey('contactsMobile')">
					a.contactsMobile
					<if test="orderCol.contactsMobile!= null">
						${orderCol.contactsMobile}
					</if>
					,
				</if>
				<if test="orderCol.containsKey('childSize')">
					a.childSize
					<if test="orderCol.childSize!= null">
						${orderCol.childSize}
					</if>
					,
				</if>
				<if test="orderCol.containsKey('maxChildId')">
					a.maxChildId
					<if test="orderCol.maxChildId!= null">
						${orderCol.maxChildId}
					</if>
					,
				</if>
				<if test="orderCol.containsKey('status')">
					a.status
					<if test="orderCol.status!= null">
						${orderCol.status}
					</if>
					,
				</if>
				<if test="orderCol.containsKey('remark')">
					a.remark
					<if test="orderCol.remark!= null">
						${orderCol.remark}
					</if>
					,
				</if>
				<if test="orderCol.containsKey('createTime')">
					a.createTime
					<if test="orderCol.createTime!= null">
						${orderCol.createTime}
					</if>
					,
				</if>
				<if test="orderCol.containsKey('updateTime')">
					a.updateTime
					<if test="orderCol.updateTime!= null">
						${orderCol.updateTime}
					</if>
					,
				</if>
				<if test="orderCol.containsKey('createUserId')">
					a.createUserId
					<if test="orderCol.createUserId!= null">
						${orderCol.createUserId}
					</if>
					,
				</if>
				<if test="orderCol.containsKey('createUserName')">
					a.createUserName
					<if test="orderCol.createUserName!= null">
						${orderCol.createUserName}
					</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>