<?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.device.dao.ibatis.DeviceDaoImpl">

    <!-- 字段和属性映射 -->
    <resultMap type="DeviceEntity" id="DeviceEntity-Map">
        <id  property="id" column="id" />
        <result property="deviceName" column="deviceName" />
        <result property="deviceCode" column="deviceCode" />
        <result property="deviceMac" column="deviceMac" />
        <result property="siteId" column="siteId" />
        <result property="siteCode" column="siteCode" />
        <result property="siteName" column="siteName" />
        <result property="platformId" column="platformId" />
        <result property="platformName" column="platformName" />
        <result property="productId" column="productId" />
        <result property="productName" column="productName" />
        <result property="skinId" column="skinId" />
        <result property="skinName" column="skinName" />
        <result property="homeUrl" column="homeUrl" />
        <result property="deviceFirmId" column="deviceFirmId" />
        <result property="deviceFirmname" column="deviceFirmname" />
        <result property="deviceSrc" column="deviceSrc" />
        <result property="deviceDataSourceWay" column="deviceDataSourceWay" />
        <result property="lon" column="lon" />
        <result property="lati" column="lati" />
        <result property="deviceInBuilding" column="deviceInBuilding" />
        <result property="deviceInFloor" column="deviceInFloor" />
        <result property="defectsLiabilityPeriod" column="defectsLiabilityPeriod" />
        <result property="leadingOfficial" column="leadingOfficial" />
        <result property="leadingOfficialTelephone" column="leadingOfficialTelephone" />
        <result property="isReceiveMess" column="isReceiveMess" />
        <result property="devicePhotoPath" column="devicePhotoPath" />
        <result property="ip" column="ip" />
        <result property="centernum" column="centernum" />
        <result property="port" column="port" />
        <result property="deviceTopic" column="deviceTopic" />
        <result property="deviceStatus" column="deviceStatus" />
        <result property="enabled" column="enabled" />
        <result property="deviceAuthCode" column="deviceAuthCode" />
        <result property="deviceRemark" column="deviceRemark" />
        <result property="onlineTime" column="onlineTime" />
        <result property="offlineTime" column="offlineTime" />
        <result property="deleted" column="deleted" />
        <result property="source" column="source" />
        <result property="createUserId" column="createUserId" />
        <result property="createTime" column="createTime" />
        <result property="updateUserId" column="updateUserId" />
        <result property="updateTime" column="updateTime" />
        <result property="deviceSN" column="deviceSN" />
        <result property="deviceVersion" column="deviceVersion" />
        <result property="productCode" column="productCode" />
        <result property="hallId" column="hallId" />
        <result property="hallName" column="hallName" />
        <result property="showSms" column="showSms" />
        <result property="showPrint" column="showPrint" />
        <result property="showWechatQrCode" column="showWechatQrCode" />
        <result property="orgName" column="orgName" />
        <result property="resolution" column="resolution" />
        <result property="resolutionValue" column="resolutionValue" />

    </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('deviceName') or colPickMode == 1 and data.containsKey('deviceName')))">
                a.deviceName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceCode') or colPickMode == 1 and data.containsKey('deviceCode')))">
                a.deviceCode,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceMac') or colPickMode == 1 and data.containsKey('deviceMac')))">
                a.deviceMac,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteId') or colPickMode == 1 and data.containsKey('siteId')))">
                a.siteId,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteCode') or colPickMode == 1 and data.containsKey('siteCode')))">
                a.siteCode,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteName') or colPickMode == 1 and data.containsKey('siteName')))">
                a.siteName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('platformId') or colPickMode == 1 and data.containsKey('platformId')))">
                a.platformId,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('platformName') or colPickMode == 1 and data.containsKey('platformName')))">
                a.platformName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('productId') or colPickMode == 1 and data.containsKey('productId')))">
                a.productId,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('productName') or colPickMode == 1 and data.containsKey('productName')))">
                a.productName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('skinId') or colPickMode == 1 and data.containsKey('skinId')))">
                a.skinId,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('skinName') or colPickMode == 1 and data.containsKey('skinName')))">
                a.skinName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('homeUrl') or colPickMode == 1 and data.containsKey('homeUrl')))">
                a.homeUrl,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceFirmId') or colPickMode == 1 and data.containsKey('deviceFirmId')))">
                a.deviceFirmId,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceFirmname') or colPickMode == 1 and data.containsKey('deviceFirmname')))">
                a.deviceFirmname,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceSrc') or colPickMode == 1 and data.containsKey('deviceSrc')))">
                a.deviceSrc,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceDataSourceWay') or colPickMode == 1 and data.containsKey('deviceDataSourceWay')))">
                a.deviceDataSourceWay,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lon') or colPickMode == 1 and data.containsKey('lon')))">
                a.lon,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lati') or colPickMode == 1 and data.containsKey('lati')))">
                a.lati,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceInBuilding') or colPickMode == 1 and data.containsKey('deviceInBuilding')))">
                a.deviceInBuilding,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceInFloor') or colPickMode == 1 and data.containsKey('deviceInFloor')))">
                a.deviceInFloor,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('defectsLiabilityPeriod') or colPickMode == 1 and data.containsKey('defectsLiabilityPeriod')))">
                a.defectsLiabilityPeriod,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('leadingOfficial') or colPickMode == 1 and data.containsKey('leadingOfficial')))">
                a.leadingOfficial,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('leadingOfficialTelephone') or colPickMode == 1 and data.containsKey('leadingOfficialTelephone')))">
                a.leadingOfficialTelephone,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('isReceiveMess') or colPickMode == 1 and data.containsKey('isReceiveMess')))">
                a.isReceiveMess,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('devicePhotoPath') or colPickMode == 1 and data.containsKey('devicePhotoPath')))">
                a.devicePhotoPath,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('ip') or colPickMode == 1 and data.containsKey('ip')))">
                a.ip,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('centernum') or colPickMode == 1 and data.containsKey('centernum')))">
                a.centernum,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('port') or colPickMode == 1 and data.containsKey('port')))">
                a.port,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceTopic') or colPickMode == 1 and data.containsKey('deviceTopic')))">
                a.deviceTopic,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceStatus') or colPickMode == 1 and data.containsKey('deviceStatus')))">
                a.deviceStatus,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('enabled') or colPickMode == 1 and data.containsKey('enabled')))">
                a.enabled,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceAuthCode') or colPickMode == 1 and data.containsKey('deviceAuthCode')))">
                a.deviceAuthCode,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceRemark') or colPickMode == 1 and data.containsKey('deviceRemark')))">
                a.deviceRemark,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('onlineTime') or colPickMode == 1 and data.containsKey('onlineTime')))">
                a.onlineTime,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('offlineTime') or colPickMode == 1 and data.containsKey('offlineTime')))">
                a.offlineTime,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deleted') or colPickMode == 1 and data.containsKey('deleted')))">
                a.deleted,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('source') or colPickMode == 1 and data.containsKey('source')))">
                a.source,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createUserId') or colPickMode == 1 and data.containsKey('createUserId')))">
                a.createUserId,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
                a.createTime,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateUserId') or colPickMode == 1 and data.containsKey('updateUserId')))">
                a.updateUserId,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
                a.updateTime,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceSN') or colPickMode == 1 and data.containsKey('deviceSN')))">
                a.deviceSN,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceVersion') or colPickMode == 1 and data.containsKey('deviceVersion')))">
                a.deviceVersion,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('productCode') or colPickMode == 1 and data.containsKey('productCode')))">
                a.productCode,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('hallId') or colPickMode == 1 and data.containsKey('hallId')))">
                a.hallId,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('hallName') or colPickMode == 1 and data.containsKey('hallName')))">
                a.hallName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('showSms') or colPickMode == 1 and data.containsKey('showSms')))">
                a.showSms,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('showPrint') or colPickMode == 1 and data.containsKey('showPrint')))">
                a.showPrint,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('showWechatQrCode') or colPickMode == 1 and data.containsKey('showWechatQrCode')))">
                a.showWechatQrCode,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('orgName') or colPickMode == 1 and data.containsKey('orgName')))">
                a.orgName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('resolution') or colPickMode == 1 and data.containsKey('resolution')))">
                a.resolution,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('resolutionValue') or colPickMode == 1 and data.containsKey('resolutionValue')))">
                a.resolutionValue,
            </if>
        </trim>
    </sql>
    <!-- 新增 区分主键自增加还是业务插入 -->
    <insert id="insert" parameterType="DeviceEntity"  useGeneratedKeys="true" keyProperty="id">
        insert into mortals_xhx_device
        (deviceName,deviceCode,deviceMac,siteId,siteCode,siteName,platformId,platformName,productId,productName,skinId,skinName,homeUrl,deviceFirmId,deviceFirmname,deviceSrc,deviceDataSourceWay,lon,lati,deviceInBuilding,deviceInFloor,defectsLiabilityPeriod,leadingOfficial,leadingOfficialTelephone,isReceiveMess,devicePhotoPath,ip,centernum,port,deviceTopic,deviceStatus,enabled,deviceAuthCode,deviceRemark,onlineTime,offlineTime,deleted,source,createUserId,createTime,updateUserId,updateTime,deviceSN,deviceVersion,productCode,hallId,hallName,showSms,showPrint,showWechatQrCode,orgName,resolution,resolutionValue)
        VALUES
        (#{deviceName},#{deviceCode},#{deviceMac},#{siteId},#{siteCode},#{siteName},#{platformId},#{platformName},#{productId},#{productName},#{skinId},#{skinName},#{homeUrl},#{deviceFirmId},#{deviceFirmname},#{deviceSrc},#{deviceDataSourceWay},#{lon},#{lati},#{deviceInBuilding},#{deviceInFloor},#{defectsLiabilityPeriod},#{leadingOfficial},#{leadingOfficialTelephone},#{isReceiveMess},#{devicePhotoPath},#{ip},#{centernum},#{port},#{deviceTopic},#{deviceStatus},#{enabled},#{deviceAuthCode},#{deviceRemark},#{onlineTime},#{offlineTime},#{deleted},#{source},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{deviceSN},#{deviceVersion},#{productCode},#{hallId},#{hallName},#{showSms},#{showPrint},#{showWechatQrCode},#{orgName},#{resolution},#{resolutionValue})
    </insert>

    <!-- 批量新增 -->
    <insert id="insertBatch" parameterType="paramDto">
        insert into mortals_xhx_device
        (deviceName,deviceCode,deviceMac,siteId,siteCode,siteName,platformId,platformName,productId,productName,skinId,skinName,homeUrl,deviceFirmId,deviceFirmname,deviceSrc,deviceDataSourceWay,lon,lati,deviceInBuilding,deviceInFloor,defectsLiabilityPeriod,leadingOfficial,leadingOfficialTelephone,isReceiveMess,devicePhotoPath,ip,centernum,port,deviceTopic,deviceStatus,enabled,deviceAuthCode,deviceRemark,onlineTime,offlineTime,deleted,source,createUserId,createTime,updateUserId,updateTime,deviceSN,deviceVersion,productCode,hallId,hallName,showSms,showPrint,showWechatQrCode,orgName,resolution,resolutionValue)
        VALUES
        <foreach collection="data.dataList" item="item" index="index" separator="," >
            (#{item.deviceName},#{item.deviceCode},#{item.deviceMac},#{item.siteId},#{item.siteCode},#{item.siteName},#{item.platformId},#{item.platformName},#{item.productId},#{item.productName},#{item.skinId},#{item.skinName},#{item.homeUrl},#{item.deviceFirmId},#{item.deviceFirmname},#{item.deviceSrc},#{item.deviceDataSourceWay},#{item.lon},#{item.lati},#{item.deviceInBuilding},#{item.deviceInFloor},#{item.defectsLiabilityPeriod},#{item.leadingOfficial},#{item.leadingOfficialTelephone},#{item.isReceiveMess},#{item.devicePhotoPath},#{item.ip},#{item.centernum},#{item.port},#{item.deviceTopic},#{item.deviceStatus},#{item.enabled},#{item.deviceAuthCode},#{item.deviceRemark},#{item.onlineTime},#{item.offlineTime},#{item.deleted},#{item.source},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.deviceSN},#{item.deviceVersion},#{item.productCode},#{item.hallId},#{item.hallName},#{item.showSms},#{item.showPrint},#{item.showWechatQrCode},#{item.orgName},#{item.resolution},#{item.resolutionValue})
        </foreach>
    </insert>


    <!-- 根据ParamDto更新 -->
    <update id="update" parameterType="paramDto">
        update mortals_xhx_device as a
        set
        <trim suffixOverrides="," suffix="">
            <if test="(colPickMode==0 and data.containsKey('deviceName')) or (colPickMode==1 and !data.containsKey('deviceName'))">
                a.deviceName=#{data.deviceName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceCode')) or (colPickMode==1 and !data.containsKey('deviceCode'))">
                a.deviceCode=#{data.deviceCode},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceMac')) or (colPickMode==1 and !data.containsKey('deviceMac'))">
                a.deviceMac=#{data.deviceMac},
            </if>
            <if test="(colPickMode==0 and data.containsKey('siteId')) or (colPickMode==1 and !data.containsKey('siteId'))">
                a.siteId=#{data.siteId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('siteIdIncrement')) or (colPickMode==1 and !data.containsKey('siteIdIncrement'))">
                a.siteId=ifnull(a.siteId,0) + #{data.siteIdIncrement},
            </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('siteName')) or (colPickMode==1 and !data.containsKey('siteName'))">
                a.siteName=#{data.siteName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('platformId')) or (colPickMode==1 and !data.containsKey('platformId'))">
                a.platformId=#{data.platformId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('platformIdIncrement')) or (colPickMode==1 and !data.containsKey('platformIdIncrement'))">
                a.platformId=ifnull(a.platformId,0) + #{data.platformIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('platformName')) or (colPickMode==1 and !data.containsKey('platformName'))">
                a.platformName=#{data.platformName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('productId')) or (colPickMode==1 and !data.containsKey('productId'))">
                a.productId=#{data.productId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('productIdIncrement')) or (colPickMode==1 and !data.containsKey('productIdIncrement'))">
                a.productId=ifnull(a.productId,0) + #{data.productIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('productName')) or (colPickMode==1 and !data.containsKey('productName'))">
                a.productName=#{data.productName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('skinId')) or (colPickMode==1 and !data.containsKey('skinId'))">
                a.skinId=#{data.skinId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('skinIdIncrement')) or (colPickMode==1 and !data.containsKey('skinIdIncrement'))">
                a.skinId=ifnull(a.skinId,0) + #{data.skinIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('skinName')) or (colPickMode==1 and !data.containsKey('skinName'))">
                a.skinName=#{data.skinName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('homeUrl')) or (colPickMode==1 and !data.containsKey('homeUrl'))">
                a.homeUrl=#{data.homeUrl},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceFirmId')) or (colPickMode==1 and !data.containsKey('deviceFirmId'))">
                a.deviceFirmId=#{data.deviceFirmId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceFirmIdIncrement')) or (colPickMode==1 and !data.containsKey('deviceFirmIdIncrement'))">
                a.deviceFirmId=ifnull(a.deviceFirmId,0) + #{data.deviceFirmIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceFirmname')) or (colPickMode==1 and !data.containsKey('deviceFirmname'))">
                a.deviceFirmname=#{data.deviceFirmname},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceSrc')) or (colPickMode==1 and !data.containsKey('deviceSrc'))">
                a.deviceSrc=#{data.deviceSrc},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceSrcIncrement')) or (colPickMode==1 and !data.containsKey('deviceSrcIncrement'))">
                a.deviceSrc=ifnull(a.deviceSrc,0) + #{data.deviceSrcIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceDataSourceWay')) or (colPickMode==1 and !data.containsKey('deviceDataSourceWay'))">
                a.deviceDataSourceWay=#{data.deviceDataSourceWay},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceDataSourceWayIncrement')) or (colPickMode==1 and !data.containsKey('deviceDataSourceWayIncrement'))">
                a.deviceDataSourceWay=ifnull(a.deviceDataSourceWay,0) + #{data.deviceDataSourceWayIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('lon')) or (colPickMode==1 and !data.containsKey('lon'))">
                a.lon=#{data.lon},
            </if>
            <if test="(colPickMode==0 and data.containsKey('lati')) or (colPickMode==1 and !data.containsKey('lati'))">
                a.lati=#{data.lati},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceInBuilding')) or (colPickMode==1 and !data.containsKey('deviceInBuilding'))">
                a.deviceInBuilding=#{data.deviceInBuilding},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceInBuildingIncrement')) or (colPickMode==1 and !data.containsKey('deviceInBuildingIncrement'))">
                a.deviceInBuilding=ifnull(a.deviceInBuilding,0) + #{data.deviceInBuildingIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceInFloor')) or (colPickMode==1 and !data.containsKey('deviceInFloor'))">
                a.deviceInFloor=#{data.deviceInFloor},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceInFloorIncrement')) or (colPickMode==1 and !data.containsKey('deviceInFloorIncrement'))">
                a.deviceInFloor=ifnull(a.deviceInFloor,0) + #{data.deviceInFloorIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('defectsLiabilityPeriod')) or (colPickMode==1 and !data.containsKey('defectsLiabilityPeriod'))">
                a.defectsLiabilityPeriod=#{data.defectsLiabilityPeriod},
            </if>
            <if test="(colPickMode==0 and data.containsKey('leadingOfficial')) or (colPickMode==1 and !data.containsKey('leadingOfficial'))">
                a.leadingOfficial=#{data.leadingOfficial},
            </if>
            <if test="(colPickMode==0 and data.containsKey('leadingOfficialTelephone')) or (colPickMode==1 and !data.containsKey('leadingOfficialTelephone'))">
                a.leadingOfficialTelephone=#{data.leadingOfficialTelephone},
            </if>
            <if test="(colPickMode==0 and data.containsKey('isReceiveMess')) or (colPickMode==1 and !data.containsKey('isReceiveMess'))">
                a.isReceiveMess=#{data.isReceiveMess},
            </if>
            <if test="(colPickMode==0 and data.containsKey('isReceiveMessIncrement')) or (colPickMode==1 and !data.containsKey('isReceiveMessIncrement'))">
                a.isReceiveMess=ifnull(a.isReceiveMess,0) + #{data.isReceiveMessIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('devicePhotoPath')) or (colPickMode==1 and !data.containsKey('devicePhotoPath'))">
                a.devicePhotoPath=#{data.devicePhotoPath},
            </if>
            <if test="(colPickMode==0 and data.containsKey('ip')) or (colPickMode==1 and !data.containsKey('ip'))">
                a.ip=#{data.ip},
            </if>
            <if test="(colPickMode==0 and data.containsKey('centernum')) or (colPickMode==1 and !data.containsKey('centernum'))">
                a.centernum=#{data.centernum},
            </if>
            <if test="(colPickMode==0 and data.containsKey('port')) or (colPickMode==1 and !data.containsKey('port'))">
                a.port=#{data.port},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceTopic')) or (colPickMode==1 and !data.containsKey('deviceTopic'))">
                a.deviceTopic=#{data.deviceTopic},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceStatus')) or (colPickMode==1 and !data.containsKey('deviceStatus'))">
                a.deviceStatus=#{data.deviceStatus},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceStatusIncrement')) or (colPickMode==1 and !data.containsKey('deviceStatusIncrement'))">
                a.deviceStatus=ifnull(a.deviceStatus,0) + #{data.deviceStatusIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('enabled')) or (colPickMode==1 and !data.containsKey('enabled'))">
                a.enabled=#{data.enabled},
            </if>
            <if test="(colPickMode==0 and data.containsKey('enabledIncrement')) or (colPickMode==1 and !data.containsKey('enabledIncrement'))">
                a.enabled=ifnull(a.enabled,0) + #{data.enabledIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceAuthCode')) or (colPickMode==1 and !data.containsKey('deviceAuthCode'))">
                a.deviceAuthCode=#{data.deviceAuthCode},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceRemark')) or (colPickMode==1 and !data.containsKey('deviceRemark'))">
                a.deviceRemark=#{data.deviceRemark},
            </if>
            <if test="(colPickMode==0 and data.containsKey('onlineTime')) or (colPickMode==1 and !data.containsKey('onlineTime'))">
                a.onlineTime=#{data.onlineTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('offlineTime')) or (colPickMode==1 and !data.containsKey('offlineTime'))">
                a.offlineTime=#{data.offlineTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deleted')) or (colPickMode==1 and !data.containsKey('deleted'))">
                a.deleted=#{data.deleted},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deletedIncrement')) or (colPickMode==1 and !data.containsKey('deletedIncrement'))">
                a.deleted=ifnull(a.deleted,0) + #{data.deletedIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('source')) or (colPickMode==1 and !data.containsKey('source'))">
                a.source=#{data.source},
            </if>
            <if test="(colPickMode==0 and data.containsKey('sourceIncrement')) or (colPickMode==1 and !data.containsKey('sourceIncrement'))">
                a.source=ifnull(a.source,0) + #{data.sourceIncrement},
            </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('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))">
                a.createTime=#{data.createTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('updateUserId')) or (colPickMode==1 and !data.containsKey('updateUserId'))">
                a.updateUserId=#{data.updateUserId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !data.containsKey('updateUserIdIncrement'))">
                a.updateUserId=ifnull(a.updateUserId,0) + #{data.updateUserIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
                a.updateTime=#{data.updateTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceSN')) or (colPickMode==1 and !data.containsKey('deviceSN'))">
                a.deviceSN=#{data.deviceSN},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deviceVersion')) or (colPickMode==1 and !data.containsKey('deviceVersion'))">
                a.deviceVersion=#{data.deviceVersion},
            </if>
            <if test="(colPickMode==0 and data.containsKey('productCode')) or (colPickMode==1 and !data.containsKey('productCode'))">
                a.productCode=#{data.productCode},
            </if>
            <if test="(colPickMode==0 and data.containsKey('hallId')) or (colPickMode==1 and !data.containsKey('hallId'))">
                a.hallId=#{data.hallId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('hallIdIncrement')) or (colPickMode==1 and !data.containsKey('hallIdIncrement'))">
                a.hallId=ifnull(a.hallId,0) + #{data.hallIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('hallName')) or (colPickMode==1 and !data.containsKey('hallName'))">
                a.hallName=#{data.hallName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('showSms')) or (colPickMode==1 and !data.containsKey('showSms'))">
                a.showSms=#{data.showSms},
            </if>
            <if test="(colPickMode==0 and data.containsKey('showSmsIncrement')) or (colPickMode==1 and !data.containsKey('showSmsIncrement'))">
                a.showSms=ifnull(a.showSms,0) + #{data.showSmsIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('showPrint')) or (colPickMode==1 and !data.containsKey('showPrint'))">
                a.showPrint=#{data.showPrint},
            </if>
            <if test="(colPickMode==0 and data.containsKey('showPrintIncrement')) or (colPickMode==1 and !data.containsKey('showPrintIncrement'))">
                a.showPrint=ifnull(a.showPrint,0) + #{data.showPrintIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('showWechatQrCode')) or (colPickMode==1 and !data.containsKey('showWechatQrCode'))">
                a.showWechatQrCode=#{data.showWechatQrCode},
            </if>
            <if test="(colPickMode==0 and data.containsKey('showWechatQrCodeIncrement')) or (colPickMode==1 and !data.containsKey('showWechatQrCodeIncrement'))">
                a.showWechatQrCode=ifnull(a.showWechatQrCode,0) + #{data.showWechatQrCodeIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('orgName')) or (colPickMode==1 and !data.containsKey('orgName'))">
                a.orgName=#{data.orgName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('resolution')) or (colPickMode==1 and !data.containsKey('resolution'))">
                a.resolution=#{data.resolution},
            </if>
            <if test="(colPickMode==0 and data.containsKey('resolutionValue')) or (colPickMode==1 and !data.containsKey('resolutionValue'))">
                a.resolutionValue=#{data.resolutionValue},
            </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_device as a
        <trim prefix="set" suffixOverrides=",">
            <trim prefix="deviceName=(case" suffix="ELSE deviceName 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="deviceCode=(case" suffix="ELSE deviceCode end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('deviceCode')) or (colPickMode==1 and !item.containsKey('deviceCode'))">
                        when a.id=#{item.id} then #{item.deviceCode}
                    </if>
                </foreach>
            </trim>
            <trim prefix="deviceMac=(case" suffix="ELSE deviceMac end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('deviceMac')) or (colPickMode==1 and !item.containsKey('deviceMac'))">
                        when a.id=#{item.id} then #{item.deviceMac}
                    </if>
                </foreach>
            </trim>
            <trim prefix="siteId=(case" suffix="ELSE siteId 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.siteId,0) + #{item.siteIdIncrement}
                        </when>
                    </choose>
                </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="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="platformId=(case" suffix="ELSE platformId end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('platformId')) or (colPickMode==1 and !item.containsKey('platformId'))">
                            when a.id=#{item.id} then #{item.platformId}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('platformIdIncrement')) or (colPickMode==1 and !item.containsKey('platformIdIncrement'))">
                            when a.id=#{item.id} then ifnull(a.platformId,0) + #{item.platformIdIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="platformName=(case" suffix="ELSE platformName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('platformName')) or (colPickMode==1 and !item.containsKey('platformName'))">
                        when a.id=#{item.id} then #{item.platformName}
                    </if>
                </foreach>
            </trim>
            <trim prefix="productId=(case" suffix="ELSE productId end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('productId')) or (colPickMode==1 and !item.containsKey('productId'))">
                            when a.id=#{item.id} then #{item.productId}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('productIdIncrement')) or (colPickMode==1 and !item.containsKey('productIdIncrement'))">
                            when a.id=#{item.id} then ifnull(a.productId,0) + #{item.productIdIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="productName=(case" suffix="ELSE productName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('productName')) or (colPickMode==1 and !item.containsKey('productName'))">
                        when a.id=#{item.id} then #{item.productName}
                    </if>
                </foreach>
            </trim>
            <trim prefix="skinId=(case" suffix="ELSE skinId end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('skinId')) or (colPickMode==1 and !item.containsKey('skinId'))">
                            when a.id=#{item.id} then #{item.skinId}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('skinIdIncrement')) or (colPickMode==1 and !item.containsKey('skinIdIncrement'))">
                            when a.id=#{item.id} then ifnull(a.skinId,0) + #{item.skinIdIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="skinName=(case" suffix="ELSE skinName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('skinName')) or (colPickMode==1 and !item.containsKey('skinName'))">
                        when a.id=#{item.id} then #{item.skinName}
                    </if>
                </foreach>
            </trim>
            <trim prefix="homeUrl=(case" suffix="ELSE homeUrl end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('homeUrl')) or (colPickMode==1 and !item.containsKey('homeUrl'))">
                        when a.id=#{item.id} then #{item.homeUrl}
                    </if>
                </foreach>
            </trim>
            <trim prefix="deviceFirmId=(case" suffix="ELSE deviceFirmId end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('deviceFirmId')) or (colPickMode==1 and !item.containsKey('deviceFirmId'))">
                            when a.id=#{item.id} then #{item.deviceFirmId}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('deviceFirmIdIncrement')) or (colPickMode==1 and !item.containsKey('deviceFirmIdIncrement'))">
                            when a.id=#{item.id} then ifnull(a.deviceFirmId,0) + #{item.deviceFirmIdIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="deviceFirmname=(case" suffix="ELSE deviceFirmname end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('deviceFirmname')) or (colPickMode==1 and !item.containsKey('deviceFirmname'))">
                        when a.id=#{item.id} then #{item.deviceFirmname}
                    </if>
                </foreach>
            </trim>
            <trim prefix="deviceSrc=(case" suffix="ELSE deviceSrc end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('deviceSrc')) or (colPickMode==1 and !item.containsKey('deviceSrc'))">
                            when a.id=#{item.id} then #{item.deviceSrc}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('deviceSrcIncrement')) or (colPickMode==1 and !item.containsKey('deviceSrcIncrement'))">
                            when a.id=#{item.id} then ifnull(a.deviceSrc,0) + #{item.deviceSrcIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="deviceDataSourceWay=(case" suffix="ELSE deviceDataSourceWay end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('deviceDataSourceWay')) or (colPickMode==1 and !item.containsKey('deviceDataSourceWay'))">
                            when a.id=#{item.id} then #{item.deviceDataSourceWay}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('deviceDataSourceWayIncrement')) or (colPickMode==1 and !item.containsKey('deviceDataSourceWayIncrement'))">
                            when a.id=#{item.id} then ifnull(a.deviceDataSourceWay,0) + #{item.deviceDataSourceWayIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="lon=(case" suffix="ELSE lon end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('lon')) or (colPickMode==1 and !item.containsKey('lon'))">
                        when a.id=#{item.id} then #{item.lon}
                    </if>
                </foreach>
            </trim>
            <trim prefix="lati=(case" suffix="ELSE lati end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('lati')) or (colPickMode==1 and !item.containsKey('lati'))">
                        when a.id=#{item.id} then #{item.lati}
                    </if>
                </foreach>
            </trim>
            <trim prefix="deviceInBuilding=(case" suffix="ELSE deviceInBuilding end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('deviceInBuilding')) or (colPickMode==1 and !item.containsKey('deviceInBuilding'))">
                            when a.id=#{item.id} then #{item.deviceInBuilding}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('deviceInBuildingIncrement')) or (colPickMode==1 and !item.containsKey('deviceInBuildingIncrement'))">
                            when a.id=#{item.id} then ifnull(a.deviceInBuilding,0) + #{item.deviceInBuildingIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="deviceInFloor=(case" suffix="ELSE deviceInFloor end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('deviceInFloor')) or (colPickMode==1 and !item.containsKey('deviceInFloor'))">
                            when a.id=#{item.id} then #{item.deviceInFloor}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('deviceInFloorIncrement')) or (colPickMode==1 and !item.containsKey('deviceInFloorIncrement'))">
                            when a.id=#{item.id} then ifnull(a.deviceInFloor,0) + #{item.deviceInFloorIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="defectsLiabilityPeriod=(case" suffix="ELSE defectsLiabilityPeriod end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('defectsLiabilityPeriod')) or (colPickMode==1 and !item.containsKey('defectsLiabilityPeriod'))">
                        when a.id=#{item.id} then #{item.defectsLiabilityPeriod}
                    </if>
                </foreach>
            </trim>
            <trim prefix="leadingOfficial=(case" suffix="ELSE leadingOfficial end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('leadingOfficial')) or (colPickMode==1 and !item.containsKey('leadingOfficial'))">
                        when a.id=#{item.id} then #{item.leadingOfficial}
                    </if>
                </foreach>
            </trim>
            <trim prefix="leadingOfficialTelephone=(case" suffix="ELSE leadingOfficialTelephone end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('leadingOfficialTelephone')) or (colPickMode==1 and !item.containsKey('leadingOfficialTelephone'))">
                        when a.id=#{item.id} then #{item.leadingOfficialTelephone}
                    </if>
                </foreach>
            </trim>
            <trim prefix="isReceiveMess=(case" suffix="ELSE isReceiveMess end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('isReceiveMess')) or (colPickMode==1 and !item.containsKey('isReceiveMess'))">
                            when a.id=#{item.id} then #{item.isReceiveMess}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('isReceiveMessIncrement')) or (colPickMode==1 and !item.containsKey('isReceiveMessIncrement'))">
                            when a.id=#{item.id} then ifnull(a.isReceiveMess,0) + #{item.isReceiveMessIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="devicePhotoPath=(case" suffix="ELSE devicePhotoPath end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('devicePhotoPath')) or (colPickMode==1 and !item.containsKey('devicePhotoPath'))">
                        when a.id=#{item.id} then #{item.devicePhotoPath}
                    </if>
                </foreach>
            </trim>
            <trim prefix="ip=(case" suffix="ELSE ip end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('ip')) or (colPickMode==1 and !item.containsKey('ip'))">
                        when a.id=#{item.id} then #{item.ip}
                    </if>
                </foreach>
            </trim>
            <trim prefix="centernum=(case" suffix="ELSE centernum end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('centernum')) or (colPickMode==1 and !item.containsKey('centernum'))">
                        when a.id=#{item.id} then #{item.centernum}
                    </if>
                </foreach>
            </trim>
            <trim prefix="port=(case" suffix="ELSE port end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('port')) or (colPickMode==1 and !item.containsKey('port'))">
                        when a.id=#{item.id} then #{item.port}
                    </if>
                </foreach>
            </trim>
            <trim prefix="deviceTopic=(case" suffix="ELSE deviceTopic end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('deviceTopic')) or (colPickMode==1 and !item.containsKey('deviceTopic'))">
                        when a.id=#{item.id} then #{item.deviceTopic}
                    </if>
                </foreach>
            </trim>
            <trim prefix="deviceStatus=(case" suffix="ELSE deviceStatus end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('deviceStatus')) or (colPickMode==1 and !item.containsKey('deviceStatus'))">
                            when a.id=#{item.id} then #{item.deviceStatus}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('deviceStatusIncrement')) or (colPickMode==1 and !item.containsKey('deviceStatusIncrement'))">
                            when a.id=#{item.id} then ifnull(a.deviceStatus,0) + #{item.deviceStatusIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="enabled=(case" suffix="ELSE enabled end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('enabled')) or (colPickMode==1 and !item.containsKey('enabled'))">
                            when a.id=#{item.id} then #{item.enabled}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('enabledIncrement')) or (colPickMode==1 and !item.containsKey('enabledIncrement'))">
                            when a.id=#{item.id} then ifnull(a.enabled,0) + #{item.enabledIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="deviceAuthCode=(case" suffix="ELSE deviceAuthCode end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('deviceAuthCode')) or (colPickMode==1 and !item.containsKey('deviceAuthCode'))">
                        when a.id=#{item.id} then #{item.deviceAuthCode}
                    </if>
                </foreach>
            </trim>
            <trim prefix="deviceRemark=(case" suffix="ELSE deviceRemark end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('deviceRemark')) or (colPickMode==1 and !item.containsKey('deviceRemark'))">
                        when a.id=#{item.id} then #{item.deviceRemark}
                    </if>
                </foreach>
            </trim>
            <trim prefix="onlineTime=(case" suffix="ELSE onlineTime end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('onlineTime')) or (colPickMode==1 and !item.containsKey('onlineTime'))">
                        when a.id=#{item.id} then #{item.onlineTime}
                    </if>
                </foreach>
            </trim>
            <trim prefix="offlineTime=(case" suffix="ELSE offlineTime end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('offlineTime')) or (colPickMode==1 and !item.containsKey('offlineTime'))">
                        when a.id=#{item.id} then #{item.offlineTime}
                    </if>
                </foreach>
            </trim>
            <trim prefix="deleted=(case" suffix="ELSE deleted end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('deleted')) or (colPickMode==1 and !item.containsKey('deleted'))">
                            when a.id=#{item.id} then #{item.deleted}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('deletedIncrement')) or (colPickMode==1 and !item.containsKey('deletedIncrement'))">
                            when a.id=#{item.id} then ifnull(a.deleted,0) + #{item.deletedIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="source=(case" suffix="ELSE source end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('source')) or (colPickMode==1 and !item.containsKey('source'))">
                            when a.id=#{item.id} then #{item.source}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('sourceIncrement')) or (colPickMode==1 and !item.containsKey('sourceIncrement'))">
                            when a.id=#{item.id} then ifnull(a.source,0) + #{item.sourceIncrement}
                        </when>
                    </choose>
                </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="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="updateUserId=(case" suffix="ELSE updateUserId end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('updateUserId')) or (colPickMode==1 and !item.containsKey('updateUserId'))">
                            when a.id=#{item.id} then #{item.updateUserId}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !item.containsKey('updateUserIdIncrement'))">
                            when a.id=#{item.id} then ifnull(a.updateUserId,0) + #{item.updateUserIdIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="updateTime=(case" suffix="ELSE updateTime end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('updateTime')) or (colPickMode==1 and !item.containsKey('updateTime'))">
                        when a.id=#{item.id} then #{item.updateTime}
                    </if>
                </foreach>
            </trim>
            <trim prefix="deviceSN=(case" suffix="ELSE deviceSN end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('deviceSN')) or (colPickMode==1 and !item.containsKey('deviceSN'))">
                        when a.id=#{item.id} then #{item.deviceSN}
                    </if>
                </foreach>
            </trim>
            <trim prefix="deviceVersion=(case" suffix="ELSE deviceVersion end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('deviceVersion')) or (colPickMode==1 and !item.containsKey('deviceVersion'))">
                        when a.id=#{item.id} then #{item.deviceVersion}
                    </if>
                </foreach>
            </trim>
            <trim prefix="productCode=(case" suffix="ELSE productCode end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('productCode')) or (colPickMode==1 and !item.containsKey('productCode'))">
                        when a.id=#{item.id} then #{item.productCode}
                    </if>
                </foreach>
            </trim>
            <trim prefix="hallId=(case" suffix="ELSE hallId end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('hallId')) or (colPickMode==1 and !item.containsKey('hallId'))">
                            when a.id=#{item.id} then #{item.hallId}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('hallIdIncrement')) or (colPickMode==1 and !item.containsKey('hallIdIncrement'))">
                            when a.id=#{item.id} then ifnull(a.hallId,0) + #{item.hallIdIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="hallName=(case" suffix="ELSE hallName 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="showSms=(case" suffix="ELSE showSms end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('showSms')) or (colPickMode==1 and !item.containsKey('showSms'))">
                            when a.id=#{item.id} then #{item.showSms}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('showSmsIncrement')) or (colPickMode==1 and !item.containsKey('showSmsIncrement'))">
                            when a.id=#{item.id} then ifnull(a.showSms,0) + #{item.showSmsIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="showPrint=(case" suffix="ELSE showPrint end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('showPrint')) or (colPickMode==1 and !item.containsKey('showPrint'))">
                            when a.id=#{item.id} then #{item.showPrint}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('showPrintIncrement')) or (colPickMode==1 and !item.containsKey('showPrintIncrement'))">
                            when a.id=#{item.id} then ifnull(a.showPrint,0) + #{item.showPrintIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="showWechatQrCode=(case" suffix="ELSE showWechatQrCode end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('showWechatQrCode')) or (colPickMode==1 and !item.containsKey('showWechatQrCode'))">
                            when a.id=#{item.id} then #{item.showWechatQrCode}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('showWechatQrCodeIncrement')) or (colPickMode==1 and !item.containsKey('showWechatQrCodeIncrement'))">
                            when a.id=#{item.id} then ifnull(a.showWechatQrCode,0) + #{item.showWechatQrCodeIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="orgName=(case" suffix="ELSE orgName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('orgName')) or (colPickMode==1 and !item.containsKey('orgName'))">
                        when a.id=#{item.id} then #{item.orgName}
                    </if>
                </foreach>
            </trim>
            <trim prefix="resolution=(case" suffix="ELSE resolution end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('resolution')) or (colPickMode==1 and !item.containsKey('resolution'))">
                        when a.id=#{item.id} then #{item.resolution}
                    </if>
                </foreach>
            </trim>
            <trim prefix="resolutionValue=(case" suffix="ELSE resolutionValue end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('resolutionValue')) or (colPickMode==1 and !item.containsKey('resolutionValue'))">
                        when a.id=#{item.id} then #{item.resolutionValue}
                    </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="DeviceEntity-Map">
        select <include refid="_columns"/>
        from mortals_xhx_device as a
        where a.id=#{condition.id}
    </select>
    <!-- 根据主健删除 -->
    <delete id="deleteByKey" parameterType="paramDto">
        delete a.* from mortals_xhx_device as a where a.id=#{condition.id}
    </delete>
    <!-- 根据主健删除一批，针对单一主健有效 -->
    <delete id="deleteByKeys">
        delete from mortals_xhx_device where id in
        <foreach collection="array" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>
    <!-- 根据主健列表删除一批，针对单一主健有效 -->
    <delete id="deleteByKeyList">
        delete from mortals_xhx_device where id in
        <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>

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

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

        <if test="conditionParamRef.containsKey('deviceMac')">
            <if test="conditionParamRef.deviceMac != null and conditionParamRef.deviceMac != ''">
                ${_conditionType_} a.deviceMac like #{${_conditionParam_}.deviceMac}
            </if>
            <if test="conditionParamRef.deviceMac == null">
                ${_conditionType_} a.deviceMac is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('deviceMacList') and conditionParamRef.deviceMacList.size() > 0">
            ${_conditionType_} a.deviceMac in
            <foreach collection="conditionParamRef.deviceMacList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceMacNotList') and conditionParamRef.deviceMacNotList.size() > 0">
            ${_conditionType_} a.deviceMac not in
            <foreach collection="conditionParamRef.deviceMacNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('siteId')">
            <if test="conditionParamRef.siteId != null ">
                ${_conditionType_} a.siteId = #{${_conditionParam_}.siteId}
            </if>
            <if test="conditionParamRef.siteId == null">
                ${_conditionType_} a.siteId is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('siteIdList') and conditionParamRef.siteIdList.size() > 0">
            ${_conditionType_} a.siteId 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.siteId 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.siteId <![CDATA[ >= ]]> #{${_conditionParam_}.siteIdStart}
        </if>
        <if test="conditionParamRef.containsKey('siteIdEnd') and conditionParamRef.siteIdEnd != null">
            ${_conditionType_} a.siteId <![CDATA[ <= ]]> #{${_conditionParam_}.siteIdEnd}
        </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') and conditionParamRef.siteCodeList.size() > 0">
            ${_conditionType_} a.siteCode 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.siteCode 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.siteName like #{${_conditionParam_}.siteName}
            </if>
            <if test="conditionParamRef.siteName == null">
                ${_conditionType_} a.siteName is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('siteNameList') and conditionParamRef.siteNameList.size() > 0">
            ${_conditionType_} a.siteName 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.siteName not in
            <foreach collection="conditionParamRef.siteNameNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('platformId')">
            <if test="conditionParamRef.platformId != null ">
                ${_conditionType_} a.platformId = #{${_conditionParam_}.platformId}
            </if>
            <if test="conditionParamRef.platformId == null">
                ${_conditionType_} a.platformId is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('platformIdList') and conditionParamRef.platformIdList.size() > 0">
            ${_conditionType_} a.platformId in
            <foreach collection="conditionParamRef.platformIdList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('platformIdNotList') and conditionParamRef.platformIdNotList.size() > 0">
            ${_conditionType_} a.platformId not in
            <foreach collection="conditionParamRef.platformIdNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('platformIdStart') and conditionParamRef.platformIdStart != null">
            ${_conditionType_} a.platformId <![CDATA[ >= ]]> #{${_conditionParam_}.platformIdStart}
        </if>
        <if test="conditionParamRef.containsKey('platformIdEnd') and conditionParamRef.platformIdEnd != null">
            ${_conditionType_} a.platformId <![CDATA[ <= ]]> #{${_conditionParam_}.platformIdEnd}
        </if>


        <if test="conditionParamRef.containsKey('platformName')">
            <if test="conditionParamRef.platformName != null and conditionParamRef.platformName != ''">
                ${_conditionType_} a.platformName like #{${_conditionParam_}.platformName}
            </if>
            <if test="conditionParamRef.platformName == null">
                ${_conditionType_} a.platformName is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('platformNameList') and conditionParamRef.platformNameList.size() > 0">
            ${_conditionType_} a.platformName in
            <foreach collection="conditionParamRef.platformNameList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('platformNameNotList') and conditionParamRef.platformNameNotList.size() > 0">
            ${_conditionType_} a.platformName not in
            <foreach collection="conditionParamRef.platformNameNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('productId')">
            <if test="conditionParamRef.productId != null ">
                ${_conditionType_} a.productId = #{${_conditionParam_}.productId}
            </if>
            <if test="conditionParamRef.productId == null">
                ${_conditionType_} a.productId is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('productIdList') and conditionParamRef.productIdList.size() > 0">
            ${_conditionType_} a.productId in
            <foreach collection="conditionParamRef.productIdList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('productIdNotList') and conditionParamRef.productIdNotList.size() > 0">
            ${_conditionType_} a.productId not in
            <foreach collection="conditionParamRef.productIdNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('productIdStart') and conditionParamRef.productIdStart != null">
            ${_conditionType_} a.productId <![CDATA[ >= ]]> #{${_conditionParam_}.productIdStart}
        </if>
        <if test="conditionParamRef.containsKey('productIdEnd') and conditionParamRef.productIdEnd != null">
            ${_conditionType_} a.productId <![CDATA[ <= ]]> #{${_conditionParam_}.productIdEnd}
        </if>


        <if test="conditionParamRef.containsKey('productName')">
            <if test="conditionParamRef.productName != null and conditionParamRef.productName != ''">
                ${_conditionType_} a.productName like #{${_conditionParam_}.productName}
            </if>
            <if test="conditionParamRef.productName == null">
                ${_conditionType_} a.productName is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('productNameList') and conditionParamRef.productNameList.size() > 0">
            ${_conditionType_} a.productName in
            <foreach collection="conditionParamRef.productNameList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('productNameNotList') and conditionParamRef.productNameNotList.size() > 0">
            ${_conditionType_} a.productName not in
            <foreach collection="conditionParamRef.productNameNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('skinId')">
            <if test="conditionParamRef.skinId != null ">
                ${_conditionType_} a.skinId = #{${_conditionParam_}.skinId}
            </if>
            <if test="conditionParamRef.skinId == null">
                ${_conditionType_} a.skinId is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('skinIdList') and conditionParamRef.skinIdList.size() > 0">
            ${_conditionType_} a.skinId in
            <foreach collection="conditionParamRef.skinIdList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('skinIdNotList') and conditionParamRef.skinIdNotList.size() > 0">
            ${_conditionType_} a.skinId not in
            <foreach collection="conditionParamRef.skinIdNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('skinIdStart') and conditionParamRef.skinIdStart != null">
            ${_conditionType_} a.skinId <![CDATA[ >= ]]> #{${_conditionParam_}.skinIdStart}
        </if>
        <if test="conditionParamRef.containsKey('skinIdEnd') and conditionParamRef.skinIdEnd != null">
            ${_conditionType_} a.skinId <![CDATA[ <= ]]> #{${_conditionParam_}.skinIdEnd}
        </if>


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

        <if test="conditionParamRef.containsKey('homeUrl')">
            <if test="conditionParamRef.homeUrl != null and conditionParamRef.homeUrl != ''">
                ${_conditionType_} a.homeUrl like #{${_conditionParam_}.homeUrl}
            </if>
            <if test="conditionParamRef.homeUrl == null">
                ${_conditionType_} a.homeUrl is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('homeUrlList') and conditionParamRef.homeUrlList.size() > 0">
            ${_conditionType_} a.homeUrl in
            <foreach collection="conditionParamRef.homeUrlList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('homeUrlNotList') and conditionParamRef.homeUrlNotList.size() > 0">
            ${_conditionType_} a.homeUrl not in
            <foreach collection="conditionParamRef.homeUrlNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceFirmId')">
            <if test="conditionParamRef.deviceFirmId != null ">
                ${_conditionType_} a.deviceFirmId = #{${_conditionParam_}.deviceFirmId}
            </if>
            <if test="conditionParamRef.deviceFirmId == null">
                ${_conditionType_} a.deviceFirmId is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('deviceFirmIdList') and conditionParamRef.deviceFirmIdList.size() > 0">
            ${_conditionType_} a.deviceFirmId in
            <foreach collection="conditionParamRef.deviceFirmIdList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceFirmIdNotList') and conditionParamRef.deviceFirmIdNotList.size() > 0">
            ${_conditionType_} a.deviceFirmId not in
            <foreach collection="conditionParamRef.deviceFirmIdNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceFirmIdStart') and conditionParamRef.deviceFirmIdStart != null">
            ${_conditionType_} a.deviceFirmId <![CDATA[ >= ]]> #{${_conditionParam_}.deviceFirmIdStart}
        </if>
        <if test="conditionParamRef.containsKey('deviceFirmIdEnd') and conditionParamRef.deviceFirmIdEnd != null">
            ${_conditionType_} a.deviceFirmId <![CDATA[ <= ]]> #{${_conditionParam_}.deviceFirmIdEnd}
        </if>


        <if test="conditionParamRef.containsKey('deviceFirmname')">
            <if test="conditionParamRef.deviceFirmname != null and conditionParamRef.deviceFirmname != ''">
                ${_conditionType_} a.deviceFirmname like #{${_conditionParam_}.deviceFirmname}
            </if>
            <if test="conditionParamRef.deviceFirmname == null">
                ${_conditionType_} a.deviceFirmname is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('deviceFirmnameList') and conditionParamRef.deviceFirmnameList.size() > 0">
            ${_conditionType_} a.deviceFirmname in
            <foreach collection="conditionParamRef.deviceFirmnameList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceFirmnameNotList') and conditionParamRef.deviceFirmnameNotList.size() > 0">
            ${_conditionType_} a.deviceFirmname not in
            <foreach collection="conditionParamRef.deviceFirmnameNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceSrc')">
            <if test="conditionParamRef.deviceSrc != null ">
                ${_conditionType_} a.deviceSrc = #{${_conditionParam_}.deviceSrc}
            </if>
            <if test="conditionParamRef.deviceSrc == null">
                ${_conditionType_} a.deviceSrc is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('deviceSrcList') and conditionParamRef.deviceSrcList.size() > 0">
            ${_conditionType_} a.deviceSrc in
            <foreach collection="conditionParamRef.deviceSrcList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceSrcNotList') and conditionParamRef.deviceSrcNotList.size() > 0">
            ${_conditionType_} a.deviceSrc not in
            <foreach collection="conditionParamRef.deviceSrcNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceSrcStart') and conditionParamRef.deviceSrcStart != null">
            ${_conditionType_} a.deviceSrc <![CDATA[ >= ]]> #{${_conditionParam_}.deviceSrcStart}
        </if>
        <if test="conditionParamRef.containsKey('deviceSrcEnd') and conditionParamRef.deviceSrcEnd != null">
            ${_conditionType_} a.deviceSrc <![CDATA[ <= ]]> #{${_conditionParam_}.deviceSrcEnd}
        </if>

        <if test="conditionParamRef.containsKey('deviceDataSourceWay')">
            <if test="conditionParamRef.deviceDataSourceWay != null ">
                ${_conditionType_} a.deviceDataSourceWay = #{${_conditionParam_}.deviceDataSourceWay}
            </if>
            <if test="conditionParamRef.deviceDataSourceWay == null">
                ${_conditionType_} a.deviceDataSourceWay is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('deviceDataSourceWayList') and conditionParamRef.deviceDataSourceWayList.size() > 0">
            ${_conditionType_} a.deviceDataSourceWay in
            <foreach collection="conditionParamRef.deviceDataSourceWayList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceDataSourceWayNotList') and conditionParamRef.deviceDataSourceWayNotList.size() > 0">
            ${_conditionType_} a.deviceDataSourceWay not in
            <foreach collection="conditionParamRef.deviceDataSourceWayNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceDataSourceWayStart') and conditionParamRef.deviceDataSourceWayStart != null">
            ${_conditionType_} a.deviceDataSourceWay <![CDATA[ >= ]]> #{${_conditionParam_}.deviceDataSourceWayStart}
        </if>
        <if test="conditionParamRef.containsKey('deviceDataSourceWayEnd') and conditionParamRef.deviceDataSourceWayEnd != null">
            ${_conditionType_} a.deviceDataSourceWay <![CDATA[ <= ]]> #{${_conditionParam_}.deviceDataSourceWayEnd}
        </if>


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

        <if test="conditionParamRef.containsKey('lati')">
            <if test="conditionParamRef.lati != null and conditionParamRef.lati != ''">
                ${_conditionType_} a.lati like #{${_conditionParam_}.lati}
            </if>
            <if test="conditionParamRef.lati == null">
                ${_conditionType_} a.lati is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('latiList') and conditionParamRef.latiList.size() > 0">
            ${_conditionType_} a.lati in
            <foreach collection="conditionParamRef.latiList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('latiNotList') and conditionParamRef.latiNotList.size() > 0">
            ${_conditionType_} a.lati not in
            <foreach collection="conditionParamRef.latiNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceInBuilding')">
            <if test="conditionParamRef.deviceInBuilding != null ">
                ${_conditionType_} a.deviceInBuilding = #{${_conditionParam_}.deviceInBuilding}
            </if>
            <if test="conditionParamRef.deviceInBuilding == null">
                ${_conditionType_} a.deviceInBuilding is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('deviceInBuildingList') and conditionParamRef.deviceInBuildingList.size() > 0">
            ${_conditionType_} a.deviceInBuilding in
            <foreach collection="conditionParamRef.deviceInBuildingList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceInBuildingNotList') and conditionParamRef.deviceInBuildingNotList.size() > 0">
            ${_conditionType_} a.deviceInBuilding not in
            <foreach collection="conditionParamRef.deviceInBuildingNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceInBuildingStart') and conditionParamRef.deviceInBuildingStart != null">
            ${_conditionType_} a.deviceInBuilding <![CDATA[ >= ]]> #{${_conditionParam_}.deviceInBuildingStart}
        </if>
        <if test="conditionParamRef.containsKey('deviceInBuildingEnd') and conditionParamRef.deviceInBuildingEnd != null">
            ${_conditionType_} a.deviceInBuilding <![CDATA[ <= ]]> #{${_conditionParam_}.deviceInBuildingEnd}
        </if>

        <if test="conditionParamRef.containsKey('deviceInFloor')">
            <if test="conditionParamRef.deviceInFloor != null ">
                ${_conditionType_} a.deviceInFloor = #{${_conditionParam_}.deviceInFloor}
            </if>
            <if test="conditionParamRef.deviceInFloor == null">
                ${_conditionType_} a.deviceInFloor is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('deviceInFloorList') and conditionParamRef.deviceInFloorList.size() > 0">
            ${_conditionType_} a.deviceInFloor in
            <foreach collection="conditionParamRef.deviceInFloorList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceInFloorNotList') and conditionParamRef.deviceInFloorNotList.size() > 0">
            ${_conditionType_} a.deviceInFloor not in
            <foreach collection="conditionParamRef.deviceInFloorNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceInFloorStart') and conditionParamRef.deviceInFloorStart != null">
            ${_conditionType_} a.deviceInFloor <![CDATA[ >= ]]> #{${_conditionParam_}.deviceInFloorStart}
        </if>
        <if test="conditionParamRef.containsKey('deviceInFloorEnd') and conditionParamRef.deviceInFloorEnd != null">
            ${_conditionType_} a.deviceInFloor <![CDATA[ <= ]]> #{${_conditionParam_}.deviceInFloorEnd}
        </if>


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

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

        <if test="conditionParamRef.containsKey('leadingOfficialTelephone')">
            <if test="conditionParamRef.leadingOfficialTelephone != null and conditionParamRef.leadingOfficialTelephone != ''">
                ${_conditionType_} a.leadingOfficialTelephone like #{${_conditionParam_}.leadingOfficialTelephone}
            </if>
            <if test="conditionParamRef.leadingOfficialTelephone == null">
                ${_conditionType_} a.leadingOfficialTelephone is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('leadingOfficialTelephoneList') and conditionParamRef.leadingOfficialTelephoneList.size() > 0">
            ${_conditionType_} a.leadingOfficialTelephone in
            <foreach collection="conditionParamRef.leadingOfficialTelephoneList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('leadingOfficialTelephoneNotList') and conditionParamRef.leadingOfficialTelephoneNotList.size() > 0">
            ${_conditionType_} a.leadingOfficialTelephone not in
            <foreach collection="conditionParamRef.leadingOfficialTelephoneNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('isReceiveMess')">
            <if test="conditionParamRef.isReceiveMess != null ">
                ${_conditionType_} a.isReceiveMess = #{${_conditionParam_}.isReceiveMess}
            </if>
            <if test="conditionParamRef.isReceiveMess == null">
                ${_conditionType_} a.isReceiveMess is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('isReceiveMessList') and conditionParamRef.isReceiveMessList.size() > 0">
            ${_conditionType_} a.isReceiveMess in
            <foreach collection="conditionParamRef.isReceiveMessList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('isReceiveMessNotList') and conditionParamRef.isReceiveMessNotList.size() > 0">
            ${_conditionType_} a.isReceiveMess not in
            <foreach collection="conditionParamRef.isReceiveMessNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('isReceiveMessStart') and conditionParamRef.isReceiveMessStart != null">
            ${_conditionType_} a.isReceiveMess <![CDATA[ >= ]]> #{${_conditionParam_}.isReceiveMessStart}
        </if>
        <if test="conditionParamRef.containsKey('isReceiveMessEnd') and conditionParamRef.isReceiveMessEnd != null">
            ${_conditionType_} a.isReceiveMess <![CDATA[ <= ]]> #{${_conditionParam_}.isReceiveMessEnd}
        </if>


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

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

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

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

        <if test="conditionParamRef.containsKey('deviceTopic')">
            <if test="conditionParamRef.deviceTopic != null and conditionParamRef.deviceTopic != ''">
                ${_conditionType_} a.deviceTopic like #{${_conditionParam_}.deviceTopic}
            </if>
            <if test="conditionParamRef.deviceTopic == null">
                ${_conditionType_} a.deviceTopic is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('deviceTopicList') and conditionParamRef.deviceTopicList.size() > 0">
            ${_conditionType_} a.deviceTopic in
            <foreach collection="conditionParamRef.deviceTopicList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceTopicNotList') and conditionParamRef.deviceTopicNotList.size() > 0">
            ${_conditionType_} a.deviceTopic not in
            <foreach collection="conditionParamRef.deviceTopicNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceStatus')">
            <if test="conditionParamRef.deviceStatus != null ">
                ${_conditionType_} a.deviceStatus = #{${_conditionParam_}.deviceStatus}
            </if>
            <if test="conditionParamRef.deviceStatus == null">
                ${_conditionType_} a.deviceStatus is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('deviceStatusList') and conditionParamRef.deviceStatusList.size() > 0">
            ${_conditionType_} a.deviceStatus in
            <foreach collection="conditionParamRef.deviceStatusList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceStatusNotList') and conditionParamRef.deviceStatusNotList.size() > 0">
            ${_conditionType_} a.deviceStatus not in
            <foreach collection="conditionParamRef.deviceStatusNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deviceStatusStart') and conditionParamRef.deviceStatusStart != null">
            ${_conditionType_} a.deviceStatus <![CDATA[ >= ]]> #{${_conditionParam_}.deviceStatusStart}
        </if>
        <if test="conditionParamRef.containsKey('deviceStatusEnd') and conditionParamRef.deviceStatusEnd != null">
            ${_conditionType_} a.deviceStatus <![CDATA[ <= ]]> #{${_conditionParam_}.deviceStatusEnd}
        </if>

        <if test="conditionParamRef.containsKey('enabled')">
            <if test="conditionParamRef.enabled != null ">
                ${_conditionType_} a.enabled = #{${_conditionParam_}.enabled}
            </if>
            <if test="conditionParamRef.enabled == null">
                ${_conditionType_} a.enabled is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('enabledList') and conditionParamRef.enabledList.size() > 0">
            ${_conditionType_} a.enabled in
            <foreach collection="conditionParamRef.enabledList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('enabledNotList') and conditionParamRef.enabledNotList.size() > 0">
            ${_conditionType_} a.enabled not in
            <foreach collection="conditionParamRef.enabledNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('enabledStart') and conditionParamRef.enabledStart != null">
            ${_conditionType_} a.enabled <![CDATA[ >= ]]> #{${_conditionParam_}.enabledStart}
        </if>
        <if test="conditionParamRef.containsKey('enabledEnd') and conditionParamRef.enabledEnd != null">
            ${_conditionType_} a.enabled <![CDATA[ <= ]]> #{${_conditionParam_}.enabledEnd}
        </if>


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

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

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

        <if test="conditionParamRef.containsKey('offlineTime')">
            <if test="conditionParamRef.offlineTime != null ">
                ${_conditionType_} a.offlineTime = #{${_conditionParam_}.offlineTime}
            </if>
            <if test="conditionParamRef.offlineTime == null">
                ${_conditionType_} a.offlineTime is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('offlineTimeStart') and conditionParamRef.offlineTimeStart != null and conditionParamRef.offlineTimeStart!=''">
            ${_conditionType_} a.offlineTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.offlineTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
        </if>
        <if test="conditionParamRef.containsKey('offlineTimeEnd') and conditionParamRef.offlineTimeEnd != null and conditionParamRef.offlineTimeEnd!=''">
            ${_conditionType_} a.offlineTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.offlineTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
        </if>
        <if test="conditionParamRef.containsKey('deleted')">
            <if test="conditionParamRef.deleted != null ">
                ${_conditionType_} a.deleted = #{${_conditionParam_}.deleted}
            </if>
            <if test="conditionParamRef.deleted == null">
                ${_conditionType_} a.deleted is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('deletedList') and conditionParamRef.deletedList.size() > 0">
            ${_conditionType_} a.deleted in
            <foreach collection="conditionParamRef.deletedList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deletedNotList') and conditionParamRef.deletedNotList.size() > 0">
            ${_conditionType_} a.deleted not in
            <foreach collection="conditionParamRef.deletedNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deletedStart') and conditionParamRef.deletedStart != null">
            ${_conditionType_} a.deleted <![CDATA[ >= ]]> #{${_conditionParam_}.deletedStart}
        </if>
        <if test="conditionParamRef.containsKey('deletedEnd') and conditionParamRef.deletedEnd != null">
            ${_conditionType_} a.deleted <![CDATA[ <= ]]> #{${_conditionParam_}.deletedEnd}
        </if>

        <if test="conditionParamRef.containsKey('source')">
            <if test="conditionParamRef.source != null ">
                ${_conditionType_} a.source = #{${_conditionParam_}.source}
            </if>
            <if test="conditionParamRef.source == null">
                ${_conditionType_} a.source is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('sourceList') and conditionParamRef.sourceList.size() > 0">
            ${_conditionType_} a.source in
            <foreach collection="conditionParamRef.sourceList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('sourceNotList') and conditionParamRef.sourceNotList.size() > 0">
            ${_conditionType_} a.source not in
            <foreach collection="conditionParamRef.sourceNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('sourceStart') and conditionParamRef.sourceStart != null">
            ${_conditionType_} a.source <![CDATA[ >= ]]> #{${_conditionParam_}.sourceStart}
        </if>
        <if test="conditionParamRef.containsKey('sourceEnd') and conditionParamRef.sourceEnd != null">
            ${_conditionType_} a.source <![CDATA[ <= ]]> #{${_conditionParam_}.sourceEnd}
        </if>

        <if test="conditionParamRef.containsKey('createUserId')">
            <if test="conditionParamRef.createUserId != null ">
                ${_conditionType_} a.createUserId = #{${_conditionParam_}.createUserId}
            </if>
            <if test="conditionParamRef.createUserId == null">
                ${_conditionType_} a.createUserId is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('createUserIdList') and conditionParamRef.createUserIdList.size() > 0">
            ${_conditionType_} a.createUserId in
            <foreach collection="conditionParamRef.createUserIdList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('createUserIdNotList') and conditionParamRef.createUserIdNotList.size() > 0">
            ${_conditionType_} a.createUserId not in
            <foreach collection="conditionParamRef.createUserIdNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('createUserIdStart') and conditionParamRef.createUserIdStart != null">
            ${_conditionType_} a.createUserId <![CDATA[ >= ]]> #{${_conditionParam_}.createUserIdStart}
        </if>
        <if test="conditionParamRef.containsKey('createUserIdEnd') and conditionParamRef.createUserIdEnd != null">
            ${_conditionType_} a.createUserId <![CDATA[ <= ]]> #{${_conditionParam_}.createUserIdEnd}
        </if>


        <if test="conditionParamRef.containsKey('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('updateUserId')">
            <if test="conditionParamRef.updateUserId != null ">
                ${_conditionType_} a.updateUserId = #{${_conditionParam_}.updateUserId}
            </if>
            <if test="conditionParamRef.updateUserId == null">
                ${_conditionType_} a.updateUserId is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
            ${_conditionType_} a.updateUserId in
            <foreach collection="conditionParamRef.updateUserIdList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('updateUserIdNotList') and conditionParamRef.updateUserIdNotList.size() > 0">
            ${_conditionType_} a.updateUserId not in
            <foreach collection="conditionParamRef.updateUserIdNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('updateUserIdStart') and conditionParamRef.updateUserIdStart != null">
            ${_conditionType_} a.updateUserId <![CDATA[ >= ]]> #{${_conditionParam_}.updateUserIdStart}
        </if>
        <if test="conditionParamRef.containsKey('updateUserIdEnd') and conditionParamRef.updateUserIdEnd != null">
            ${_conditionType_} a.updateUserId <![CDATA[ <= ]]> #{${_conditionParam_}.updateUserIdEnd}
        </if>


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

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

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

        <if test="conditionParamRef.containsKey('productCode')">
            <if test="conditionParamRef.productCode != null and conditionParamRef.productCode != ''">
                ${_conditionType_} a.productCode like #{${_conditionParam_}.productCode}
            </if>
            <if test="conditionParamRef.productCode == null">
                ${_conditionType_} a.productCode is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('productCodeList') and conditionParamRef.productCodeList.size() > 0">
            ${_conditionType_} a.productCode in
            <foreach collection="conditionParamRef.productCodeList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('productCodeNotList') and conditionParamRef.productCodeNotList.size() > 0">
            ${_conditionType_} a.productCode not in
            <foreach collection="conditionParamRef.productCodeNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('hallId')">
            <if test="conditionParamRef.hallId != null ">
                ${_conditionType_} a.hallId = #{${_conditionParam_}.hallId}
            </if>
            <if test="conditionParamRef.hallId == null">
                ${_conditionType_} a.hallId is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('hallIdList') and conditionParamRef.hallIdList.size() > 0">
            ${_conditionType_} a.hallId in
            <foreach collection="conditionParamRef.hallIdList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('hallIdNotList') and conditionParamRef.hallIdNotList.size() > 0">
            ${_conditionType_} a.hallId not in
            <foreach collection="conditionParamRef.hallIdNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('hallIdStart') and conditionParamRef.hallIdStart != null">
            ${_conditionType_} a.hallId <![CDATA[ >= ]]> #{${_conditionParam_}.hallIdStart}
        </if>
        <if test="conditionParamRef.containsKey('hallIdEnd') and conditionParamRef.hallIdEnd != null">
            ${_conditionType_} a.hallId <![CDATA[ <= ]]> #{${_conditionParam_}.hallIdEnd}
        </if>


        <if test="conditionParamRef.containsKey('hallName')">
            <if test="conditionParamRef.hallName != null and conditionParamRef.hallName != ''">
                ${_conditionType_} a.hallName like #{${_conditionParam_}.hallName}
            </if>
            <if test="conditionParamRef.hallName == null">
                ${_conditionType_} a.hallName is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('hallNameList') and conditionParamRef.hallNameList.size() > 0">
            ${_conditionType_} a.hallName 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.hallName not in
            <foreach collection="conditionParamRef.hallNameNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('showSms')">
            <if test="conditionParamRef.showSms != null ">
                ${_conditionType_} a.showSms = #{${_conditionParam_}.showSms}
            </if>
            <if test="conditionParamRef.showSms == null">
                ${_conditionType_} a.showSms is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('showSmsList') and conditionParamRef.showSmsList.size() > 0">
            ${_conditionType_} a.showSms in
            <foreach collection="conditionParamRef.showSmsList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('showSmsNotList') and conditionParamRef.showSmsNotList.size() > 0">
            ${_conditionType_} a.showSms not in
            <foreach collection="conditionParamRef.showSmsNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('showSmsStart') and conditionParamRef.showSmsStart != null">
            ${_conditionType_} a.showSms <![CDATA[ >= ]]> #{${_conditionParam_}.showSmsStart}
        </if>
        <if test="conditionParamRef.containsKey('showSmsEnd') and conditionParamRef.showSmsEnd != null">
            ${_conditionType_} a.showSms <![CDATA[ <= ]]> #{${_conditionParam_}.showSmsEnd}
        </if>

        <if test="conditionParamRef.containsKey('showPrint')">
            <if test="conditionParamRef.showPrint != null ">
                ${_conditionType_} a.showPrint = #{${_conditionParam_}.showPrint}
            </if>
            <if test="conditionParamRef.showPrint == null">
                ${_conditionType_} a.showPrint is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('showPrintList') and conditionParamRef.showPrintList.size() > 0">
            ${_conditionType_} a.showPrint in
            <foreach collection="conditionParamRef.showPrintList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('showPrintNotList') and conditionParamRef.showPrintNotList.size() > 0">
            ${_conditionType_} a.showPrint not in
            <foreach collection="conditionParamRef.showPrintNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('showPrintStart') and conditionParamRef.showPrintStart != null">
            ${_conditionType_} a.showPrint <![CDATA[ >= ]]> #{${_conditionParam_}.showPrintStart}
        </if>
        <if test="conditionParamRef.containsKey('showPrintEnd') and conditionParamRef.showPrintEnd != null">
            ${_conditionType_} a.showPrint <![CDATA[ <= ]]> #{${_conditionParam_}.showPrintEnd}
        </if>

        <if test="conditionParamRef.containsKey('showWechatQrCode')">
            <if test="conditionParamRef.showWechatQrCode != null ">
                ${_conditionType_} a.showWechatQrCode = #{${_conditionParam_}.showWechatQrCode}
            </if>
            <if test="conditionParamRef.showWechatQrCode == null">
                ${_conditionType_} a.showWechatQrCode is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('showWechatQrCodeList') and conditionParamRef.showWechatQrCodeList.size() > 0">
            ${_conditionType_} a.showWechatQrCode in
            <foreach collection="conditionParamRef.showWechatQrCodeList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('showWechatQrCodeNotList') and conditionParamRef.showWechatQrCodeNotList.size() > 0">
            ${_conditionType_} a.showWechatQrCode not in
            <foreach collection="conditionParamRef.showWechatQrCodeNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('showWechatQrCodeStart') and conditionParamRef.showWechatQrCodeStart != null">
            ${_conditionType_} a.showWechatQrCode <![CDATA[ >= ]]> #{${_conditionParam_}.showWechatQrCodeStart}
        </if>
        <if test="conditionParamRef.containsKey('showWechatQrCodeEnd') and conditionParamRef.showWechatQrCodeEnd != null">
            ${_conditionType_} a.showWechatQrCode <![CDATA[ <= ]]> #{${_conditionParam_}.showWechatQrCodeEnd}
        </if>


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

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

        <if test="conditionParamRef.containsKey('resolutionValue')">
            <if test="conditionParamRef.resolutionValue != null and conditionParamRef.resolutionValue != ''">
                ${_conditionType_} a.resolutionValue like #{${_conditionParam_}.resolutionValue}
            </if>
            <if test="conditionParamRef.resolutionValue == null">
                ${_conditionType_} a.resolutionValue is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('resolutionValueList') and conditionParamRef.resolutionValueList.size() > 0">
            ${_conditionType_} a.resolutionValue in
            <foreach collection="conditionParamRef.resolutionValueList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('resolutionValueNotList') and conditionParamRef.resolutionValueNotList.size() > 0">
            ${_conditionType_} a.resolutionValue not in
            <foreach collection="conditionParamRef.resolutionValueNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </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('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('platformIdList') and conditionParamRef.platformIdList.size() > 0">
                field(a.platformId,
                <foreach collection="conditionParamRef.platformIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('productIdList') and conditionParamRef.productIdList.size() > 0">
                field(a.productId,
                <foreach collection="conditionParamRef.productIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('skinIdList') and conditionParamRef.skinIdList.size() > 0">
                field(a.skinId,
                <foreach collection="conditionParamRef.skinIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('deviceFirmIdList') and conditionParamRef.deviceFirmIdList.size() > 0">
                field(a.deviceFirmId,
                <foreach collection="conditionParamRef.deviceFirmIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('deviceSrcList') and conditionParamRef.deviceSrcList.size() > 0">
                field(a.deviceSrc,
                <foreach collection="conditionParamRef.deviceSrcList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('deviceDataSourceWayList') and conditionParamRef.deviceDataSourceWayList.size() > 0">
                field(a.deviceDataSourceWay,
                <foreach collection="conditionParamRef.deviceDataSourceWayList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('deviceInBuildingList') and conditionParamRef.deviceInBuildingList.size() > 0">
                field(a.deviceInBuilding,
                <foreach collection="conditionParamRef.deviceInBuildingList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('deviceInFloorList') and conditionParamRef.deviceInFloorList.size() > 0">
                field(a.deviceInFloor,
                <foreach collection="conditionParamRef.deviceInFloorList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('isReceiveMessList') and conditionParamRef.isReceiveMessList.size() > 0">
                field(a.isReceiveMess,
                <foreach collection="conditionParamRef.isReceiveMessList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('deviceStatusList') and conditionParamRef.deviceStatusList.size() > 0">
                field(a.deviceStatus,
                <foreach collection="conditionParamRef.deviceStatusList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('enabledList') and conditionParamRef.enabledList.size() > 0">
                field(a.enabled,
                <foreach collection="conditionParamRef.enabledList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('deletedList') and conditionParamRef.deletedList.size() > 0">
                field(a.deleted,
                <foreach collection="conditionParamRef.deletedList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('sourceList') and conditionParamRef.sourceList.size() > 0">
                field(a.source,
                <foreach collection="conditionParamRef.sourceList" 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>
            <if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
                field(a.updateUserId,
                <foreach collection="conditionParamRef.updateUserIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('hallIdList') and conditionParamRef.hallIdList.size() > 0">
                field(a.hallId,
                <foreach collection="conditionParamRef.hallIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('showSmsList') and conditionParamRef.showSmsList.size() > 0">
                field(a.showSms,
                <foreach collection="conditionParamRef.showSmsList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('showPrintList') and conditionParamRef.showPrintList.size() > 0">
                field(a.showPrint,
                <foreach collection="conditionParamRef.showPrintList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('showWechatQrCodeList') and conditionParamRef.showWechatQrCodeList.size() > 0">
                field(a.showWechatQrCode,
                <foreach collection="conditionParamRef.showWechatQrCodeList" 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('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('platformIdList') and conditionParamRef.platformIdList.size() > 0">
                field(a.platformId,
                <foreach collection="conditionParamRef.platformIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('productIdList') and conditionParamRef.productIdList.size() > 0">
                field(a.productId,
                <foreach collection="conditionParamRef.productIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('skinIdList') and conditionParamRef.skinIdList.size() > 0">
                field(a.skinId,
                <foreach collection="conditionParamRef.skinIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('deviceFirmIdList') and conditionParamRef.deviceFirmIdList.size() > 0">
                field(a.deviceFirmId,
                <foreach collection="conditionParamRef.deviceFirmIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('deviceSrcList') and conditionParamRef.deviceSrcList.size() > 0">
                field(a.deviceSrc,
                <foreach collection="conditionParamRef.deviceSrcList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('deviceDataSourceWayList') and conditionParamRef.deviceDataSourceWayList.size() > 0">
                field(a.deviceDataSourceWay,
                <foreach collection="conditionParamRef.deviceDataSourceWayList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('deviceInBuildingList') and conditionParamRef.deviceInBuildingList.size() > 0">
                field(a.deviceInBuilding,
                <foreach collection="conditionParamRef.deviceInBuildingList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('deviceInFloorList') and conditionParamRef.deviceInFloorList.size() > 0">
                field(a.deviceInFloor,
                <foreach collection="conditionParamRef.deviceInFloorList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('isReceiveMessList') and conditionParamRef.isReceiveMessList.size() > 0">
                field(a.isReceiveMess,
                <foreach collection="conditionParamRef.isReceiveMessList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('deviceStatusList') and conditionParamRef.deviceStatusList.size() > 0">
                field(a.deviceStatus,
                <foreach collection="conditionParamRef.deviceStatusList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('enabledList') and conditionParamRef.enabledList.size() > 0">
                field(a.enabled,
                <foreach collection="conditionParamRef.enabledList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('deletedList') and conditionParamRef.deletedList.size() > 0">
                field(a.deleted,
                <foreach collection="conditionParamRef.deletedList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('sourceList') and conditionParamRef.sourceList.size() > 0">
                field(a.source,
                <foreach collection="conditionParamRef.sourceList" 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>
            <if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
                field(a.updateUserId,
                <foreach collection="conditionParamRef.updateUserIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('hallIdList') and conditionParamRef.hallIdList.size() > 0">
                field(a.hallId,
                <foreach collection="conditionParamRef.hallIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('showSmsList') and conditionParamRef.showSmsList.size() > 0">
                field(a.showSms,
                <foreach collection="conditionParamRef.showSmsList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('showPrintList') and conditionParamRef.showPrintList.size() > 0">
                field(a.showPrint,
                <foreach collection="conditionParamRef.showPrintList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('showWechatQrCodeList') and conditionParamRef.showWechatQrCodeList.size() > 0">
                field(a.showWechatQrCode,
                <foreach collection="conditionParamRef.showWechatQrCodeList" 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('deviceName')">
                    a.deviceName
                    <if test='orderCol.deviceName != null and "DESC".equalsIgnoreCase(orderCol.deviceName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deviceCode')">
                    a.deviceCode
                    <if test='orderCol.deviceCode != null and "DESC".equalsIgnoreCase(orderCol.deviceCode)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deviceMac')">
                    a.deviceMac
                    <if test='orderCol.deviceMac != null and "DESC".equalsIgnoreCase(orderCol.deviceMac)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('siteId')">
                    a.siteId
                    <if test='orderCol.siteId != null and "DESC".equalsIgnoreCase(orderCol.siteId)'>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('siteName')">
                    a.siteName
                    <if test='orderCol.siteName != null and "DESC".equalsIgnoreCase(orderCol.siteName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('platformId')">
                    a.platformId
                    <if test='orderCol.platformId != null and "DESC".equalsIgnoreCase(orderCol.platformId)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('platformName')">
                    a.platformName
                    <if test='orderCol.platformName != null and "DESC".equalsIgnoreCase(orderCol.platformName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('productId')">
                    a.productId
                    <if test='orderCol.productId != null and "DESC".equalsIgnoreCase(orderCol.productId)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('productName')">
                    a.productName
                    <if test='orderCol.productName != null and "DESC".equalsIgnoreCase(orderCol.productName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('skinId')">
                    a.skinId
                    <if test='orderCol.skinId != null and "DESC".equalsIgnoreCase(orderCol.skinId)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('skinName')">
                    a.skinName
                    <if test='orderCol.skinName != null and "DESC".equalsIgnoreCase(orderCol.skinName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('homeUrl')">
                    a.homeUrl
                    <if test='orderCol.homeUrl != null and "DESC".equalsIgnoreCase(orderCol.homeUrl)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deviceFirmId')">
                    a.deviceFirmId
                    <if test='orderCol.deviceFirmId != null and "DESC".equalsIgnoreCase(orderCol.deviceFirmId)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deviceFirmname')">
                    a.deviceFirmname
                    <if test='orderCol.deviceFirmname != null and "DESC".equalsIgnoreCase(orderCol.deviceFirmname)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deviceSrc')">
                    a.deviceSrc
                    <if test='orderCol.deviceSrc != null and "DESC".equalsIgnoreCase(orderCol.deviceSrc)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deviceDataSourceWay')">
                    a.deviceDataSourceWay
                    <if test='orderCol.deviceDataSourceWay != null and "DESC".equalsIgnoreCase(orderCol.deviceDataSourceWay)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('lon')">
                    a.lon
                    <if test='orderCol.lon != null and "DESC".equalsIgnoreCase(orderCol.lon)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('lati')">
                    a.lati
                    <if test='orderCol.lati != null and "DESC".equalsIgnoreCase(orderCol.lati)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deviceInBuilding')">
                    a.deviceInBuilding
                    <if test='orderCol.deviceInBuilding != null and "DESC".equalsIgnoreCase(orderCol.deviceInBuilding)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deviceInFloor')">
                    a.deviceInFloor
                    <if test='orderCol.deviceInFloor != null and "DESC".equalsIgnoreCase(orderCol.deviceInFloor)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('defectsLiabilityPeriod')">
                    a.defectsLiabilityPeriod
                    <if test='orderCol.defectsLiabilityPeriod != null and "DESC".equalsIgnoreCase(orderCol.defectsLiabilityPeriod)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('leadingOfficial')">
                    a.leadingOfficial
                    <if test='orderCol.leadingOfficial != null and "DESC".equalsIgnoreCase(orderCol.leadingOfficial)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('leadingOfficialTelephone')">
                    a.leadingOfficialTelephone
                    <if test='orderCol.leadingOfficialTelephone != null and "DESC".equalsIgnoreCase(orderCol.leadingOfficialTelephone)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('isReceiveMess')">
                    a.isReceiveMess
                    <if test='orderCol.isReceiveMess != null and "DESC".equalsIgnoreCase(orderCol.isReceiveMess)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('devicePhotoPath')">
                    a.devicePhotoPath
                    <if test='orderCol.devicePhotoPath != null and "DESC".equalsIgnoreCase(orderCol.devicePhotoPath)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('ip')">
                    a.ip
                    <if test='orderCol.ip != null and "DESC".equalsIgnoreCase(orderCol.ip)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('centernum')">
                    a.centernum
                    <if test='orderCol.centernum != null and "DESC".equalsIgnoreCase(orderCol.centernum)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('port')">
                    a.port
                    <if test='orderCol.port != null and "DESC".equalsIgnoreCase(orderCol.port)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deviceTopic')">
                    a.deviceTopic
                    <if test='orderCol.deviceTopic != null and "DESC".equalsIgnoreCase(orderCol.deviceTopic)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deviceStatus')">
                    a.deviceStatus
                    <if test='orderCol.deviceStatus != null and "DESC".equalsIgnoreCase(orderCol.deviceStatus)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('enabled')">
                    a.enabled
                    <if test='orderCol.enabled != null and "DESC".equalsIgnoreCase(orderCol.enabled)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deviceAuthCode')">
                    a.deviceAuthCode
                    <if test='orderCol.deviceAuthCode != null and "DESC".equalsIgnoreCase(orderCol.deviceAuthCode)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deviceRemark')">
                    a.deviceRemark
                    <if test='orderCol.deviceRemark != null and "DESC".equalsIgnoreCase(orderCol.deviceRemark)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('onlineTime')">
                    a.onlineTime
                    <if test='orderCol.onlineTime != null and "DESC".equalsIgnoreCase(orderCol.onlineTime)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('offlineTime')">
                    a.offlineTime
                    <if test='orderCol.offlineTime != null and "DESC".equalsIgnoreCase(orderCol.offlineTime)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deleted')">
                    a.deleted
                    <if test='orderCol.deleted != null and "DESC".equalsIgnoreCase(orderCol.deleted)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('source')">
                    a.source
                    <if test='orderCol.source != null and "DESC".equalsIgnoreCase(orderCol.source)'>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('createTime')">
                    a.createTime
                    <if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('updateUserId')">
                    a.updateUserId
                    <if test='orderCol.updateUserId != null and "DESC".equalsIgnoreCase(orderCol.updateUserId)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('updateTime')">
                    a.updateTime
                    <if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deviceSN')">
                    a.deviceSN
                    <if test='orderCol.deviceSN != null and "DESC".equalsIgnoreCase(orderCol.deviceSN)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deviceVersion')">
                    a.deviceVersion
                    <if test='orderCol.deviceVersion != null and "DESC".equalsIgnoreCase(orderCol.deviceVersion)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('productCode')">
                    a.productCode
                    <if test='orderCol.productCode != null and "DESC".equalsIgnoreCase(orderCol.productCode)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('hallId')">
                    a.hallId
                    <if test='orderCol.hallId != null and "DESC".equalsIgnoreCase(orderCol.hallId)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('hallName')">
                    a.hallName
                    <if test='orderCol.hallName != null and "DESC".equalsIgnoreCase(orderCol.hallName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('showSms')">
                    a.showSms
                    <if test='orderCol.showSms != null and "DESC".equalsIgnoreCase(orderCol.showSms)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('showPrint')">
                    a.showPrint
                    <if test='orderCol.showPrint != null and "DESC".equalsIgnoreCase(orderCol.showPrint)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('showWechatQrCode')">
                    a.showWechatQrCode
                    <if test='orderCol.showWechatQrCode != null and "DESC".equalsIgnoreCase(orderCol.showWechatQrCode)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('orgName')">
                    a.orgName
                    <if test='orderCol.orgName != null and "DESC".equalsIgnoreCase(orderCol.orgName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('resolution')">
                    a.resolution
                    <if test='orderCol.resolution != null and "DESC".equalsIgnoreCase(orderCol.resolution)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('resolutionValue')">
                    a.resolutionValue
                    <if test='orderCol.resolutionValue != null and "DESC".equalsIgnoreCase(orderCol.resolutionValue)'>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>