<?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.ph.dao.ibatis.PhQueueDaoImpl">

    <!-- 字段和属性映射 -->
    <resultMap type="PhQueueEntity" id="PhQueueEntity-Map">
            <id  property="id" column="id" />
            <result property="ordernumber" column="ordernumber" />
            <result property="style" column="style" />
            <result property="business" column="business" />
            <result property="windowName" column="window_name" />
            <result property="windowFromnum" column="window_fromnum" />
            <result property="flownum" column="flownum" />
            <result property="formernum" column="formernum" />
            <result property="peopleIdcard" column="people_idcard" />
            <result property="peopleName" column="people_name" />
            <result property="peopleSex" column="people_sex" />
            <result property="peoplePhone" column="people_phone" />
            <result property="workmanName" column="workman_name" />
            <result property="workmanNumber" column="workman_number" />
            <result property="taketime" column="taketime" />
            <result property="calltime" column="calltime" />
            <result property="endtime" column="endtime" />
            <result property="waitTime" column="wait_time" />
            <result property="handleTime" column="handle_time" />
            <result property="deviceName" column="device_name" />
            <result property="callName" column="call_name" />
            <result property="matterName" column="matter_name" />
            <result property="queueid" column="queueid" />
            <result property="wySignin" column="wy_signin" />
            <result property="sectionName" column="section_name" />
            <result property="hallName" column="hall_name" />
            <result property="deviceType" column="device_type" />
            <result property="siteId" column="site_id" />
            <result property="siteCode" column="site_code" />
            <result property="siteName" column="site_name" />
            <result property="extNum" column="ext_num" />
            <result property="createUserId" column="create_user_id" />
            <result property="createTime" column="create_time" />
            <result property="updateTime" column="update_time" />
            
    </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('ordernumber') or colPickMode == 1 and data.containsKey('ordernumber')))">
                    a.ordernumber,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('style') or colPickMode == 1 and data.containsKey('style')))">
                    a.style,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('business') or colPickMode == 1 and data.containsKey('business')))">
                    a.business,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('windowName') or colPickMode == 1 and data.containsKey('windowName')))">
                    a.window_name,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('windowFromnum') or colPickMode == 1 and data.containsKey('windowFromnum')))">
                    a.window_fromnum,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('flownum') or colPickMode == 1 and data.containsKey('flownum')))">
                    a.flownum,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('formernum') or colPickMode == 1 and data.containsKey('formernum')))">
                    a.formernum,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('peopleIdcard') or colPickMode == 1 and data.containsKey('peopleIdcard')))">
                    a.people_idcard,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('peopleName') or colPickMode == 1 and data.containsKey('peopleName')))">
                    a.people_name,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('peopleSex') or colPickMode == 1 and data.containsKey('peopleSex')))">
                    a.people_sex,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('peoplePhone') or colPickMode == 1 and data.containsKey('peoplePhone')))">
                    a.people_phone,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('workmanName') or colPickMode == 1 and data.containsKey('workmanName')))">
                    a.workman_name,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('workmanNumber') or colPickMode == 1 and data.containsKey('workmanNumber')))">
                    a.workman_number,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('taketime') or colPickMode == 1 and data.containsKey('taketime')))">
                    a.taketime,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('calltime') or colPickMode == 1 and data.containsKey('calltime')))">
                    a.calltime,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('endtime') or colPickMode == 1 and data.containsKey('endtime')))">
                    a.endtime,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('waitTime') or colPickMode == 1 and data.containsKey('waitTime')))">
                    a.wait_time,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('handleTime') or colPickMode == 1 and data.containsKey('handleTime')))">
                    a.handle_time,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceName') or colPickMode == 1 and data.containsKey('deviceName')))">
                    a.device_name,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('callName') or colPickMode == 1 and data.containsKey('callName')))">
                    a.call_name,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('matterName') or colPickMode == 1 and data.containsKey('matterName')))">
                    a.matter_name,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('queueid') or colPickMode == 1 and data.containsKey('queueid')))">
                    a.queueid,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('wySignin') or colPickMode == 1 and data.containsKey('wySignin')))">
                    a.wy_signin,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('sectionName') or colPickMode == 1 and data.containsKey('sectionName')))">
                    a.section_name,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('hallName') or colPickMode == 1 and data.containsKey('hallName')))">
                    a.hall_name,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceType') or colPickMode == 1 and data.containsKey('deviceType')))">
                    a.device_type,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteId') or colPickMode == 1 and data.containsKey('siteId')))">
                    a.site_id,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteCode') or colPickMode == 1 and data.containsKey('siteCode')))">
                    a.site_code,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteName') or colPickMode == 1 and data.containsKey('siteName')))">
                    a.site_name,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('extNum') or colPickMode == 1 and data.containsKey('extNum')))">
                    a.ext_num,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createUserId') or colPickMode == 1 and data.containsKey('createUserId')))">
                    a.create_user_id,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
                    a.create_time,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
                    a.update_time,
                </if>
        </trim>
    </sql>
    <!-- 新增 区分主键自增加还是业务插入 -->
    <insert id="insert" parameterType="PhQueueEntity"  useGeneratedKeys="true" keyProperty="id">
        insert into mortals_xhx_ph_queue
        (ordernumber,style,business,window_name,window_fromnum,flownum,formernum,people_idcard,people_name,people_sex,people_phone,workman_name,workman_number,taketime,calltime,endtime,wait_time,handle_time,device_name,call_name,matter_name,queueid,wy_signin,section_name,hall_name,device_type,site_id,site_code,site_name,ext_num,create_user_id,create_time,update_time)
        VALUES
        (#{ordernumber},#{style},#{business},#{windowName},#{windowFromnum},#{flownum},#{formernum},#{peopleIdcard},#{peopleName},#{peopleSex},#{peoplePhone},#{workmanName},#{workmanNumber},#{taketime},#{calltime},#{endtime},#{waitTime},#{handleTime},#{deviceName},#{callName},#{matterName},#{queueid},#{wySignin},#{sectionName},#{hallName},#{deviceType},#{siteId},#{siteCode},#{siteName},#{extNum},#{createUserId},#{createTime},#{updateTime})
    </insert>

    <!-- 批量新增 -->
    <insert id="insertBatch" parameterType="paramDto">
        insert into mortals_xhx_ph_queue
        (ordernumber,style,business,window_name,window_fromnum,flownum,formernum,people_idcard,people_name,people_sex,people_phone,workman_name,workman_number,taketime,calltime,endtime,wait_time,handle_time,device_name,call_name,matter_name,queueid,wy_signin,section_name,hall_name,device_type,site_id,site_code,site_name,ext_num,create_user_id,create_time,update_time)
        VALUES
        <foreach collection="data.dataList" item="item" index="index" separator="," >
            (#{item.ordernumber},#{item.style},#{item.business},#{item.windowName},#{item.windowFromnum},#{item.flownum},#{item.formernum},#{item.peopleIdcard},#{item.peopleName},#{item.peopleSex},#{item.peoplePhone},#{item.workmanName},#{item.workmanNumber},#{item.taketime},#{item.calltime},#{item.endtime},#{item.waitTime},#{item.handleTime},#{item.deviceName},#{item.callName},#{item.matterName},#{item.queueid},#{item.wySignin},#{item.sectionName},#{item.hallName},#{item.deviceType},#{item.siteId},#{item.siteCode},#{item.siteName},#{item.extNum},#{item.createUserId},#{item.createTime},#{item.updateTime})
        </foreach>
    </insert>


    <!-- 根据ParamDto更新 -->
    <update id="update" parameterType="paramDto">
        update mortals_xhx_ph_queue as a
        set
        <trim suffixOverrides="," suffix="">
            <if test="(colPickMode==0 and data.containsKey('ordernumber')) or (colPickMode==1 and !data.containsKey('ordernumber'))">
                a.ordernumber=#{data.ordernumber},
            </if>
            <if test="(colPickMode==0 and data.containsKey('style')) or (colPickMode==1 and !data.containsKey('style'))">
                a.style=#{data.style},
            </if>
            <if test="(colPickMode==0 and data.containsKey('business')) or (colPickMode==1 and !data.containsKey('business'))">
                a.business=#{data.business},
            </if>
            <if test="(colPickMode==0 and data.containsKey('windowName')) or (colPickMode==1 and !data.containsKey('windowName'))">
                a.window_name=#{data.windowName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('windowFromnum')) or (colPickMode==1 and !data.containsKey('windowFromnum'))">
                a.window_fromnum=#{data.windowFromnum},
            </if>
            <if test="(colPickMode==0 and data.containsKey('flownum')) or (colPickMode==1 and !data.containsKey('flownum'))">
                a.flownum=#{data.flownum},
            </if>
            <if test="(colPickMode==0 and data.containsKey('formernum')) or (colPickMode==1 and !data.containsKey('formernum'))">
                a.formernum=#{data.formernum},
            </if>
            <if test="(colPickMode==0 and data.containsKey('peopleIdcard')) or (colPickMode==1 and !data.containsKey('peopleIdcard'))">
                a.people_idcard=#{data.peopleIdcard},
            </if>
            <if test="(colPickMode==0 and data.containsKey('peopleName')) or (colPickMode==1 and !data.containsKey('peopleName'))">
                a.people_name=#{data.peopleName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('peopleSex')) or (colPickMode==1 and !data.containsKey('peopleSex'))">
                a.people_sex=#{data.peopleSex},
            </if>
            <if test="(colPickMode==0 and data.containsKey('peoplePhone')) or (colPickMode==1 and !data.containsKey('peoplePhone'))">
                a.people_phone=#{data.peoplePhone},
            </if>
            <if test="(colPickMode==0 and data.containsKey('workmanName')) or (colPickMode==1 and !data.containsKey('workmanName'))">
                a.workman_name=#{data.workmanName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('workmanNumber')) or (colPickMode==1 and !data.containsKey('workmanNumber'))">
                a.workman_number=#{data.workmanNumber},
            </if>
            <if test="(colPickMode==0 and data.containsKey('taketime')) or (colPickMode==1 and !data.containsKey('taketime'))">
                a.taketime=#{data.taketime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('calltime')) or (colPickMode==1 and !data.containsKey('calltime'))">
                a.calltime=#{data.calltime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('endtime')) or (colPickMode==1 and !data.containsKey('endtime'))">
                a.endtime=#{data.endtime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('waitTime')) or (colPickMode==1 and !data.containsKey('waitTime'))">
                a.wait_time=#{data.waitTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('waitTimeIncrement')) or (colPickMode==1 and !data.containsKey('waitTimeIncrement'))">
                a.wait_time=ifnull(a.wait_time,0) + #{data.waitTimeIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('handleTime')) or (colPickMode==1 and !data.containsKey('handleTime'))">
                a.handle_time=#{data.handleTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('handleTimeIncrement')) or (colPickMode==1 and !data.containsKey('handleTimeIncrement'))">
                a.handle_time=ifnull(a.handle_time,0) + #{data.handleTimeIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceName')) or (colPickMode==1 and !data.containsKey('deviceName'))">
                a.device_name=#{data.deviceName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('callName')) or (colPickMode==1 and !data.containsKey('callName'))">
                a.call_name=#{data.callName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('matterName')) or (colPickMode==1 and !data.containsKey('matterName'))">
                a.matter_name=#{data.matterName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('queueid')) or (colPickMode==1 and !data.containsKey('queueid'))">
                a.queueid=#{data.queueid},
            </if>
            <if test="(colPickMode==0 and data.containsKey('wySignin')) or (colPickMode==1 and !data.containsKey('wySignin'))">
                a.wy_signin=#{data.wySignin},
            </if>
            <if test="(colPickMode==0 and data.containsKey('sectionName')) or (colPickMode==1 and !data.containsKey('sectionName'))">
                a.section_name=#{data.sectionName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('hallName')) or (colPickMode==1 and !data.containsKey('hallName'))">
                a.hall_name=#{data.hallName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceType')) or (colPickMode==1 and !data.containsKey('deviceType'))">
                a.device_type=#{data.deviceType},
            </if>
            <if test="(colPickMode==0 and data.containsKey('siteId')) or (colPickMode==1 and !data.containsKey('siteId'))">
                a.site_id=#{data.siteId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('siteIdIncrement')) or (colPickMode==1 and !data.containsKey('siteIdIncrement'))">
                a.site_id=ifnull(a.site_id,0) + #{data.siteIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('siteCode')) or (colPickMode==1 and !data.containsKey('siteCode'))">
                a.site_code=#{data.siteCode},
            </if>
            <if test="(colPickMode==0 and data.containsKey('siteName')) or (colPickMode==1 and !data.containsKey('siteName'))">
                a.site_name=#{data.siteName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('extNum')) or (colPickMode==1 and !data.containsKey('extNum'))">
                a.ext_num=#{data.extNum},
            </if>
            <if test="(colPickMode==0 and data.containsKey('createUserId')) or (colPickMode==1 and !data.containsKey('createUserId'))">
                a.create_user_id=#{data.createUserId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('createUserIdIncrement')) or (colPickMode==1 and !data.containsKey('createUserIdIncrement'))">
                a.create_user_id=ifnull(a.create_user_id,0) + #{data.createUserIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))">
                a.create_time=#{data.createTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
                a.update_time=#{data.updateTime},
            </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_ph_queue as a
        <trim prefix="set" suffixOverrides=",">
                <trim prefix="ordernumber=(case" suffix="ELSE ordernumber end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('ordernumber')) or (colPickMode==1 and !item.containsKey('ordernumber'))">
                            when a.id=#{item.id} then #{item.ordernumber}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="style=(case" suffix="ELSE style end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('style')) or (colPickMode==1 and !item.containsKey('style'))">
                            when a.id=#{item.id} then #{item.style}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="business=(case" suffix="ELSE business end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('business')) or (colPickMode==1 and !item.containsKey('business'))">
                            when a.id=#{item.id} then #{item.business}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="window_name=(case" suffix="ELSE window_name end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('windowName')) or (colPickMode==1 and !item.containsKey('windowName'))">
                            when a.id=#{item.id} then #{item.windowName}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="window_fromnum=(case" suffix="ELSE window_fromnum end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('windowFromnum')) or (colPickMode==1 and !item.containsKey('windowFromnum'))">
                            when a.id=#{item.id} then #{item.windowFromnum}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="flownum=(case" suffix="ELSE flownum end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('flownum')) or (colPickMode==1 and !item.containsKey('flownum'))">
                            when a.id=#{item.id} then #{item.flownum}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="formernum=(case" suffix="ELSE formernum end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('formernum')) or (colPickMode==1 and !item.containsKey('formernum'))">
                            when a.id=#{item.id} then #{item.formernum}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="people_idcard=(case" suffix="ELSE people_idcard end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('peopleIdcard')) or (colPickMode==1 and !item.containsKey('peopleIdcard'))">
                            when a.id=#{item.id} then #{item.peopleIdcard}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="people_name=(case" suffix="ELSE people_name end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('peopleName')) or (colPickMode==1 and !item.containsKey('peopleName'))">
                            when a.id=#{item.id} then #{item.peopleName}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="people_sex=(case" suffix="ELSE people_sex end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('peopleSex')) or (colPickMode==1 and !item.containsKey('peopleSex'))">
                            when a.id=#{item.id} then #{item.peopleSex}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="people_phone=(case" suffix="ELSE people_phone end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('peoplePhone')) or (colPickMode==1 and !item.containsKey('peoplePhone'))">
                            when a.id=#{item.id} then #{item.peoplePhone}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="workman_name=(case" suffix="ELSE workman_name end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('workmanName')) or (colPickMode==1 and !item.containsKey('workmanName'))">
                            when a.id=#{item.id} then #{item.workmanName}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="workman_number=(case" suffix="ELSE workman_number end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('workmanNumber')) or (colPickMode==1 and !item.containsKey('workmanNumber'))">
                            when a.id=#{item.id} then #{item.workmanNumber}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="taketime=(case" suffix="ELSE taketime end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('taketime')) or (colPickMode==1 and !item.containsKey('taketime'))">
                            when a.id=#{item.id} then #{item.taketime}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="calltime=(case" suffix="ELSE calltime end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('calltime')) or (colPickMode==1 and !item.containsKey('calltime'))">
                            when a.id=#{item.id} then #{item.calltime}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="endtime=(case" suffix="ELSE endtime end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('endtime')) or (colPickMode==1 and !item.containsKey('endtime'))">
                            when a.id=#{item.id} then #{item.endtime}
                        </if>
                    </foreach>
                </trim>
                        <trim prefix="wait_time=(case" suffix="ELSE wait_time end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('waitTime')) or (colPickMode==1 and !item.containsKey('waitTime'))">
                                        when a.id=#{item.id} then #{item.waitTime}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('waitTimeIncrement')) or (colPickMode==1 and !item.containsKey('waitTimeIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.wait_time,0) + #{item.waitTimeIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="handle_time=(case" suffix="ELSE handle_time end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('handleTime')) or (colPickMode==1 and !item.containsKey('handleTime'))">
                                        when a.id=#{item.id} then #{item.handleTime}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('handleTimeIncrement')) or (colPickMode==1 and !item.containsKey('handleTimeIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.handle_time,0) + #{item.handleTimeIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                <trim prefix="device_name=(case" suffix="ELSE device_name end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('deviceName')) or (colPickMode==1 and !item.containsKey('deviceName'))">
                            when a.id=#{item.id} then #{item.deviceName}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="call_name=(case" suffix="ELSE call_name end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('callName')) or (colPickMode==1 and !item.containsKey('callName'))">
                            when a.id=#{item.id} then #{item.callName}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="matter_name=(case" suffix="ELSE matter_name end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('matterName')) or (colPickMode==1 and !item.containsKey('matterName'))">
                            when a.id=#{item.id} then #{item.matterName}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="queueid=(case" suffix="ELSE queueid end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('queueid')) or (colPickMode==1 and !item.containsKey('queueid'))">
                            when a.id=#{item.id} then #{item.queueid}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="wy_signin=(case" suffix="ELSE wy_signin end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('wySignin')) or (colPickMode==1 and !item.containsKey('wySignin'))">
                            when a.id=#{item.id} then #{item.wySignin}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="section_name=(case" suffix="ELSE section_name end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('sectionName')) or (colPickMode==1 and !item.containsKey('sectionName'))">
                            when a.id=#{item.id} then #{item.sectionName}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="hall_name=(case" suffix="ELSE hall_name end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('hallName')) or (colPickMode==1 and !item.containsKey('hallName'))">
                            when a.id=#{item.id} then #{item.hallName}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="device_type=(case" suffix="ELSE device_type end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('deviceType')) or (colPickMode==1 and !item.containsKey('deviceType'))">
                            when a.id=#{item.id} then #{item.deviceType}
                        </if>
                    </foreach>
                </trim>
                        <trim prefix="site_id=(case" suffix="ELSE site_id end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('siteId')) or (colPickMode==1 and !item.containsKey('siteId'))">
                                        when a.id=#{item.id} then #{item.siteId}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('siteIdIncrement')) or (colPickMode==1 and !item.containsKey('siteIdIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.site_id,0) + #{item.siteIdIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                <trim prefix="site_code=(case" suffix="ELSE site_code end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('siteCode')) or (colPickMode==1 and !item.containsKey('siteCode'))">
                            when a.id=#{item.id} then #{item.siteCode}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="site_name=(case" suffix="ELSE site_name end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('siteName')) or (colPickMode==1 and !item.containsKey('siteName'))">
                            when a.id=#{item.id} then #{item.siteName}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="ext_num=(case" suffix="ELSE ext_num end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('extNum')) or (colPickMode==1 and !item.containsKey('extNum'))">
                            when a.id=#{item.id} then #{item.extNum}
                        </if>
                    </foreach>
                </trim>
                        <trim prefix="create_user_id=(case" suffix="ELSE create_user_id 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.create_user_id,0) + #{item.createUserIdIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                <trim prefix="create_time=(case" suffix="ELSE create_time 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="update_time=(case" suffix="ELSE update_time 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>
        where id in
        <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
            #{item.id}
        </foreach>
    </update>
    <!-- 根据主健查询 -->
    <select id="getByKey" parameterType="paramDto" resultMap="PhQueueEntity-Map">
        select <include refid="_columns"/>
        from mortals_xhx_ph_queue as a
        where a.id=#{condition.id}
    </select>
    <!-- 根据主健删除 -->
    <delete id="deleteByKey" parameterType="paramDto">
        delete a.* from mortals_xhx_ph_queue as a where a.id=#{condition.id}
    </delete>
    <!-- 根据主健删除一批，针对单一主健有效 -->
    <delete id="deleteByKeys">
        delete from mortals_xhx_ph_queue where id in
        <foreach collection="array" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>
    <!-- 根据主健列表删除一批，针对单一主健有效 -->
    <delete id="deleteByKeyList">
        delete from mortals_xhx_ph_queue where id in
        <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>

    <!-- 根据对象列表删除一批，针对单一主健有效 -->
    <delete id="deleteByEntityList">
        delete from mortals_xhx_ph_queue 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_ph_queue as a
        <trim suffixOverrides="where" suffix="">
            where
            <trim prefixOverrides="and" prefix="">
                <include refid="_condition_"/>
            </trim>
        </trim>
    </delete>
    <!-- 获取列表 -->
    <select id="getList" parameterType="paramDto" resultMap="PhQueueEntity-Map">
        select <include refid="_columns"/>
        from mortals_xhx_ph_queue 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_ph_queue 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="permissionSql != null and permissionSql != ''">
            ${permissionSql}
        </if>

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

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

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

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

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

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

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

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

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

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

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

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

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

            <if test="conditionParamRef.containsKey('taketime')">
                <if test="conditionParamRef.taketime != null ">
                    ${_conditionType_} a.taketime = #{${_conditionParam_}.taketime}
                </if>
                <if test="conditionParamRef.taketime == null">
                    ${_conditionType_} a.taketime is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('taketimeStart') and conditionParamRef.taketimeStart != null and conditionParamRef.taketimeStart!=''">
                ${_conditionType_} a.taketime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.taketimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
            </if>
            <if test="conditionParamRef.containsKey('taketimeEnd') and conditionParamRef.taketimeEnd != null and conditionParamRef.taketimeEnd!=''">
                ${_conditionType_} a.taketime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.taketimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
            </if>

            <if test="conditionParamRef.containsKey('calltime')">
                <if test="conditionParamRef.calltime != null ">
                    ${_conditionType_} a.calltime = #{${_conditionParam_}.calltime}
                </if>
                <if test="conditionParamRef.calltime == null">
                    ${_conditionType_} a.calltime is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('calltimeStart') and conditionParamRef.calltimeStart != null and conditionParamRef.calltimeStart!=''">
                ${_conditionType_} a.calltime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.calltimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
            </if>
            <if test="conditionParamRef.containsKey('calltimeEnd') and conditionParamRef.calltimeEnd != null and conditionParamRef.calltimeEnd!=''">
                ${_conditionType_} a.calltime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.calltimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
            </if>

            <if test="conditionParamRef.containsKey('endtime')">
                <if test="conditionParamRef.endtime != null ">
                    ${_conditionType_} a.endtime = #{${_conditionParam_}.endtime}
                </if>
                <if test="conditionParamRef.endtime == null">
                    ${_conditionType_} a.endtime is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('endtimeStart') and conditionParamRef.endtimeStart != null and conditionParamRef.endtimeStart!=''">
                ${_conditionType_} a.endtime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.endtimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
            </if>
            <if test="conditionParamRef.containsKey('endtimeEnd') and conditionParamRef.endtimeEnd != null and conditionParamRef.endtimeEnd!=''">
                ${_conditionType_} a.endtime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.endtimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
            </if>
            <if test="conditionParamRef.containsKey('waitTime')">
                <if test="conditionParamRef.waitTime != null ">
                    ${_conditionType_} a.wait_time = #{${_conditionParam_}.waitTime}
                </if>
                <if test="conditionParamRef.waitTime == null">
                    ${_conditionType_} a.wait_time is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('waitTimeList') and conditionParamRef.waitTimeList.size() > 0">
                ${_conditionType_} a.wait_time in
                <foreach collection="conditionParamRef.waitTimeList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('waitTimeNotList') and conditionParamRef.waitTimeNotList.size() > 0">
                ${_conditionType_} a.wait_time not in
                <foreach collection="conditionParamRef.waitTimeNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('waitTimeStart') and conditionParamRef.waitTimeStart != null">
                ${_conditionType_} a.wait_time <![CDATA[ >= ]]> #{${_conditionParam_}.waitTimeStart}
            </if>
            <if test="conditionParamRef.containsKey('waitTimeEnd') and conditionParamRef.waitTimeEnd != null">
                ${_conditionType_} a.wait_time <![CDATA[ <= ]]> #{${_conditionParam_}.waitTimeEnd}
            </if>

            <if test="conditionParamRef.containsKey('handleTime')">
                <if test="conditionParamRef.handleTime != null ">
                    ${_conditionType_} a.handle_time = #{${_conditionParam_}.handleTime}
                </if>
                <if test="conditionParamRef.handleTime == null">
                    ${_conditionType_} a.handle_time is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('handleTimeList') and conditionParamRef.handleTimeList.size() > 0">
                ${_conditionType_} a.handle_time in
                <foreach collection="conditionParamRef.handleTimeList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('handleTimeNotList') and conditionParamRef.handleTimeNotList.size() > 0">
                ${_conditionType_} a.handle_time not in
                <foreach collection="conditionParamRef.handleTimeNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('handleTimeStart') and conditionParamRef.handleTimeStart != null">
                ${_conditionType_} a.handle_time <![CDATA[ >= ]]> #{${_conditionParam_}.handleTimeStart}
            </if>
            <if test="conditionParamRef.containsKey('handleTimeEnd') and conditionParamRef.handleTimeEnd != null">
                ${_conditionType_} a.handle_time <![CDATA[ <= ]]> #{${_conditionParam_}.handleTimeEnd}
            </if>


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

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

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

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

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

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

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

            <if test="conditionParamRef.containsKey('deviceType')">
                <if test="conditionParamRef.deviceType != null and conditionParamRef.deviceType != ''">
                    ${_conditionType_} a.device_type like #{${_conditionParam_}.deviceType}
                </if>
                <if test="conditionParamRef.deviceType == null">
                    ${_conditionType_} a.device_type is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('deviceTypeList') and conditionParamRef.deviceTypeList.size() > 0">
                ${_conditionType_} a.device_type in
                <foreach collection="conditionParamRef.deviceTypeList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('deviceTypeNotList') and conditionParamRef.deviceTypeNotList.size() > 0">
                ${_conditionType_} a.device_type not in
                <foreach collection="conditionParamRef.deviceTypeNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('siteId')">
                <if test="conditionParamRef.siteId != null ">
                    ${_conditionType_} a.site_id = #{${_conditionParam_}.siteId}
                </if>
                <if test="conditionParamRef.siteId == null">
                    ${_conditionType_} a.site_id is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('siteIdList') and conditionParamRef.siteIdList.size() > 0">
                ${_conditionType_} a.site_id in
                <foreach collection="conditionParamRef.siteIdList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('siteIdNotList') and conditionParamRef.siteIdNotList.size() > 0">
                ${_conditionType_} a.site_id not in
                <foreach collection="conditionParamRef.siteIdNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('siteIdStart') and conditionParamRef.siteIdStart != null">
                ${_conditionType_} a.site_id <![CDATA[ >= ]]> #{${_conditionParam_}.siteIdStart}
            </if>
            <if test="conditionParamRef.containsKey('siteIdEnd') and conditionParamRef.siteIdEnd != null">
                ${_conditionType_} a.site_id <![CDATA[ <= ]]> #{${_conditionParam_}.siteIdEnd}
            </if>


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

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

            <if test="conditionParamRef.containsKey('extNum')">
                <if test="conditionParamRef.extNum != null and conditionParamRef.extNum != ''">
                    ${_conditionType_} a.ext_num like #{${_conditionParam_}.extNum}
                </if>
                <if test="conditionParamRef.extNum == null">
                    ${_conditionType_} a.ext_num is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('extNumList') and conditionParamRef.extNumList.size() > 0">
                ${_conditionType_} a.ext_num in
                <foreach collection="conditionParamRef.extNumList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('extNumNotList') and conditionParamRef.extNumNotList.size() > 0">
                ${_conditionType_} a.ext_num not in
                <foreach collection="conditionParamRef.extNumNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('createUserId')">
                <if test="conditionParamRef.createUserId != null ">
                    ${_conditionType_} a.create_user_id = #{${_conditionParam_}.createUserId}
                </if>
                <if test="conditionParamRef.createUserId == null">
                    ${_conditionType_} a.create_user_id is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
                ${_conditionType_} a.create_user_id 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.create_user_id 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.create_user_id <![CDATA[ >= ]]> #{${_conditionParam_}.createUserIdStart}
            </if>
            <if test="conditionParamRef.containsKey('createUserIdEnd') and conditionParamRef.createUserIdEnd != null">
                ${_conditionType_} a.create_user_id <![CDATA[ <= ]]> #{${_conditionParam_}.createUserIdEnd}
            </if>


            <if test="conditionParamRef.containsKey('createTime')">
                <if test="conditionParamRef.createTime != null ">
                    ${_conditionType_} a.create_time = #{${_conditionParam_}.createTime}
                </if>
                <if test="conditionParamRef.createTime == null">
                    ${_conditionType_} a.create_time is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('createTimeStart') and conditionParamRef.createTimeStart != null and conditionParamRef.createTimeStart!=''">
                ${_conditionType_} a.create_time <![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.create_time <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
            </if>

            <if test="conditionParamRef.containsKey('updateTime')">
                <if test="conditionParamRef.updateTime != null ">
                    ${_conditionType_} a.update_time = #{${_conditionParam_}.updateTime}
                </if>
                <if test="conditionParamRef.updateTime == null">
                    ${_conditionType_} a.update_time is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('updateTimeStart') and conditionParamRef.updateTimeStart != null and conditionParamRef.updateTimeStart!=''">
                ${_conditionType_} a.update_time <![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.update_time <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
            </if>
    </sql>
    <sql id="_orderCols_">
        <if test="orderColList != null and !orderColList.isEmpty()">
            order by
                    <if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
                        field(a.id,
                        <foreach collection="conditionParamRef.idList" open="" close=")" index="index" item="item" separator=",">
                            #{item}
                        </foreach>
                        ,
                    </if>
                    <if test="conditionParamRef.containsKey('waitTimeList') and conditionParamRef.waitTimeList.size() > 0">
                        field(a.waitTime,
                        <foreach collection="conditionParamRef.waitTimeList" open="" close=")" index="index" item="item" separator=",">
                            #{item}
                        </foreach>
                        ,
                    </if>
                    <if test="conditionParamRef.containsKey('handleTimeList') and conditionParamRef.handleTimeList.size() > 0">
                        field(a.handleTime,
                        <foreach collection="conditionParamRef.handleTimeList" open="" close=")" index="index" item="item" separator=",">
                            #{item}
                        </foreach>
                        ,
                    </if>
                    <if test="conditionParamRef.containsKey('siteIdList') and conditionParamRef.siteIdList.size() > 0">
                        field(a.siteId,
                        <foreach collection="conditionParamRef.siteIdList" open="" close=")" index="index" item="item" separator=",">
                            #{item}
                        </foreach>
                        ,
                    </if>
                    <if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
                        field(a.createUserId,
                        <foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=",">
                            #{item}
                        </foreach>
                        ,
                    </if>
            <trim suffixOverrides=","  suffix="">
                <foreach collection="orderColList" open="" close="" index="index" item="item" separator=",">
                     a.${item.colName} ${item.sortKind}
                </foreach>
            </trim>
        </if>
        <if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()">
            order by
                    <if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
                        field(a.id,
                        <foreach collection="conditionParamRef.idList" open="" close=")" index="index" item="item" separator=",">
                            #{item}
                        </foreach>
                        ,
                    </if>
                    <if test="conditionParamRef.containsKey('waitTimeList') and conditionParamRef.waitTimeList.size() > 0">
                        field(a.waitTime,
                        <foreach collection="conditionParamRef.waitTimeList" open="" close=")" index="index" item="item" separator=",">
                            #{item}
                        </foreach>
                        ,
                    </if>
                    <if test="conditionParamRef.containsKey('handleTimeList') and conditionParamRef.handleTimeList.size() > 0">
                        field(a.handleTime,
                        <foreach collection="conditionParamRef.handleTimeList" open="" close=")" index="index" item="item" separator=",">
                            #{item}
                        </foreach>
                        ,
                    </if>
                    <if test="conditionParamRef.containsKey('siteIdList') and conditionParamRef.siteIdList.size() > 0">
                        field(a.siteId,
                        <foreach collection="conditionParamRef.siteIdList" open="" close=")" index="index" item="item" separator=",">
                            #{item}
                        </foreach>
                        ,
                    </if>
                    <if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
                        field(a.createUserId,
                        <foreach collection="conditionParamRef.createUserIdList" open="" close=")" index="index" item="item" separator=",">
                            #{item}
                        </foreach>
                        ,
                    </if>
            <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('ordernumber')">
                        a.ordernumber
                        <if test='orderCol.ordernumber != null and "DESC".equalsIgnoreCase(orderCol.ordernumber)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('style')">
                        a.style
                        <if test='orderCol.style != null and "DESC".equalsIgnoreCase(orderCol.style)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('business')">
                        a.business
                        <if test='orderCol.business != null and "DESC".equalsIgnoreCase(orderCol.business)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('windowName')">
                        a.window_name
                        <if test='orderCol.windowName != null and "DESC".equalsIgnoreCase(orderCol.windowName)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('windowFromnum')">
                        a.window_fromnum
                        <if test='orderCol.windowFromnum != null and "DESC".equalsIgnoreCase(orderCol.windowFromnum)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('flownum')">
                        a.flownum
                        <if test='orderCol.flownum != null and "DESC".equalsIgnoreCase(orderCol.flownum)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('formernum')">
                        a.formernum
                        <if test='orderCol.formernum != null and "DESC".equalsIgnoreCase(orderCol.formernum)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('peopleIdcard')">
                        a.people_idcard
                        <if test='orderCol.peopleIdcard != null and "DESC".equalsIgnoreCase(orderCol.peopleIdcard)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('peopleName')">
                        a.people_name
                        <if test='orderCol.peopleName != null and "DESC".equalsIgnoreCase(orderCol.peopleName)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('peopleSex')">
                        a.people_sex
                        <if test='orderCol.peopleSex != null and "DESC".equalsIgnoreCase(orderCol.peopleSex)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('peoplePhone')">
                        a.people_phone
                        <if test='orderCol.peoplePhone != null and "DESC".equalsIgnoreCase(orderCol.peoplePhone)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('workmanName')">
                        a.workman_name
                        <if test='orderCol.workmanName != null and "DESC".equalsIgnoreCase(orderCol.workmanName)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('workmanNumber')">
                        a.workman_number
                        <if test='orderCol.workmanNumber != null and "DESC".equalsIgnoreCase(orderCol.workmanNumber)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('taketime')">
                        a.taketime
                        <if test='orderCol.taketime != null and "DESC".equalsIgnoreCase(orderCol.taketime)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('calltime')">
                        a.calltime
                        <if test='orderCol.calltime != null and "DESC".equalsIgnoreCase(orderCol.calltime)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('endtime')">
                        a.endtime
                        <if test='orderCol.endtime != null and "DESC".equalsIgnoreCase(orderCol.endtime)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('waitTime')">
                        a.wait_time
                        <if test='orderCol.waitTime != null and "DESC".equalsIgnoreCase(orderCol.waitTime)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('handleTime')">
                        a.handle_time
                        <if test='orderCol.handleTime != null and "DESC".equalsIgnoreCase(orderCol.handleTime)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('deviceName')">
                        a.device_name
                        <if test='orderCol.deviceName != null and "DESC".equalsIgnoreCase(orderCol.deviceName)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('callName')">
                        a.call_name
                        <if test='orderCol.callName != null and "DESC".equalsIgnoreCase(orderCol.callName)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('matterName')">
                        a.matter_name
                        <if test='orderCol.matterName != null and "DESC".equalsIgnoreCase(orderCol.matterName)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('queueid')">
                        a.queueid
                        <if test='orderCol.queueid != null and "DESC".equalsIgnoreCase(orderCol.queueid)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('wySignin')">
                        a.wy_signin
                        <if test='orderCol.wySignin != null and "DESC".equalsIgnoreCase(orderCol.wySignin)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('sectionName')">
                        a.section_name
                        <if test='orderCol.sectionName != null and "DESC".equalsIgnoreCase(orderCol.sectionName)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('hallName')">
                        a.hall_name
                        <if test='orderCol.hallName != null and "DESC".equalsIgnoreCase(orderCol.hallName)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('deviceType')">
                        a.device_type
                        <if test='orderCol.deviceType != null and "DESC".equalsIgnoreCase(orderCol.deviceType)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('siteId')">
                        a.site_id
                        <if test='orderCol.siteId != null and "DESC".equalsIgnoreCase(orderCol.siteId)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('siteCode')">
                        a.site_code
                        <if test='orderCol.siteCode != null and "DESC".equalsIgnoreCase(orderCol.siteCode)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('siteName')">
                        a.site_name
                        <if test='orderCol.siteName != null and "DESC".equalsIgnoreCase(orderCol.siteName)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('extNum')">
                        a.ext_num
                        <if test='orderCol.extNum != null and "DESC".equalsIgnoreCase(orderCol.extNum)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('createUserId')">
                        a.create_user_id
                        <if test='orderCol.createUserId != null and "DESC".equalsIgnoreCase(orderCol.createUserId)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('createTime')">
                        a.create_time
                        <if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('updateTime')">
                        a.update_time
                        <if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>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>