<?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.site.dao.ibatis.SiteDaoImpl">

    <!-- 字段和属性映射 -->
    <resultMap type="SiteEntity" id="SiteEntity-Map">
            <id  property="id" column="id" />
            <result property="siteName" column="siteName" />
            <result property="siteCode" column="siteCode" />
            <result property="areaID" column="areaID" />
            <result property="areaCode" column="areaCode" />
            <result property="areaName" column="areaName" />
            <result property="proCode" column="proCode" />
            <result property="cityCode" column="cityCode" />
            <result property="districtCode" column="districtCode" />
            <result property="siteIp" column="siteIp" />
            <result property="sitePort" column="sitePort" />
            <result property="longitude" column="longitude" />
            <result property="latitude" column="latitude" />
            <result property="siteTel" column="siteTel" />
            <result property="detailAddress" column="detailAddress" />
            <result property="siteRemark" column="siteRemark" />
            <result property="amWorkStartTime" column="amWorkStartTime" />
            <result property="amWorkEndTime" column="amWorkEndTime" />
            <result property="pmWorkStartTime" column="pmWorkStartTime" />
            <result property="pmWorkEndTime" column="pmWorkEndTime" />
            <result property="workday1" column="workday1" />
            <result property="workday2" column="workday2" />
            <result property="workday3" column="workday3" />
            <result property="workday4" column="workday4" />
            <result property="workday5" column="workday5" />
            <result property="workday6" column="workday6" />
            <result property="workday7" column="workday7" />
            <result property="level" column="level" />
            <result property="building" column="building" />
            <result property="modelIds" column="modelIds" />
            <result property="createTime" column="createTime" />
            <result property="createUserId" column="createUserId" />
            <result property="updateTime" column="updateTime" />
            
    </resultMap>


    <!-- 表所有列 -->
    <sql id="_columns">
        <trim suffixOverrides="," suffix="">
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))">
                    a.id as id,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteName') or colPickMode == 1 and data.containsKey('siteName')))">
                    a.siteName as siteName,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteCode') or colPickMode == 1 and data.containsKey('siteCode')))">
                    a.siteCode as siteCode,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('areaID') or colPickMode == 1 and data.containsKey('areaID')))">
                    a.areaID as areaID,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('areaCode') or colPickMode == 1 and data.containsKey('areaCode')))">
                    a.areaCode as areaCode,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('areaName') or colPickMode == 1 and data.containsKey('areaName')))">
                    a.areaName as areaName,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('proCode') or colPickMode == 1 and data.containsKey('proCode')))">
                    a.proCode as proCode,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('cityCode') or colPickMode == 1 and data.containsKey('cityCode')))">
                    a.cityCode as cityCode,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('districtCode') or colPickMode == 1 and data.containsKey('districtCode')))">
                    a.districtCode as districtCode,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteIp') or colPickMode == 1 and data.containsKey('siteIp')))">
                    a.siteIp as siteIp,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('sitePort') or colPickMode == 1 and data.containsKey('sitePort')))">
                    a.sitePort as sitePort,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('longitude') or colPickMode == 1 and data.containsKey('longitude')))">
                    a.longitude as longitude,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('latitude') or colPickMode == 1 and data.containsKey('latitude')))">
                    a.latitude as latitude,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteTel') or colPickMode == 1 and data.containsKey('siteTel')))">
                    a.siteTel as siteTel,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('detailAddress') or colPickMode == 1 and data.containsKey('detailAddress')))">
                    a.detailAddress as detailAddress,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteRemark') or colPickMode == 1 and data.containsKey('siteRemark')))">
                    a.siteRemark as siteRemark,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('amWorkStartTime') or colPickMode == 1 and data.containsKey('amWorkStartTime')))">
                    a.amWorkStartTime as amWorkStartTime,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('amWorkEndTime') or colPickMode == 1 and data.containsKey('amWorkEndTime')))">
                    a.amWorkEndTime as amWorkEndTime,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('pmWorkStartTime') or colPickMode == 1 and data.containsKey('pmWorkStartTime')))">
                    a.pmWorkStartTime as pmWorkStartTime,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('pmWorkEndTime') or colPickMode == 1 and data.containsKey('pmWorkEndTime')))">
                    a.pmWorkEndTime as pmWorkEndTime,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('workday1') or colPickMode == 1 and data.containsKey('workday1')))">
                    a.workday1 as workday1,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('workday2') or colPickMode == 1 and data.containsKey('workday2')))">
                    a.workday2 as workday2,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('workday3') or colPickMode == 1 and data.containsKey('workday3')))">
                    a.workday3 as workday3,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('workday4') or colPickMode == 1 and data.containsKey('workday4')))">
                    a.workday4 as workday4,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('workday5') or colPickMode == 1 and data.containsKey('workday5')))">
                    a.workday5 as workday5,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('workday6') or colPickMode == 1 and data.containsKey('workday6')))">
                    a.workday6 as workday6,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('workday7') or colPickMode == 1 and data.containsKey('workday7')))">
                    a.workday7 as workday7,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('level') or colPickMode == 1 and data.containsKey('level')))">
                    a.level as level,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('building') or colPickMode == 1 and data.containsKey('building')))">
                    a.building as building,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('modelIds') or colPickMode == 1 and data.containsKey('modelIds')))">
                    a.modelIds as modelIds,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
                    a.createTime as createTime,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createUserId') or colPickMode == 1 and data.containsKey('createUserId')))">
                    a.createUserId as createUserId,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
                    a.updateTime as updateTime,
                </if>
        </trim>
    </sql>
    <!-- 新增 区分主键自增加还是业务插入 -->
    <insert id="insert" parameterType="SiteEntity"  useGeneratedKeys="true" keyProperty="id">
        insert into mortals_sys_site
        (siteName,siteCode,areaID,areaCode,areaName,proCode,cityCode,districtCode,siteIp,sitePort,longitude,latitude,siteTel,detailAddress,siteRemark,amWorkStartTime,amWorkEndTime,pmWorkStartTime,pmWorkEndTime,workday1,workday2,workday3,workday4,workday5,workday6,workday7,level,building,modelIds,createTime,createUserId,updateTime)
        VALUES
        (#{siteName},#{siteCode},#{areaID},#{areaCode},#{areaName},#{proCode},#{cityCode},#{districtCode},#{siteIp},#{sitePort},#{longitude},#{latitude},#{siteTel},#{detailAddress},#{siteRemark},#{amWorkStartTime},#{amWorkEndTime},#{pmWorkStartTime},#{pmWorkEndTime},#{workday1},#{workday2},#{workday3},#{workday4},#{workday5},#{workday6},#{workday7},#{level},#{building},#{modelIds},#{createTime},#{createUserId},#{updateTime})
    </insert>

    <!-- 批量新增 -->
    <insert id="insertBatch" parameterType="paramDto">
        insert into mortals_sys_site
        (siteName,siteCode,areaID,areaCode,areaName,proCode,cityCode,districtCode,siteIp,sitePort,longitude,latitude,siteTel,detailAddress,siteRemark,amWorkStartTime,amWorkEndTime,pmWorkStartTime,pmWorkEndTime,workday1,workday2,workday3,workday4,workday5,workday6,workday7,level,building,modelIds,createTime,createUserId,updateTime)
        VALUES
        <foreach collection="data.dataList" item="item" index="index" separator="," >
            (#{item.siteName},#{item.siteCode},#{item.areaID},#{item.areaCode},#{item.areaName},#{item.proCode},#{item.cityCode},#{item.districtCode},#{item.siteIp},#{item.sitePort},#{item.longitude},#{item.latitude},#{item.siteTel},#{item.detailAddress},#{item.siteRemark},#{item.amWorkStartTime},#{item.amWorkEndTime},#{item.pmWorkStartTime},#{item.pmWorkEndTime},#{item.workday1},#{item.workday2},#{item.workday3},#{item.workday4},#{item.workday5},#{item.workday6},#{item.workday7},#{item.level},#{item.building},#{item.modelIds},#{item.createTime},#{item.createUserId},#{item.updateTime})
        </foreach>
    </insert>


    <!-- 根据ParamDto更新 -->
    <update id="update" parameterType="paramDto">
        update mortals_sys_site as a
        set
        <trim suffixOverrides="," suffix="">
            <if test="(colPickMode==0 and data.containsKey('siteName')) or (colPickMode==1 and !data.containsKey('siteName'))">
                a.siteName=#{data.siteName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('siteCode')) or (colPickMode==1 and !data.containsKey('siteCode'))">
                a.siteCode=#{data.siteCode},
            </if>
            <if test="(colPickMode==0 and data.containsKey('areaID')) or (colPickMode==1 and !data.containsKey('areaID'))">
                a.areaID=#{data.areaID},
            </if>
            <if test="(colPickMode==0 and data.containsKey('areaIDIncrement')) or (colPickMode==1 and !data.containsKey('areaIDIncrement'))">
                a.areaID=ifnull(a.areaID,0) + #{data.areaIDIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('areaCode')) or (colPickMode==1 and !data.containsKey('areaCode'))">
                a.areaCode=#{data.areaCode},
            </if>
            <if test="(colPickMode==0 and data.containsKey('areaName')) or (colPickMode==1 and !data.containsKey('areaName'))">
                a.areaName=#{data.areaName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('proCode')) or (colPickMode==1 and !data.containsKey('proCode'))">
                a.proCode=#{data.proCode},
            </if>
            <if test="(colPickMode==0 and data.containsKey('cityCode')) or (colPickMode==1 and !data.containsKey('cityCode'))">
                a.cityCode=#{data.cityCode},
            </if>
            <if test="(colPickMode==0 and data.containsKey('districtCode')) or (colPickMode==1 and !data.containsKey('districtCode'))">
                a.districtCode=#{data.districtCode},
            </if>
            <if test="(colPickMode==0 and data.containsKey('siteIp')) or (colPickMode==1 and !data.containsKey('siteIp'))">
                a.siteIp=#{data.siteIp},
            </if>
            <if test="(colPickMode==0 and data.containsKey('sitePort')) or (colPickMode==1 and !data.containsKey('sitePort'))">
                a.sitePort=#{data.sitePort},
            </if>
            <if test="(colPickMode==0 and data.containsKey('longitude')) or (colPickMode==1 and !data.containsKey('longitude'))">
                a.longitude=#{data.longitude},
            </if>
            <if test="(colPickMode==0 and data.containsKey('latitude')) or (colPickMode==1 and !data.containsKey('latitude'))">
                a.latitude=#{data.latitude},
            </if>
            <if test="(colPickMode==0 and data.containsKey('siteTel')) or (colPickMode==1 and !data.containsKey('siteTel'))">
                a.siteTel=#{data.siteTel},
            </if>
            <if test="(colPickMode==0 and data.containsKey('detailAddress')) or (colPickMode==1 and !data.containsKey('detailAddress'))">
                a.detailAddress=#{data.detailAddress},
            </if>
            <if test="(colPickMode==0 and data.containsKey('siteRemark')) or (colPickMode==1 and !data.containsKey('siteRemark'))">
                a.siteRemark=#{data.siteRemark},
            </if>
            <if test="(colPickMode==0 and data.containsKey('amWorkStartTime')) or (colPickMode==1 and !data.containsKey('amWorkStartTime'))">
                a.amWorkStartTime=#{data.amWorkStartTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('amWorkEndTime')) or (colPickMode==1 and !data.containsKey('amWorkEndTime'))">
                a.amWorkEndTime=#{data.amWorkEndTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('pmWorkStartTime')) or (colPickMode==1 and !data.containsKey('pmWorkStartTime'))">
                a.pmWorkStartTime=#{data.pmWorkStartTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('pmWorkEndTime')) or (colPickMode==1 and !data.containsKey('pmWorkEndTime'))">
                a.pmWorkEndTime=#{data.pmWorkEndTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('workday1')) or (colPickMode==1 and !data.containsKey('workday1'))">
                a.workday1=#{data.workday1},
            </if>
            <if test="(colPickMode==0 and data.containsKey('workday1Increment')) or (colPickMode==1 and !data.containsKey('workday1Increment'))">
                a.workday1=ifnull(a.workday1,0) + #{data.workday1Increment},
            </if>
            <if test="(colPickMode==0 and data.containsKey('workday2')) or (colPickMode==1 and !data.containsKey('workday2'))">
                a.workday2=#{data.workday2},
            </if>
            <if test="(colPickMode==0 and data.containsKey('workday2Increment')) or (colPickMode==1 and !data.containsKey('workday2Increment'))">
                a.workday2=ifnull(a.workday2,0) + #{data.workday2Increment},
            </if>
            <if test="(colPickMode==0 and data.containsKey('workday3')) or (colPickMode==1 and !data.containsKey('workday3'))">
                a.workday3=#{data.workday3},
            </if>
            <if test="(colPickMode==0 and data.containsKey('workday3Increment')) or (colPickMode==1 and !data.containsKey('workday3Increment'))">
                a.workday3=ifnull(a.workday3,0) + #{data.workday3Increment},
            </if>
            <if test="(colPickMode==0 and data.containsKey('workday4')) or (colPickMode==1 and !data.containsKey('workday4'))">
                a.workday4=#{data.workday4},
            </if>
            <if test="(colPickMode==0 and data.containsKey('workday4Increment')) or (colPickMode==1 and !data.containsKey('workday4Increment'))">
                a.workday4=ifnull(a.workday4,0) + #{data.workday4Increment},
            </if>
            <if test="(colPickMode==0 and data.containsKey('workday5')) or (colPickMode==1 and !data.containsKey('workday5'))">
                a.workday5=#{data.workday5},
            </if>
            <if test="(colPickMode==0 and data.containsKey('workday5Increment')) or (colPickMode==1 and !data.containsKey('workday5Increment'))">
                a.workday5=ifnull(a.workday5,0) + #{data.workday5Increment},
            </if>
            <if test="(colPickMode==0 and data.containsKey('workday6')) or (colPickMode==1 and !data.containsKey('workday6'))">
                a.workday6=#{data.workday6},
            </if>
            <if test="(colPickMode==0 and data.containsKey('workday6Increment')) or (colPickMode==1 and !data.containsKey('workday6Increment'))">
                a.workday6=ifnull(a.workday6,0) + #{data.workday6Increment},
            </if>
            <if test="(colPickMode==0 and data.containsKey('workday7')) or (colPickMode==1 and !data.containsKey('workday7'))">
                a.workday7=#{data.workday7},
            </if>
            <if test="(colPickMode==0 and data.containsKey('workday7Increment')) or (colPickMode==1 and !data.containsKey('workday7Increment'))">
                a.workday7=ifnull(a.workday7,0) + #{data.workday7Increment},
            </if>
            <if test="(colPickMode==0 and data.containsKey('level')) or (colPickMode==1 and !data.containsKey('level'))">
                a.level=#{data.level},
            </if>
            <if test="(colPickMode==0 and data.containsKey('levelIncrement')) or (colPickMode==1 and !data.containsKey('levelIncrement'))">
                a.level=ifnull(a.level,0) + #{data.levelIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('building')) or (colPickMode==1 and !data.containsKey('building'))">
                a.building=#{data.building},
            </if>
            <if test="(colPickMode==0 and data.containsKey('buildingIncrement')) or (colPickMode==1 and !data.containsKey('buildingIncrement'))">
                a.building=ifnull(a.building,0) + #{data.buildingIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('modelIds')) or (colPickMode==1 and !data.containsKey('modelIds'))">
                a.modelIds=#{data.modelIds},
            </if>
            <if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))">
                a.createTime=#{data.createTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('createUserId')) or (colPickMode==1 and !data.containsKey('createUserId'))">
                a.createUserId=#{data.createUserId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('createUserIdIncrement')) or (colPickMode==1 and !data.containsKey('createUserIdIncrement'))">
                a.createUserId=ifnull(a.createUserId,0) + #{data.createUserIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
                a.updateTime=#{data.updateTime},
            </if>
        </trim>
        <trim suffixOverrides="where" suffix="">
            where
            <trim prefixOverrides="and" prefix="">
                <include refid="_condition_"/>
            </trim>
        </trim>
    </update>
    <!-- 批量更新 -->
    <update id="updateBatch" parameterType="paramDto">
        update mortals_sys_site as a
        <trim prefix="set" suffixOverrides=",">
                <trim prefix="siteName=(case" suffix="ELSE siteName 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="siteCode=(case" suffix="ELSE siteCode 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="areaID=(case" suffix="ELSE areaID end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('areaID')) or (colPickMode==1 and !item.containsKey('areaID'))">
                                        when a.id=#{item.id} then #{item.areaID}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('areaIDIncrement')) or (colPickMode==1 and !item.containsKey('areaIDIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.areaID,0) + #{item.areaIDIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                <trim prefix="areaCode=(case" suffix="ELSE areaCode end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('areaCode')) or (colPickMode==1 and !item.containsKey('areaCode'))">
                            when a.id=#{item.id} then #{item.areaCode}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="areaName=(case" suffix="ELSE areaName end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('areaName')) or (colPickMode==1 and !item.containsKey('areaName'))">
                            when a.id=#{item.id} then #{item.areaName}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="proCode=(case" suffix="ELSE proCode end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('proCode')) or (colPickMode==1 and !item.containsKey('proCode'))">
                            when a.id=#{item.id} then #{item.proCode}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="cityCode=(case" suffix="ELSE cityCode end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('cityCode')) or (colPickMode==1 and !item.containsKey('cityCode'))">
                            when a.id=#{item.id} then #{item.cityCode}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="districtCode=(case" suffix="ELSE districtCode end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('districtCode')) or (colPickMode==1 and !item.containsKey('districtCode'))">
                            when a.id=#{item.id} then #{item.districtCode}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="siteIp=(case" suffix="ELSE siteIp end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('siteIp')) or (colPickMode==1 and !item.containsKey('siteIp'))">
                            when a.id=#{item.id} then #{item.siteIp}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="sitePort=(case" suffix="ELSE sitePort end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('sitePort')) or (colPickMode==1 and !item.containsKey('sitePort'))">
                            when a.id=#{item.id} then #{item.sitePort}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="longitude=(case" suffix="ELSE longitude end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('longitude')) or (colPickMode==1 and !item.containsKey('longitude'))">
                            when a.id=#{item.id} then #{item.longitude}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="latitude=(case" suffix="ELSE latitude end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('latitude')) or (colPickMode==1 and !item.containsKey('latitude'))">
                            when a.id=#{item.id} then #{item.latitude}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="siteTel=(case" suffix="ELSE siteTel end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('siteTel')) or (colPickMode==1 and !item.containsKey('siteTel'))">
                            when a.id=#{item.id} then #{item.siteTel}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="detailAddress=(case" suffix="ELSE detailAddress end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('detailAddress')) or (colPickMode==1 and !item.containsKey('detailAddress'))">
                            when a.id=#{item.id} then #{item.detailAddress}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="siteRemark=(case" suffix="ELSE siteRemark end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('siteRemark')) or (colPickMode==1 and !item.containsKey('siteRemark'))">
                            when a.id=#{item.id} then #{item.siteRemark}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="amWorkStartTime=(case" suffix="ELSE amWorkStartTime end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('amWorkStartTime')) or (colPickMode==1 and !item.containsKey('amWorkStartTime'))">
                            when a.id=#{item.id} then #{item.amWorkStartTime}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="amWorkEndTime=(case" suffix="ELSE amWorkEndTime end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('amWorkEndTime')) or (colPickMode==1 and !item.containsKey('amWorkEndTime'))">
                            when a.id=#{item.id} then #{item.amWorkEndTime}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="pmWorkStartTime=(case" suffix="ELSE pmWorkStartTime end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('pmWorkStartTime')) or (colPickMode==1 and !item.containsKey('pmWorkStartTime'))">
                            when a.id=#{item.id} then #{item.pmWorkStartTime}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="pmWorkEndTime=(case" suffix="ELSE pmWorkEndTime end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('pmWorkEndTime')) or (colPickMode==1 and !item.containsKey('pmWorkEndTime'))">
                            when a.id=#{item.id} then #{item.pmWorkEndTime}
                        </if>
                    </foreach>
                </trim>
                        <trim prefix="workday1=(case" suffix="ELSE workday1 end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('workday1')) or (colPickMode==1 and !item.containsKey('workday1'))">
                                        when a.id=#{item.id} then #{item.workday1}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('workday1Increment')) or (colPickMode==1 and !item.containsKey('workday1Increment'))">
                                        when a.id=#{item.id} then ifnull(a.workday1,0) + #{item.workday1Increment}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="workday2=(case" suffix="ELSE workday2 end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('workday2')) or (colPickMode==1 and !item.containsKey('workday2'))">
                                        when a.id=#{item.id} then #{item.workday2}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('workday2Increment')) or (colPickMode==1 and !item.containsKey('workday2Increment'))">
                                        when a.id=#{item.id} then ifnull(a.workday2,0) + #{item.workday2Increment}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="workday3=(case" suffix="ELSE workday3 end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('workday3')) or (colPickMode==1 and !item.containsKey('workday3'))">
                                        when a.id=#{item.id} then #{item.workday3}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('workday3Increment')) or (colPickMode==1 and !item.containsKey('workday3Increment'))">
                                        when a.id=#{item.id} then ifnull(a.workday3,0) + #{item.workday3Increment}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="workday4=(case" suffix="ELSE workday4 end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('workday4')) or (colPickMode==1 and !item.containsKey('workday4'))">
                                        when a.id=#{item.id} then #{item.workday4}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('workday4Increment')) or (colPickMode==1 and !item.containsKey('workday4Increment'))">
                                        when a.id=#{item.id} then ifnull(a.workday4,0) + #{item.workday4Increment}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="workday5=(case" suffix="ELSE workday5 end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('workday5')) or (colPickMode==1 and !item.containsKey('workday5'))">
                                        when a.id=#{item.id} then #{item.workday5}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('workday5Increment')) or (colPickMode==1 and !item.containsKey('workday5Increment'))">
                                        when a.id=#{item.id} then ifnull(a.workday5,0) + #{item.workday5Increment}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="workday6=(case" suffix="ELSE workday6 end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('workday6')) or (colPickMode==1 and !item.containsKey('workday6'))">
                                        when a.id=#{item.id} then #{item.workday6}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('workday6Increment')) or (colPickMode==1 and !item.containsKey('workday6Increment'))">
                                        when a.id=#{item.id} then ifnull(a.workday6,0) + #{item.workday6Increment}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="workday7=(case" suffix="ELSE workday7 end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('workday7')) or (colPickMode==1 and !item.containsKey('workday7'))">
                                        when a.id=#{item.id} then #{item.workday7}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('workday7Increment')) or (colPickMode==1 and !item.containsKey('workday7Increment'))">
                                        when a.id=#{item.id} then ifnull(a.workday7,0) + #{item.workday7Increment}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="level=(case" suffix="ELSE level end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('level')) or (colPickMode==1 and !item.containsKey('level'))">
                                        when a.id=#{item.id} then #{item.level}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('levelIncrement')) or (colPickMode==1 and !item.containsKey('levelIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.level,0) + #{item.levelIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="building=(case" suffix="ELSE building end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('building')) or (colPickMode==1 and !item.containsKey('building'))">
                                        when a.id=#{item.id} then #{item.building}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('buildingIncrement')) or (colPickMode==1 and !item.containsKey('buildingIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.building,0) + #{item.buildingIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                <trim prefix="modelIds=(case" suffix="ELSE modelIds end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('modelIds')) or (colPickMode==1 and !item.containsKey('modelIds'))">
                            when a.id=#{item.id} then #{item.modelIds}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="createTime=(case" suffix="ELSE createTime end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))">
                            when a.id=#{item.id} then #{item.createTime}
                        </if>
                    </foreach>
                </trim>
                        <trim prefix="createUserId=(case" suffix="ELSE createUserId end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('createUserId')) or (colPickMode==1 and !item.containsKey('createUserId'))">
                                        when a.id=#{item.id} then #{item.createUserId}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('createUserIdIncrement')) or (colPickMode==1 and !item.containsKey('createUserIdIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.createUserId,0) + #{item.createUserIdIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                <trim prefix="updateTime=(case" suffix="ELSE updateTime end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('updateTime')) or (colPickMode==1 and !item.containsKey('updateTime'))">
                            when a.id=#{item.id} then #{item.updateTime}
                        </if>
                    </foreach>
                </trim>
        </trim>
        where id in
        <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
            #{item.id}
        </foreach>
    </update>
    <!-- 根据主健查询 -->
    <select id="getByKey" parameterType="paramDto" resultMap="SiteEntity-Map">
        select <include refid="_columns"/>
        from mortals_sys_site as a
        where a.id=#{condition.id}
    </select>
    <!-- 根据主健删除 -->
    <delete id="deleteByKey" parameterType="paramDto">
        delete a.* from mortals_sys_site as a where a.id=#{condition.id}
    </delete>
    <!-- 根据主健删除一批，针对单一主健有效 -->
    <delete id="deleteByKeys">
        delete from mortals_sys_site where id in
        <foreach collection="array" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>
    <!-- 根据paramDto删除一批 -->
    <delete id="deleteByMap" parameterType="paramDto">
        delete a.* from mortals_sys_site as a
        <trim suffixOverrides="where" suffix="">
            where
            <trim prefixOverrides="and" prefix="">
                <include refid="_condition_"/>
            </trim>
        </trim>
    </delete>
    <!-- 获取列表 -->
    <select id="getList" parameterType="paramDto" resultMap="SiteEntity-Map">
        select <include refid="_columns"/>
        from mortals_sys_site 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_sys_site as a
        <trim suffixOverrides="where" suffix="">
            where
            <trim prefixOverrides="and" prefix="">
                <include refid="_condition_"/>
            </trim>
        </trim>
    </select>
    <!-- 条件映射 -->
    <sql id="_condition_">
        <if test="condition != null and !condition.isEmpty()">
            <!-- 条件映射-普通条件 -->
            <include refid="_condition_param_">
                <property name="_conditionParam_" value="condition"/>
                <property name="_conditionType_" value="and"/>
            </include>
            <!-- 条件映射-集合之间使用AND，集合中元素使用OR-(list[0].1 or list[0].2) and (list[1].3 or list[1].4) -->
            <if test="condition.containsKey('andConditionList') and !condition.andConditionList.isEmpty()">
                and
                <foreach collection="condition.andConditionList" open="(" close=")" index="index" item="andCondition" separator=" and ">
                    <trim prefixOverrides="or" prefix="(" suffix=")">
                        <include refid="_condition_param_">
                            <property name="_conditionParam_" value="andCondition"/>
                            <property name="_conditionType_" value="or"/>
                        </include>
                    </trim>
                </foreach>
            </if>
            <!-- 条件映射-集合之间使用OR，集合中元素使用AND-(list[0].1 and list[0].2) or (list[1].3 and list[1].4) -->
            <if test="condition.containsKey('orConditionList') and !condition.orConditionList.isEmpty()">
                and
                <foreach collection="condition.orConditionList" open="(" close=")" index="index" item="orCondition" separator=" or ">
                    <trim prefixOverrides="and" prefix="(" suffix=")">
                        <include refid="_condition_param_">
                            <property name="_conditionParam_" value="orCondition"/>
                            <property name="_conditionType_" value="and"/>
                        </include>
                    </trim>
                </foreach>
            </if>
        </if>
    </sql>
    <!-- 条件映射-代参数 -->
    <sql id="_condition_param_">
        <bind name="conditionParamRef" value="${_conditionParam_}"/>
        <if test="conditionParamRef.containsKey('id')">
            <if test="conditionParamRef.id != null">
                ${_conditionType_} a.id=#{${_conditionParam_}.id}
            </if>
        </if>
            <if test="conditionParamRef.containsKey('id')">
                <if test="conditionParamRef.id != null ">
                    ${_conditionType_} a.id = #{${_conditionParam_}.id}
                </if>
                <if test="conditionParamRef.id == null">
                    ${_conditionType_} a.id is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('idList')">
                ${_conditionType_} a.id in
                <foreach collection="conditionParamRef.idList" 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('siteName')">
                <if test="conditionParamRef.siteName != null and conditionParamRef.siteName != ''">
                    ${_conditionType_} a.siteName like #{${_conditionParam_}.siteName}
                </if>
                <if test="conditionParamRef.siteName == null">
                    ${_conditionType_} a.siteName is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('siteNameList')">
                ${_conditionType_} a.siteName in
                <foreach collection="conditionParamRef.siteNameList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>

            <if test="conditionParamRef.containsKey('siteCode')">
                <if test="conditionParamRef.siteCode != null and conditionParamRef.siteCode != ''">
                    ${_conditionType_} a.siteCode like #{${_conditionParam_}.siteCode}
                </if>
                <if test="conditionParamRef.siteCode == null">
                    ${_conditionType_} a.siteCode is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('siteCodeList')">
                ${_conditionType_} a.siteCode in
                <foreach collection="conditionParamRef.siteCodeList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('areaID')">
                <if test="conditionParamRef.areaID != null ">
                    ${_conditionType_} a.areaID = #{${_conditionParam_}.areaID}
                </if>
                <if test="conditionParamRef.areaID == null">
                    ${_conditionType_} a.areaID is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('areaIDList')">
                ${_conditionType_} a.areaID in
                <foreach collection="conditionParamRef.areaIDList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('areaIDStart') and conditionParamRef.areaIDStart != null">
                ${_conditionType_} a.areaID <![CDATA[ >= ]]> #{${_conditionParam_}.areaIDStart}
            </if>
            <if test="conditionParamRef.containsKey('areaIDEnd') and conditionParamRef.areaIDEnd != null">
                ${_conditionType_} a.areaID <![CDATA[ <= ]]> #{${_conditionParam_}.areaIDEnd}
            </if>


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            <if test="conditionParamRef.containsKey('pmWorkEndTime')">
                <if test="conditionParamRef.pmWorkEndTime != null ">
                    ${_conditionType_} a.pmWorkEndTime = #{${_conditionParam_}.pmWorkEndTime}
                </if>
                <if test="conditionParamRef.pmWorkEndTime == null">
                    ${_conditionType_} a.pmWorkEndTime is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('pmWorkEndTimeStart') and conditionParamRef.pmWorkEndTimeStart != null and conditionParamRef.pmWorkEndTimeStart!=''">
                ${_conditionType_} a.pmWorkEndTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.pmWorkEndTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
            </if>
            <if test="conditionParamRef.containsKey('pmWorkEndTimeEnd') and conditionParamRef.pmWorkEndTimeEnd != null and conditionParamRef.pmWorkEndTimeEnd!=''">
                ${_conditionType_} a.pmWorkEndTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.pmWorkEndTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
            </if>
            <if test="conditionParamRef.containsKey('workday1')">
                <if test="conditionParamRef.workday1 != null ">
                    ${_conditionType_} a.workday1 = #{${_conditionParam_}.workday1}
                </if>
                <if test="conditionParamRef.workday1 == null">
                    ${_conditionType_} a.workday1 is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('workday1List')">
                ${_conditionType_} a.workday1 in
                <foreach collection="conditionParamRef.workday1List" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('workday1Start') and conditionParamRef.workday1Start != null">
                ${_conditionType_} a.workday1 <![CDATA[ >= ]]> #{${_conditionParam_}.workday1Start}
            </if>
            <if test="conditionParamRef.containsKey('workday1End') and conditionParamRef.workday1End != null">
                ${_conditionType_} a.workday1 <![CDATA[ <= ]]> #{${_conditionParam_}.workday1End}
            </if>

            <if test="conditionParamRef.containsKey('workday2')">
                <if test="conditionParamRef.workday2 != null ">
                    ${_conditionType_} a.workday2 = #{${_conditionParam_}.workday2}
                </if>
                <if test="conditionParamRef.workday2 == null">
                    ${_conditionType_} a.workday2 is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('workday2List')">
                ${_conditionType_} a.workday2 in
                <foreach collection="conditionParamRef.workday2List" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('workday2Start') and conditionParamRef.workday2Start != null">
                ${_conditionType_} a.workday2 <![CDATA[ >= ]]> #{${_conditionParam_}.workday2Start}
            </if>
            <if test="conditionParamRef.containsKey('workday2End') and conditionParamRef.workday2End != null">
                ${_conditionType_} a.workday2 <![CDATA[ <= ]]> #{${_conditionParam_}.workday2End}
            </if>

            <if test="conditionParamRef.containsKey('workday3')">
                <if test="conditionParamRef.workday3 != null ">
                    ${_conditionType_} a.workday3 = #{${_conditionParam_}.workday3}
                </if>
                <if test="conditionParamRef.workday3 == null">
                    ${_conditionType_} a.workday3 is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('workday3List')">
                ${_conditionType_} a.workday3 in
                <foreach collection="conditionParamRef.workday3List" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('workday3Start') and conditionParamRef.workday3Start != null">
                ${_conditionType_} a.workday3 <![CDATA[ >= ]]> #{${_conditionParam_}.workday3Start}
            </if>
            <if test="conditionParamRef.containsKey('workday3End') and conditionParamRef.workday3End != null">
                ${_conditionType_} a.workday3 <![CDATA[ <= ]]> #{${_conditionParam_}.workday3End}
            </if>

            <if test="conditionParamRef.containsKey('workday4')">
                <if test="conditionParamRef.workday4 != null ">
                    ${_conditionType_} a.workday4 = #{${_conditionParam_}.workday4}
                </if>
                <if test="conditionParamRef.workday4 == null">
                    ${_conditionType_} a.workday4 is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('workday4List')">
                ${_conditionType_} a.workday4 in
                <foreach collection="conditionParamRef.workday4List" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('workday4Start') and conditionParamRef.workday4Start != null">
                ${_conditionType_} a.workday4 <![CDATA[ >= ]]> #{${_conditionParam_}.workday4Start}
            </if>
            <if test="conditionParamRef.containsKey('workday4End') and conditionParamRef.workday4End != null">
                ${_conditionType_} a.workday4 <![CDATA[ <= ]]> #{${_conditionParam_}.workday4End}
            </if>

            <if test="conditionParamRef.containsKey('workday5')">
                <if test="conditionParamRef.workday5 != null ">
                    ${_conditionType_} a.workday5 = #{${_conditionParam_}.workday5}
                </if>
                <if test="conditionParamRef.workday5 == null">
                    ${_conditionType_} a.workday5 is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('workday5List')">
                ${_conditionType_} a.workday5 in
                <foreach collection="conditionParamRef.workday5List" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('workday5Start') and conditionParamRef.workday5Start != null">
                ${_conditionType_} a.workday5 <![CDATA[ >= ]]> #{${_conditionParam_}.workday5Start}
            </if>
            <if test="conditionParamRef.containsKey('workday5End') and conditionParamRef.workday5End != null">
                ${_conditionType_} a.workday5 <![CDATA[ <= ]]> #{${_conditionParam_}.workday5End}
            </if>

            <if test="conditionParamRef.containsKey('workday6')">
                <if test="conditionParamRef.workday6 != null ">
                    ${_conditionType_} a.workday6 = #{${_conditionParam_}.workday6}
                </if>
                <if test="conditionParamRef.workday6 == null">
                    ${_conditionType_} a.workday6 is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('workday6List')">
                ${_conditionType_} a.workday6 in
                <foreach collection="conditionParamRef.workday6List" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('workday6Start') and conditionParamRef.workday6Start != null">
                ${_conditionType_} a.workday6 <![CDATA[ >= ]]> #{${_conditionParam_}.workday6Start}
            </if>
            <if test="conditionParamRef.containsKey('workday6End') and conditionParamRef.workday6End != null">
                ${_conditionType_} a.workday6 <![CDATA[ <= ]]> #{${_conditionParam_}.workday6End}
            </if>

            <if test="conditionParamRef.containsKey('workday7')">
                <if test="conditionParamRef.workday7 != null ">
                    ${_conditionType_} a.workday7 = #{${_conditionParam_}.workday7}
                </if>
                <if test="conditionParamRef.workday7 == null">
                    ${_conditionType_} a.workday7 is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('workday7List')">
                ${_conditionType_} a.workday7 in
                <foreach collection="conditionParamRef.workday7List" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('workday7Start') and conditionParamRef.workday7Start != null">
                ${_conditionType_} a.workday7 <![CDATA[ >= ]]> #{${_conditionParam_}.workday7Start}
            </if>
            <if test="conditionParamRef.containsKey('workday7End') and conditionParamRef.workday7End != null">
                ${_conditionType_} a.workday7 <![CDATA[ <= ]]> #{${_conditionParam_}.workday7End}
            </if>

            <if test="conditionParamRef.containsKey('level')">
                <if test="conditionParamRef.level != null ">
                    ${_conditionType_} a.level = #{${_conditionParam_}.level}
                </if>
                <if test="conditionParamRef.level == null">
                    ${_conditionType_} a.level is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('levelList')">
                ${_conditionType_} a.level in
                <foreach collection="conditionParamRef.levelList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('levelStart') and conditionParamRef.levelStart != null">
                ${_conditionType_} a.level <![CDATA[ >= ]]> #{${_conditionParam_}.levelStart}
            </if>
            <if test="conditionParamRef.containsKey('levelEnd') and conditionParamRef.levelEnd != null">
                ${_conditionType_} a.level <![CDATA[ <= ]]> #{${_conditionParam_}.levelEnd}
            </if>

            <if test="conditionParamRef.containsKey('building')">
                <if test="conditionParamRef.building != null ">
                    ${_conditionType_} a.building = #{${_conditionParam_}.building}
                </if>
                <if test="conditionParamRef.building == null">
                    ${_conditionType_} a.building is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('buildingList')">
                ${_conditionType_} a.building in
                <foreach collection="conditionParamRef.buildingList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('buildingStart') and conditionParamRef.buildingStart != null">
                ${_conditionType_} a.building <![CDATA[ >= ]]> #{${_conditionParam_}.buildingStart}
            </if>
            <if test="conditionParamRef.containsKey('buildingEnd') and conditionParamRef.buildingEnd != null">
                ${_conditionType_} a.building <![CDATA[ <= ]]> #{${_conditionParam_}.buildingEnd}
            </if>


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

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


            <if test="conditionParamRef.containsKey('updateTime')">
                <if test="conditionParamRef.updateTime != null ">
                    ${_conditionType_} a.updateTime = #{${_conditionParam_}.updateTime}
                </if>
                <if test="conditionParamRef.updateTime == null">
                    ${_conditionType_} a.updateTime is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('updateTimeStart') and conditionParamRef.updateTimeStart != null and conditionParamRef.updateTimeStart!=''">
                ${_conditionType_} a.updateTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
            </if>
            <if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
                ${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
            </if>
    </sql>
    <sql id="_orderCols_">
        <if test="orderColList != null and !orderColList.isEmpty()">
            order by
            <trim suffixOverrides=","  suffix="">
                <foreach collection="orderColList" open="" close="" index="index" item="item" separator=",">
                     ${item.colName} ${item.sortKind}
                </foreach>
            </trim>
        </if>
        <if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()">
            order by
            <trim suffixOverrides=","  suffix="">
                    <if test="orderCol.containsKey('id')">
                        a.id
                        <if test='orderCol.id != null and "DESC".equalsIgnoreCase(orderCol.id)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('siteName')">
                        a.siteName
                        <if test='orderCol.siteName != null and "DESC".equalsIgnoreCase(orderCol.siteName)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('siteCode')">
                        a.siteCode
                        <if test='orderCol.siteCode != null and "DESC".equalsIgnoreCase(orderCol.siteCode)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('areaID')">
                        a.areaID
                        <if test='orderCol.areaID != null and "DESC".equalsIgnoreCase(orderCol.areaID)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('areaCode')">
                        a.areaCode
                        <if test='orderCol.areaCode != null and "DESC".equalsIgnoreCase(orderCol.areaCode)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('areaName')">
                        a.areaName
                        <if test='orderCol.areaName != null and "DESC".equalsIgnoreCase(orderCol.areaName)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('proCode')">
                        a.proCode
                        <if test='orderCol.proCode != null and "DESC".equalsIgnoreCase(orderCol.proCode)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('cityCode')">
                        a.cityCode
                        <if test='orderCol.cityCode != null and "DESC".equalsIgnoreCase(orderCol.cityCode)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('districtCode')">
                        a.districtCode
                        <if test='orderCol.districtCode != null and "DESC".equalsIgnoreCase(orderCol.districtCode)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('siteIp')">
                        a.siteIp
                        <if test='orderCol.siteIp != null and "DESC".equalsIgnoreCase(orderCol.siteIp)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('sitePort')">
                        a.sitePort
                        <if test='orderCol.sitePort != null and "DESC".equalsIgnoreCase(orderCol.sitePort)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('longitude')">
                        a.longitude
                        <if test='orderCol.longitude != null and "DESC".equalsIgnoreCase(orderCol.longitude)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('latitude')">
                        a.latitude
                        <if test='orderCol.latitude != null and "DESC".equalsIgnoreCase(orderCol.latitude)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('siteTel')">
                        a.siteTel
                        <if test='orderCol.siteTel != null and "DESC".equalsIgnoreCase(orderCol.siteTel)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('detailAddress')">
                        a.detailAddress
                        <if test='orderCol.detailAddress != null and "DESC".equalsIgnoreCase(orderCol.detailAddress)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('siteRemark')">
                        a.siteRemark
                        <if test='orderCol.siteRemark != null and "DESC".equalsIgnoreCase(orderCol.siteRemark)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('amWorkStartTime')">
                        a.amWorkStartTime
                        <if test='orderCol.amWorkStartTime != null and "DESC".equalsIgnoreCase(orderCol.amWorkStartTime)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('amWorkEndTime')">
                        a.amWorkEndTime
                        <if test='orderCol.amWorkEndTime != null and "DESC".equalsIgnoreCase(orderCol.amWorkEndTime)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('pmWorkStartTime')">
                        a.pmWorkStartTime
                        <if test='orderCol.pmWorkStartTime != null and "DESC".equalsIgnoreCase(orderCol.pmWorkStartTime)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('pmWorkEndTime')">
                        a.pmWorkEndTime
                        <if test='orderCol.pmWorkEndTime != null and "DESC".equalsIgnoreCase(orderCol.pmWorkEndTime)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('workday1')">
                        a.workday1
                        <if test='orderCol.workday1 != null and "DESC".equalsIgnoreCase(orderCol.workday1)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('workday2')">
                        a.workday2
                        <if test='orderCol.workday2 != null and "DESC".equalsIgnoreCase(orderCol.workday2)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('workday3')">
                        a.workday3
                        <if test='orderCol.workday3 != null and "DESC".equalsIgnoreCase(orderCol.workday3)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('workday4')">
                        a.workday4
                        <if test='orderCol.workday4 != null and "DESC".equalsIgnoreCase(orderCol.workday4)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('workday5')">
                        a.workday5
                        <if test='orderCol.workday5 != null and "DESC".equalsIgnoreCase(orderCol.workday5)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('workday6')">
                        a.workday6
                        <if test='orderCol.workday6 != null and "DESC".equalsIgnoreCase(orderCol.workday6)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('workday7')">
                        a.workday7
                        <if test='orderCol.workday7 != null and "DESC".equalsIgnoreCase(orderCol.workday7)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('level')">
                        a.level
                        <if test='orderCol.level != null and "DESC".equalsIgnoreCase(orderCol.level)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('building')">
                        a.building
                        <if test='orderCol.building != null and "DESC".equalsIgnoreCase(orderCol.building)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('modelIds')">
                        a.modelIds
                        <if test='orderCol.modelIds != null and "DESC".equalsIgnoreCase(orderCol.modelIds)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('createTime')">
                        a.createTime
                        <if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('createUserId')">
                        a.createUserId
                        <if test='orderCol.createUserId != null and "DESC".equalsIgnoreCase(orderCol.createUserId)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('updateTime')">
                        a.updateTime
                        <if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
                        ,
                    </if>
            </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>