<?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.module.face.dao.ibatis.FacePlanDaoImpl">

    <!-- 字段和属性映射 -->
    <resultMap type="FacePlanEntity" id="FacePlanEntity-Map">
            <id  property="id" column="id" />
            <result property="indexCode" column="indexCode" />
            <result property="name" column="name" />
            <result property="faceGroupIndexCodes" column="faceGroupIndexCodes" />
            <result property="cameraIndexCodes" column="cameraIndexCodes" />
            <result property="recognitionResourceIndexCodes" column="recognitionResourceIndexCodes" />
            <result property="recognitionResourceType" column="recognitionResourceType" />
            <result property="recognitionPlanType" column="recognitionPlanType" />
            <result property="status" column="status" />
            <result property="available" column="available" />
            <result property="description" column="description" />
            <result property="startTime" column="startTime" />
            <result property="usingTime" column="usingTime" />
            <result property="threshold" column="threshold" />
            <result property="createTime" column="createTime" />
            <result property="createUserId" column="createUserId" />
            <result property="updateTime" column="updateTime" />
            <result property="updateUserId" column="updateUserId" />
            
    </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('indexCode') or colPickMode == 1 and data.containsKey('indexCode')))">
                    a.indexCode,
                </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('faceGroupIndexCodes') or colPickMode == 1 and data.containsKey('faceGroupIndexCodes')))">
                    a.faceGroupIndexCodes,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('cameraIndexCodes') or colPickMode == 1 and data.containsKey('cameraIndexCodes')))">
                    a.cameraIndexCodes,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('recognitionResourceIndexCodes') or colPickMode == 1 and data.containsKey('recognitionResourceIndexCodes')))">
                    a.recognitionResourceIndexCodes,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('recognitionResourceType') or colPickMode == 1 and data.containsKey('recognitionResourceType')))">
                    a.recognitionResourceType,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('recognitionPlanType') or colPickMode == 1 and data.containsKey('recognitionPlanType')))">
                    a.recognitionPlanType,
                </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('available') or colPickMode == 1 and data.containsKey('available')))">
                    a.available,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('description') or colPickMode == 1 and data.containsKey('description')))">
                    a.description,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('startTime') or colPickMode == 1 and data.containsKey('startTime')))">
                    a.startTime,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('usingTime') or colPickMode == 1 and data.containsKey('usingTime')))">
                    a.usingTime,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('threshold') or colPickMode == 1 and data.containsKey('threshold')))">
                    a.threshold,
                </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('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
                    a.updateTime,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateUserId') or colPickMode == 1 and data.containsKey('updateUserId')))">
                    a.updateUserId,
                </if>
        </trim>
    </sql>
    <!-- 新增 区分主键自增加还是业务插入 -->
    <insert id="insert" parameterType="FacePlanEntity"  useGeneratedKeys="true" keyProperty="id">
        insert into mortals_xhx_face_plan
        (indexCode,name,faceGroupIndexCodes,cameraIndexCodes,recognitionResourceIndexCodes,recognitionResourceType,recognitionPlanType,status,available,description,startTime,usingTime,threshold,createTime,createUserId,updateTime,updateUserId)
        VALUES
        (#{indexCode},#{name},#{faceGroupIndexCodes},#{cameraIndexCodes},#{recognitionResourceIndexCodes},#{recognitionResourceType},#{recognitionPlanType},#{status},#{available},#{description},#{startTime},#{usingTime},#{threshold},#{createTime},#{createUserId},#{updateTime},#{updateUserId})
    </insert>

    <!-- 批量新增 -->
    <insert id="insertBatch" parameterType="paramDto">
        insert into mortals_xhx_face_plan
        (indexCode,name,faceGroupIndexCodes,cameraIndexCodes,recognitionResourceIndexCodes,recognitionResourceType,recognitionPlanType,status,available,description,startTime,usingTime,threshold,createTime,createUserId,updateTime,updateUserId)
        VALUES
        <foreach collection="data.dataList" item="item" index="index" separator="," >
            (#{item.indexCode},#{item.name},#{item.faceGroupIndexCodes},#{item.cameraIndexCodes},#{item.recognitionResourceIndexCodes},#{item.recognitionResourceType},#{item.recognitionPlanType},#{item.status},#{item.available},#{item.description},#{item.startTime},#{item.usingTime},#{item.threshold},#{item.createTime},#{item.createUserId},#{item.updateTime},#{item.updateUserId})
        </foreach>
    </insert>


    <!-- 根据ParamDto更新 -->
    <update id="update" parameterType="paramDto">
        update mortals_xhx_face_plan as a
        set
        <trim suffixOverrides="," suffix="">
            <if test="(colPickMode==0 and data.containsKey('indexCode')) or (colPickMode==1 and !data.containsKey('indexCode'))">
                a.indexCode=#{data.indexCode},
            </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('faceGroupIndexCodes')) or (colPickMode==1 and !data.containsKey('faceGroupIndexCodes'))">
                a.faceGroupIndexCodes=#{data.faceGroupIndexCodes},
            </if>
            <if test="(colPickMode==0 and data.containsKey('cameraIndexCodes')) or (colPickMode==1 and !data.containsKey('cameraIndexCodes'))">
                a.cameraIndexCodes=#{data.cameraIndexCodes},
            </if>
            <if test="(colPickMode==0 and data.containsKey('recognitionResourceIndexCodes')) or (colPickMode==1 and !data.containsKey('recognitionResourceIndexCodes'))">
                a.recognitionResourceIndexCodes=#{data.recognitionResourceIndexCodes},
            </if>
            <if test="(colPickMode==0 and data.containsKey('recognitionResourceType')) or (colPickMode==1 and !data.containsKey('recognitionResourceType'))">
                a.recognitionResourceType=#{data.recognitionResourceType},
            </if>
            <if test="(colPickMode==0 and data.containsKey('recognitionPlanType')) or (colPickMode==1 and !data.containsKey('recognitionPlanType'))">
                a.recognitionPlanType=#{data.recognitionPlanType},
            </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('available')) or (colPickMode==1 and !data.containsKey('available'))">
                a.available=#{data.available},
            </if>
            <if test="(colPickMode==0 and data.containsKey('description')) or (colPickMode==1 and !data.containsKey('description'))">
                a.description=#{data.description},
            </if>
            <if test="(colPickMode==0 and data.containsKey('startTime')) or (colPickMode==1 and !data.containsKey('startTime'))">
                a.startTime=#{data.startTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('usingTime')) or (colPickMode==1 and !data.containsKey('usingTime'))">
                a.usingTime=#{data.usingTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('usingTimeIncrement')) or (colPickMode==1 and !data.containsKey('usingTimeIncrement'))">
                a.usingTime=ifnull(a.usingTime,0) + #{data.usingTimeIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('threshold')) or (colPickMode==1 and !data.containsKey('threshold'))">
                a.threshold=#{data.threshold},
            </if>
            <if test="(colPickMode==0 and data.containsKey('thresholdIncrement')) or (colPickMode==1 and !data.containsKey('thresholdIncrement'))">
                a.threshold=ifnull(a.threshold,0) + #{data.thresholdIncrement},
            </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('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
                a.updateTime=#{data.updateTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('updateUserId')) or (colPickMode==1 and !data.containsKey('updateUserId'))">
                a.updateUserId=#{data.updateUserId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !data.containsKey('updateUserIdIncrement'))">
                a.updateUserId=ifnull(a.updateUserId,0) + #{data.updateUserIdIncrement},
            </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_face_plan as a
        <trim prefix="set" suffixOverrides=",">
                <trim prefix="indexCode=(case" suffix="ELSE indexCode end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('indexCode')) or (colPickMode==1 and !item.containsKey('indexCode'))">
                            when a.id=#{item.id} then #{item.indexCode}
                        </if>
                    </foreach>
                </trim>
                <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="faceGroupIndexCodes=(case" suffix="ELSE faceGroupIndexCodes end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('faceGroupIndexCodes')) or (colPickMode==1 and !item.containsKey('faceGroupIndexCodes'))">
                            when a.id=#{item.id} then #{item.faceGroupIndexCodes}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="cameraIndexCodes=(case" suffix="ELSE cameraIndexCodes end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('cameraIndexCodes')) or (colPickMode==1 and !item.containsKey('cameraIndexCodes'))">
                            when a.id=#{item.id} then #{item.cameraIndexCodes}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="recognitionResourceIndexCodes=(case" suffix="ELSE recognitionResourceIndexCodes end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('recognitionResourceIndexCodes')) or (colPickMode==1 and !item.containsKey('recognitionResourceIndexCodes'))">
                            when a.id=#{item.id} then #{item.recognitionResourceIndexCodes}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="recognitionResourceType=(case" suffix="ELSE recognitionResourceType end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('recognitionResourceType')) or (colPickMode==1 and !item.containsKey('recognitionResourceType'))">
                            when a.id=#{item.id} then #{item.recognitionResourceType}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="recognitionPlanType=(case" suffix="ELSE recognitionPlanType end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('recognitionPlanType')) or (colPickMode==1 and !item.containsKey('recognitionPlanType'))">
                            when a.id=#{item.id} then #{item.recognitionPlanType}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="status=(case" suffix="ELSE status end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('status')) or (colPickMode==1 and !item.containsKey('status'))">
                            when a.id=#{item.id} then #{item.status}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="available=(case" suffix="ELSE available end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('available')) or (colPickMode==1 and !item.containsKey('available'))">
                            when a.id=#{item.id} then #{item.available}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="description=(case" suffix="ELSE description end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('description')) or (colPickMode==1 and !item.containsKey('description'))">
                            when a.id=#{item.id} then #{item.description}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="startTime=(case" suffix="ELSE startTime end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('startTime')) or (colPickMode==1 and !item.containsKey('startTime'))">
                            when a.id=#{item.id} then #{item.startTime}
                        </if>
                    </foreach>
                </trim>
                        <trim prefix="usingTime=(case" suffix="ELSE usingTime end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('usingTime')) or (colPickMode==1 and !item.containsKey('usingTime'))">
                                        when a.id=#{item.id} then #{item.usingTime}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('usingTimeIncrement')) or (colPickMode==1 and !item.containsKey('usingTimeIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.usingTime,0) + #{item.usingTimeIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="threshold=(case" suffix="ELSE threshold end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('threshold')) or (colPickMode==1 and !item.containsKey('threshold'))">
                                        when a.id=#{item.id} then #{item.threshold}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('thresholdIncrement')) or (colPickMode==1 and !item.containsKey('thresholdIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.threshold,0) + #{item.thresholdIncrement}
                                    </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="updateTime=(case" suffix="ELSE updateTime end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('updateTime')) or (colPickMode==1 and !item.containsKey('updateTime'))">
                            when a.id=#{item.id} then #{item.updateTime}
                        </if>
                    </foreach>
                </trim>
                        <trim prefix="updateUserId=(case" suffix="ELSE updateUserId end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('updateUserId')) or (colPickMode==1 and !item.containsKey('updateUserId'))">
                                        when a.id=#{item.id} then #{item.updateUserId}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !item.containsKey('updateUserIdIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.updateUserId,0) + #{item.updateUserIdIncrement}
                                    </when>
                                </choose>
                            </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="FacePlanEntity-Map">
        select <include refid="_columns"/>
        from mortals_xhx_face_plan as a
        where a.id=#{condition.id}
    </select>
    <!-- 根据主健删除 -->
    <delete id="deleteByKey" parameterType="paramDto">
        delete a.* from mortals_xhx_face_plan as a where a.id=#{condition.id}
    </delete>
    <!-- 根据主健删除一批，针对单一主健有效 -->
    <delete id="deleteByKeys">
        delete from mortals_xhx_face_plan where id in
        <foreach collection="array" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>
    <!-- 根据主健列表删除一批，针对单一主健有效 -->
    <delete id="deleteByKeyList">
        delete from mortals_xhx_face_plan where id in
        <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>

    <!-- 根据对象列表删除一批，针对单一主健有效 -->
    <delete id="deleteByEntityList">
        delete from mortals_xhx_face_plan 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_face_plan as a
        <trim suffixOverrides="where" suffix="">
            where
            <trim prefixOverrides="and" prefix="">
                <include refid="_condition_"/>
            </trim>
        </trim>
    </delete>
    <!-- 获取列表 -->
    <select id="getList" parameterType="paramDto" resultMap="FacePlanEntity-Map">
        select <include refid="_columns"/>
        from mortals_xhx_face_plan 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_face_plan 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('indexCode')">
                <if test="conditionParamRef.indexCode != null and conditionParamRef.indexCode != ''">
                    ${_conditionType_} a.indexCode like #{${_conditionParam_}.indexCode}
                </if>
                <if test="conditionParamRef.indexCode == null">
                    ${_conditionType_} a.indexCode is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('indexCodeList') and conditionParamRef.indexCodeList.size() > 0">
                ${_conditionType_} a.indexCode in
                <foreach collection="conditionParamRef.indexCodeList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('indexCodeNotList') and conditionParamRef.indexCodeNotList.size() > 0">
                ${_conditionType_} a.indexCode not in
                <foreach collection="conditionParamRef.indexCodeNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </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('faceGroupIndexCodes')">
                <if test="conditionParamRef.faceGroupIndexCodes != null and conditionParamRef.faceGroupIndexCodes != ''">
                    ${_conditionType_} a.faceGroupIndexCodes like #{${_conditionParam_}.faceGroupIndexCodes}
                </if>
                <if test="conditionParamRef.faceGroupIndexCodes == null">
                    ${_conditionType_} a.faceGroupIndexCodes is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('faceGroupIndexCodesList') and conditionParamRef.faceGroupIndexCodesList.size() > 0">
                ${_conditionType_} a.faceGroupIndexCodes in
                <foreach collection="conditionParamRef.faceGroupIndexCodesList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('faceGroupIndexCodesNotList') and conditionParamRef.faceGroupIndexCodesNotList.size() > 0">
                ${_conditionType_} a.faceGroupIndexCodes not in
                <foreach collection="conditionParamRef.faceGroupIndexCodesNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>

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

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

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

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

            <if test="conditionParamRef.containsKey('status')">
                <if test="conditionParamRef.status != null and conditionParamRef.status != ''">
                    ${_conditionType_} a.status like #{${_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('available')">
                <if test="conditionParamRef.available != null and conditionParamRef.available != ''">
                    ${_conditionType_} a.available like #{${_conditionParam_}.available}
                </if>
                <if test="conditionParamRef.available == null">
                    ${_conditionType_} a.available is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('availableList') and conditionParamRef.availableList.size() > 0">
                ${_conditionType_} a.available in
                <foreach collection="conditionParamRef.availableList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('availableNotList') and conditionParamRef.availableNotList.size() > 0">
                ${_conditionType_} a.available not in
                <foreach collection="conditionParamRef.availableNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>

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

            <if test="conditionParamRef.containsKey('startTime')">
                <if test="conditionParamRef.startTime != null ">
                    ${_conditionType_} a.startTime = #{${_conditionParam_}.startTime}
                </if>
                <if test="conditionParamRef.startTime == null">
                    ${_conditionType_} a.startTime is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('startTimeStart') and conditionParamRef.startTimeStart != null and conditionParamRef.startTimeStart!=''">
                ${_conditionType_} a.startTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.startTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
            </if>
            <if test="conditionParamRef.containsKey('startTimeEnd') and conditionParamRef.startTimeEnd != null and conditionParamRef.startTimeEnd!=''">
                ${_conditionType_} a.startTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.startTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
            </if>
            <if test="conditionParamRef.containsKey('usingTime')">
                <if test="conditionParamRef.usingTime != null ">
                    ${_conditionType_} a.usingTime = #{${_conditionParam_}.usingTime}
                </if>
                <if test="conditionParamRef.usingTime == null">
                    ${_conditionType_} a.usingTime is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('usingTimeList') and conditionParamRef.usingTimeList.size() > 0">
                ${_conditionType_} a.usingTime in
                <foreach collection="conditionParamRef.usingTimeList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('usingTimeNotList') and conditionParamRef.usingTimeNotList.size() > 0">
                ${_conditionType_} a.usingTime not in
                <foreach collection="conditionParamRef.usingTimeNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('usingTimeStart') and conditionParamRef.usingTimeStart != null">
                ${_conditionType_} a.usingTime <![CDATA[ >= ]]> #{${_conditionParam_}.usingTimeStart}
            </if>
            <if test="conditionParamRef.containsKey('usingTimeEnd') and conditionParamRef.usingTimeEnd != null">
                ${_conditionType_} a.usingTime <![CDATA[ <= ]]> #{${_conditionParam_}.usingTimeEnd}
            </if>

            <if test="conditionParamRef.containsKey('threshold')">
                <if test="conditionParamRef.threshold != null ">
                    ${_conditionType_} a.threshold = #{${_conditionParam_}.threshold}
                </if>
                <if test="conditionParamRef.threshold == null">
                    ${_conditionType_} a.threshold is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('thresholdList') and conditionParamRef.thresholdList.size() > 0">
                ${_conditionType_} a.threshold in
                <foreach collection="conditionParamRef.thresholdList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('thresholdNotList') and conditionParamRef.thresholdNotList.size() > 0">
                ${_conditionType_} a.threshold not in
                <foreach collection="conditionParamRef.thresholdNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('thresholdStart') and conditionParamRef.thresholdStart != null">
                ${_conditionType_} a.threshold <![CDATA[ >= ]]> #{${_conditionParam_}.thresholdStart}
            </if>
            <if test="conditionParamRef.containsKey('thresholdEnd') and conditionParamRef.thresholdEnd != null">
                ${_conditionType_} a.threshold <![CDATA[ <= ]]> #{${_conditionParam_}.thresholdEnd}
            </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('updateTime')">
                <if test="conditionParamRef.updateTime != null ">
                    ${_conditionType_} a.updateTime = #{${_conditionParam_}.updateTime}
                </if>
                <if test="conditionParamRef.updateTime == null">
                    ${_conditionType_} a.updateTime is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('updateTimeStart') and conditionParamRef.updateTimeStart != null and conditionParamRef.updateTimeStart!=''">
                ${_conditionType_} a.updateTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
            </if>
            <if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
                ${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
            </if>
            <if test="conditionParamRef.containsKey('updateUserId')">
                <if test="conditionParamRef.updateUserId != null ">
                    ${_conditionType_} a.updateUserId = #{${_conditionParam_}.updateUserId}
                </if>
                <if test="conditionParamRef.updateUserId == null">
                    ${_conditionType_} a.updateUserId is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
                ${_conditionType_} a.updateUserId in
                <foreach collection="conditionParamRef.updateUserIdList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('updateUserIdNotList') and conditionParamRef.updateUserIdNotList.size() > 0">
                ${_conditionType_} a.updateUserId not in
                <foreach collection="conditionParamRef.updateUserIdNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('updateUserIdStart') and conditionParamRef.updateUserIdStart != null">
                ${_conditionType_} a.updateUserId <![CDATA[ >= ]]> #{${_conditionParam_}.updateUserIdStart}
            </if>
            <if test="conditionParamRef.containsKey('updateUserIdEnd') and conditionParamRef.updateUserIdEnd != null">
                ${_conditionType_} a.updateUserId <![CDATA[ <= ]]> #{${_conditionParam_}.updateUserIdEnd}
            </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('indexCode')">
                        a.indexCode
                        <if test='orderCol.indexCode != null and "DESC".equalsIgnoreCase(orderCol.indexCode)'>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('faceGroupIndexCodes')">
                        a.faceGroupIndexCodes
                        <if test='orderCol.faceGroupIndexCodes != null and "DESC".equalsIgnoreCase(orderCol.faceGroupIndexCodes)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('cameraIndexCodes')">
                        a.cameraIndexCodes
                        <if test='orderCol.cameraIndexCodes != null and "DESC".equalsIgnoreCase(orderCol.cameraIndexCodes)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('recognitionResourceIndexCodes')">
                        a.recognitionResourceIndexCodes
                        <if test='orderCol.recognitionResourceIndexCodes != null and "DESC".equalsIgnoreCase(orderCol.recognitionResourceIndexCodes)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('recognitionResourceType')">
                        a.recognitionResourceType
                        <if test='orderCol.recognitionResourceType != null and "DESC".equalsIgnoreCase(orderCol.recognitionResourceType)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('recognitionPlanType')">
                        a.recognitionPlanType
                        <if test='orderCol.recognitionPlanType != null and "DESC".equalsIgnoreCase(orderCol.recognitionPlanType)'>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('available')">
                        a.available
                        <if test='orderCol.available != null and "DESC".equalsIgnoreCase(orderCol.available)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('description')">
                        a.description
                        <if test='orderCol.description != null and "DESC".equalsIgnoreCase(orderCol.description)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('startTime')">
                        a.startTime
                        <if test='orderCol.startTime != null and "DESC".equalsIgnoreCase(orderCol.startTime)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('usingTime')">
                        a.usingTime
                        <if test='orderCol.usingTime != null and "DESC".equalsIgnoreCase(orderCol.usingTime)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('threshold')">
                        a.threshold
                        <if test='orderCol.threshold != null and "DESC".equalsIgnoreCase(orderCol.threshold)'>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('updateTime')">
                        a.updateTime
                        <if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('updateUserId')">
                        a.updateUserId
                        <if test='orderCol.updateUserId != null and "DESC".equalsIgnoreCase(orderCol.updateUserId)'>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>