<?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.perform.dao.ibatis.PerformErrorRecordDaoImpl">

    <!-- 字段和属性映射 -->
    <resultMap type="PerformErrorRecordEntity" id="PerformErrorRecordEntity-Map">
        <id  property="id" column="id" />
        <result property="staffId" column="staffId" />
        <result property="staffName" column="staffName" />
        <result property="workNum" column="workNum" />
        <result property="windowNum" column="windowNum" />
        <result property="deptId" column="deptId" />
        <result property="deptName" column="deptName" />
        <result property="irregularType" column="irregularType" />
        <result property="happenTime" column="happenTime" />
        <result property="duration" column="duration" />
        <result property="alarmTime" column="alarmTime" />
        <result property="snapPath" column="snapPath" />
        <result property="categoryId" column="categoryId" />
        <result property="categoryName" column="categoryName" />
        <result property="ruleId" column="ruleId" />
        <result property="ruleName" column="ruleName" />
        <result property="subMethod" column="subMethod" />
        <result property="deductPerson" column="deductPerson" />
        <result property="deductTime" column="deductTime" />
        <result property="subAddType" column="subAddType" />
        <result property="score" column="score" />
        <result property="processStatus" column="processStatus" />
        <result property="fileNames" column="fileNames" />
        <result property="filePaths" column="filePaths" />
        <result property="remark" column="remark" />
        <result property="createUserId" column="createUserId" />
        <result property="createTime" column="createTime" />
        <result property="updateUserId" column="updateUserId" />
        <result property="updateTime" column="updateTime" />
        <result property="salaId" column="salaId" />
        <result property="salaName" column="salaName" />

    </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('staffId') or colPickMode == 1 and data.containsKey('staffId')))">
                a.staffId,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('staffName') or colPickMode == 1 and data.containsKey('staffName')))">
                a.staffName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('workNum') or colPickMode == 1 and data.containsKey('workNum')))">
                a.workNum,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('windowNum') or colPickMode == 1 and data.containsKey('windowNum')))">
                a.windowNum,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptId') or colPickMode == 1 and data.containsKey('deptId')))">
                a.deptId,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptName') or colPickMode == 1 and data.containsKey('deptName')))">
                a.deptName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('irregularType') or colPickMode == 1 and data.containsKey('irregularType')))">
                a.irregularType,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('happenTime') or colPickMode == 1 and data.containsKey('happenTime')))">
                a.happenTime,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('duration') or colPickMode == 1 and data.containsKey('duration')))">
                a.duration,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('alarmTime') or colPickMode == 1 and data.containsKey('alarmTime')))">
                a.alarmTime,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('snapPath') or colPickMode == 1 and data.containsKey('snapPath')))">
                a.snapPath,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('categoryId') or colPickMode == 1 and data.containsKey('categoryId')))">
                a.categoryId,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('categoryName') or colPickMode == 1 and data.containsKey('categoryName')))">
                a.categoryName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('ruleId') or colPickMode == 1 and data.containsKey('ruleId')))">
                a.ruleId,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('ruleName') or colPickMode == 1 and data.containsKey('ruleName')))">
                a.ruleName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('subMethod') or colPickMode == 1 and data.containsKey('subMethod')))">
                a.subMethod,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deductPerson') or colPickMode == 1 and data.containsKey('deductPerson')))">
                a.deductPerson,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deductTime') or colPickMode == 1 and data.containsKey('deductTime')))">
                a.deductTime,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('subAddType') or colPickMode == 1 and data.containsKey('subAddType')))">
                a.subAddType,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('score') or colPickMode == 1 and data.containsKey('score')))">
                a.score,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('processStatus') or colPickMode == 1 and data.containsKey('processStatus')))">
                a.processStatus,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('fileNames') or colPickMode == 1 and data.containsKey('fileNames')))">
                a.fileNames,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('filePaths') or colPickMode == 1 and data.containsKey('filePaths')))">
                a.filePaths,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('remark') or colPickMode == 1 and data.containsKey('remark')))">
                a.remark,
            </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('salaId') or colPickMode == 1 and data.containsKey('salaId')))">
                a.salaId,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('salaName') or colPickMode == 1 and data.containsKey('salaName')))">
                a.salaName,
            </if>
        </trim>
    </sql>
    <!-- 新增 区分主键自增加还是业务插入 -->
    <insert id="insert" parameterType="PerformErrorRecordEntity"  useGeneratedKeys="true" keyProperty="id">
        insert into mortals_xhx_perform_error_record
        (staffId,staffName,workNum,windowNum,deptId,deptName,irregularType,happenTime,duration,alarmTime,snapPath,categoryId,categoryName,ruleId,ruleName,subMethod,deductPerson,deductTime,subAddType,score,processStatus,fileNames,filePaths,remark,createUserId,createTime,updateUserId,updateTime,salaId,salaName)
        VALUES
        (#{staffId},#{staffName},#{workNum},#{windowNum},#{deptId},#{deptName},#{irregularType},#{happenTime},#{duration},#{alarmTime},#{snapPath},#{categoryId},#{categoryName},#{ruleId},#{ruleName},#{subMethod},#{deductPerson},#{deductTime},#{subAddType},#{score},#{processStatus},#{fileNames},#{filePaths},#{remark},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{salaId},#{salaName})
    </insert>

    <!-- 批量新增 -->
    <insert id="insertBatch" parameterType="paramDto">
        insert into mortals_xhx_perform_error_record
        (staffId,staffName,workNum,windowNum,deptId,deptName,irregularType,happenTime,duration,alarmTime,snapPath,categoryId,categoryName,ruleId,ruleName,subMethod,deductPerson,deductTime,subAddType,score,processStatus,fileNames,filePaths,remark,createUserId,createTime,updateUserId,updateTime,salaId,salaName)
        VALUES
        <foreach collection="data.dataList" item="item" index="index" separator="," >
            (#{item.staffId},#{item.staffName},#{item.workNum},#{item.windowNum},#{item.deptId},#{item.deptName},#{item.irregularType},#{item.happenTime},#{item.duration},#{item.alarmTime},#{item.snapPath},#{item.categoryId},#{item.categoryName},#{item.ruleId},#{item.ruleName},#{item.subMethod},#{item.deductPerson},#{item.deductTime},#{item.subAddType},#{item.score},#{item.processStatus},#{item.fileNames},#{item.filePaths},#{item.remark},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.salaId},#{item.salaName})
        </foreach>
    </insert>


    <!-- 根据ParamDto更新 -->
    <update id="update" parameterType="paramDto">
        update mortals_xhx_perform_error_record as a
        set
        <trim suffixOverrides="," suffix="">
            <if test="(colPickMode==0 and data.containsKey('staffId')) or (colPickMode==1 and !data.containsKey('staffId'))">
                a.staffId=#{data.staffId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('staffIdIncrement')) or (colPickMode==1 and !data.containsKey('staffIdIncrement'))">
                a.staffId=ifnull(a.staffId,0) + #{data.staffIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('staffName')) or (colPickMode==1 and !data.containsKey('staffName'))">
                a.staffName=#{data.staffName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('workNum')) or (colPickMode==1 and !data.containsKey('workNum'))">
                a.workNum=#{data.workNum},
            </if>
            <if test="(colPickMode==0 and data.containsKey('windowNum')) or (colPickMode==1 and !data.containsKey('windowNum'))">
                a.windowNum=#{data.windowNum},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deptId')) or (colPickMode==1 and !data.containsKey('deptId'))">
                a.deptId=#{data.deptId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deptIdIncrement')) or (colPickMode==1 and !data.containsKey('deptIdIncrement'))">
                a.deptId=ifnull(a.deptId,0) + #{data.deptIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deptName')) or (colPickMode==1 and !data.containsKey('deptName'))">
                a.deptName=#{data.deptName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('irregularType')) or (colPickMode==1 and !data.containsKey('irregularType'))">
                a.irregularType=#{data.irregularType},
            </if>
            <if test="(colPickMode==0 and data.containsKey('irregularTypeIncrement')) or (colPickMode==1 and !data.containsKey('irregularTypeIncrement'))">
                a.irregularType=ifnull(a.irregularType,0) + #{data.irregularTypeIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('happenTime')) or (colPickMode==1 and !data.containsKey('happenTime'))">
                a.happenTime=#{data.happenTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('duration')) or (colPickMode==1 and !data.containsKey('duration'))">
                a.duration=#{data.duration},
            </if>
            <if test="(colPickMode==0 and data.containsKey('durationIncrement')) or (colPickMode==1 and !data.containsKey('durationIncrement'))">
                a.duration=ifnull(a.duration,0) + #{data.durationIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('alarmTime')) or (colPickMode==1 and !data.containsKey('alarmTime'))">
                a.alarmTime=#{data.alarmTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('snapPath')) or (colPickMode==1 and !data.containsKey('snapPath'))">
                a.snapPath=#{data.snapPath},
            </if>
            <if test="(colPickMode==0 and data.containsKey('categoryId')) or (colPickMode==1 and !data.containsKey('categoryId'))">
                a.categoryId=#{data.categoryId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('categoryIdIncrement')) or (colPickMode==1 and !data.containsKey('categoryIdIncrement'))">
                a.categoryId=ifnull(a.categoryId,0) + #{data.categoryIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('categoryName')) or (colPickMode==1 and !data.containsKey('categoryName'))">
                a.categoryName=#{data.categoryName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('ruleId')) or (colPickMode==1 and !data.containsKey('ruleId'))">
                a.ruleId=#{data.ruleId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('ruleIdIncrement')) or (colPickMode==1 and !data.containsKey('ruleIdIncrement'))">
                a.ruleId=ifnull(a.ruleId,0) + #{data.ruleIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('ruleName')) or (colPickMode==1 and !data.containsKey('ruleName'))">
                a.ruleName=#{data.ruleName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('subMethod')) or (colPickMode==1 and !data.containsKey('subMethod'))">
                a.subMethod=#{data.subMethod},
            </if>
            <if test="(colPickMode==0 and data.containsKey('subMethodIncrement')) or (colPickMode==1 and !data.containsKey('subMethodIncrement'))">
                a.subMethod=ifnull(a.subMethod,0) + #{data.subMethodIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deductPerson')) or (colPickMode==1 and !data.containsKey('deductPerson'))">
                a.deductPerson=#{data.deductPerson},
            </if>
            <if test="(colPickMode==0 and data.containsKey('deductTime')) or (colPickMode==1 and !data.containsKey('deductTime'))">
                a.deductTime=#{data.deductTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('subAddType')) or (colPickMode==1 and !data.containsKey('subAddType'))">
                a.subAddType=#{data.subAddType},
            </if>
            <if test="(colPickMode==0 and data.containsKey('subAddTypeIncrement')) or (colPickMode==1 and !data.containsKey('subAddTypeIncrement'))">
                a.subAddType=ifnull(a.subAddType,0) + #{data.subAddTypeIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('score')) or (colPickMode==1 and !data.containsKey('score'))">
                a.score=#{data.score},
            </if>
            <if test="(colPickMode==0 and data.containsKey('scoreIncrement')) or (colPickMode==1 and !data.containsKey('scoreIncrement'))">
                a.score=ifnull(a.score,0) + #{data.scoreIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('processStatus')) or (colPickMode==1 and !data.containsKey('processStatus'))">
                a.processStatus=#{data.processStatus},
            </if>
            <if test="(colPickMode==0 and data.containsKey('processStatusIncrement')) or (colPickMode==1 and !data.containsKey('processStatusIncrement'))">
                a.processStatus=ifnull(a.processStatus,0) + #{data.processStatusIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('fileNames')) or (colPickMode==1 and !data.containsKey('fileNames'))">
                a.fileNames=#{data.fileNames},
            </if>
            <if test="(colPickMode==0 and data.containsKey('filePaths')) or (colPickMode==1 and !data.containsKey('filePaths'))">
                a.filePaths=#{data.filePaths},
            </if>
            <if test="(colPickMode==0 and data.containsKey('remark')) or (colPickMode==1 and !data.containsKey('remark'))">
                a.remark=#{data.remark},
            </if>
            <if test="(colPickMode==0 and data.containsKey('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('salaId')) or (colPickMode==1 and !data.containsKey('salaId'))">
                a.salaId=#{data.salaId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('salaIdIncrement')) or (colPickMode==1 and !data.containsKey('salaIdIncrement'))">
                a.salaId=ifnull(a.salaId,0) + #{data.salaIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('salaName')) or (colPickMode==1 and !data.containsKey('salaName'))">
                a.salaName=#{data.salaName},
            </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_perform_error_record as a
        <trim prefix="set" suffixOverrides=",">
            <trim prefix="staffId=(case" suffix="ELSE staffId end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('staffId')) or (colPickMode==1 and !item.containsKey('staffId'))">
                            when a.id=#{item.id} then #{item.staffId}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('staffIdIncrement')) or (colPickMode==1 and !item.containsKey('staffIdIncrement'))">
                            when a.id=#{item.id} then ifnull(a.staffId,0) + #{item.staffIdIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="staffName=(case" suffix="ELSE staffName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('staffName')) or (colPickMode==1 and !item.containsKey('staffName'))">
                        when a.id=#{item.id} then #{item.staffName}
                    </if>
                </foreach>
            </trim>
            <trim prefix="workNum=(case" suffix="ELSE workNum end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('workNum')) or (colPickMode==1 and !item.containsKey('workNum'))">
                        when a.id=#{item.id} then #{item.workNum}
                    </if>
                </foreach>
            </trim>
            <trim prefix="windowNum=(case" suffix="ELSE windowNum end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('windowNum')) or (colPickMode==1 and !item.containsKey('windowNum'))">
                        when a.id=#{item.id} then #{item.windowNum}
                    </if>
                </foreach>
            </trim>
            <trim prefix="deptId=(case" suffix="ELSE deptId end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('deptId')) or (colPickMode==1 and !item.containsKey('deptId'))">
                            when a.id=#{item.id} then #{item.deptId}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('deptIdIncrement')) or (colPickMode==1 and !item.containsKey('deptIdIncrement'))">
                            when a.id=#{item.id} then ifnull(a.deptId,0) + #{item.deptIdIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="deptName=(case" suffix="ELSE deptName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('deptName')) or (colPickMode==1 and !item.containsKey('deptName'))">
                        when a.id=#{item.id} then #{item.deptName}
                    </if>
                </foreach>
            </trim>
            <trim prefix="irregularType=(case" suffix="ELSE irregularType end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('irregularType')) or (colPickMode==1 and !item.containsKey('irregularType'))">
                            when a.id=#{item.id} then #{item.irregularType}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('irregularTypeIncrement')) or (colPickMode==1 and !item.containsKey('irregularTypeIncrement'))">
                            when a.id=#{item.id} then ifnull(a.irregularType,0) + #{item.irregularTypeIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="happenTime=(case" suffix="ELSE happenTime end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('happenTime')) or (colPickMode==1 and !item.containsKey('happenTime'))">
                        when a.id=#{item.id} then #{item.happenTime}
                    </if>
                </foreach>
            </trim>
            <trim prefix="duration=(case" suffix="ELSE duration end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('duration')) or (colPickMode==1 and !item.containsKey('duration'))">
                            when a.id=#{item.id} then #{item.duration}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('durationIncrement')) or (colPickMode==1 and !item.containsKey('durationIncrement'))">
                            when a.id=#{item.id} then ifnull(a.duration,0) + #{item.durationIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="alarmTime=(case" suffix="ELSE alarmTime end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('alarmTime')) or (colPickMode==1 and !item.containsKey('alarmTime'))">
                        when a.id=#{item.id} then #{item.alarmTime}
                    </if>
                </foreach>
            </trim>
            <trim prefix="snapPath=(case" suffix="ELSE snapPath end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('snapPath')) or (colPickMode==1 and !item.containsKey('snapPath'))">
                        when a.id=#{item.id} then #{item.snapPath}
                    </if>
                </foreach>
            </trim>
            <trim prefix="categoryId=(case" suffix="ELSE categoryId end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('categoryId')) or (colPickMode==1 and !item.containsKey('categoryId'))">
                            when a.id=#{item.id} then #{item.categoryId}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('categoryIdIncrement')) or (colPickMode==1 and !item.containsKey('categoryIdIncrement'))">
                            when a.id=#{item.id} then ifnull(a.categoryId,0) + #{item.categoryIdIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="categoryName=(case" suffix="ELSE categoryName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('categoryName')) or (colPickMode==1 and !item.containsKey('categoryName'))">
                        when a.id=#{item.id} then #{item.categoryName}
                    </if>
                </foreach>
            </trim>
            <trim prefix="ruleId=(case" suffix="ELSE ruleId end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('ruleId')) or (colPickMode==1 and !item.containsKey('ruleId'))">
                            when a.id=#{item.id} then #{item.ruleId}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('ruleIdIncrement')) or (colPickMode==1 and !item.containsKey('ruleIdIncrement'))">
                            when a.id=#{item.id} then ifnull(a.ruleId,0) + #{item.ruleIdIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="ruleName=(case" suffix="ELSE ruleName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('ruleName')) or (colPickMode==1 and !item.containsKey('ruleName'))">
                        when a.id=#{item.id} then #{item.ruleName}
                    </if>
                </foreach>
            </trim>
            <trim prefix="subMethod=(case" suffix="ELSE subMethod end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('subMethod')) or (colPickMode==1 and !item.containsKey('subMethod'))">
                            when a.id=#{item.id} then #{item.subMethod}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('subMethodIncrement')) or (colPickMode==1 and !item.containsKey('subMethodIncrement'))">
                            when a.id=#{item.id} then ifnull(a.subMethod,0) + #{item.subMethodIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="deductPerson=(case" suffix="ELSE deductPerson end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('deductPerson')) or (colPickMode==1 and !item.containsKey('deductPerson'))">
                        when a.id=#{item.id} then #{item.deductPerson}
                    </if>
                </foreach>
            </trim>
            <trim prefix="deductTime=(case" suffix="ELSE deductTime end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('deductTime')) or (colPickMode==1 and !item.containsKey('deductTime'))">
                        when a.id=#{item.id} then #{item.deductTime}
                    </if>
                </foreach>
            </trim>
            <trim prefix="subAddType=(case" suffix="ELSE subAddType end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('subAddType')) or (colPickMode==1 and !item.containsKey('subAddType'))">
                            when a.id=#{item.id} then #{item.subAddType}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('subAddTypeIncrement')) or (colPickMode==1 and !item.containsKey('subAddTypeIncrement'))">
                            when a.id=#{item.id} then ifnull(a.subAddType,0) + #{item.subAddTypeIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="score=(case" suffix="ELSE score end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('score')) or (colPickMode==1 and !item.containsKey('score'))">
                            when a.id=#{item.id} then #{item.score}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('scoreIncrement')) or (colPickMode==1 and !item.containsKey('scoreIncrement'))">
                            when a.id=#{item.id} then ifnull(a.score,0) + #{item.scoreIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="processStatus=(case" suffix="ELSE processStatus end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('processStatus')) or (colPickMode==1 and !item.containsKey('processStatus'))">
                            when a.id=#{item.id} then #{item.processStatus}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('processStatusIncrement')) or (colPickMode==1 and !item.containsKey('processStatusIncrement'))">
                            when a.id=#{item.id} then ifnull(a.processStatus,0) + #{item.processStatusIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="fileNames=(case" suffix="ELSE fileNames end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('fileNames')) or (colPickMode==1 and !item.containsKey('fileNames'))">
                        when a.id=#{item.id} then #{item.fileNames}
                    </if>
                </foreach>
            </trim>
            <trim prefix="filePaths=(case" suffix="ELSE filePaths end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('filePaths')) or (colPickMode==1 and !item.containsKey('filePaths'))">
                        when a.id=#{item.id} then #{item.filePaths}
                    </if>
                </foreach>
            </trim>
            <trim prefix="remark=(case" suffix="ELSE remark end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('remark')) or (colPickMode==1 and !item.containsKey('remark'))">
                        when a.id=#{item.id} then #{item.remark}
                    </if>
                </foreach>
            </trim>
            <trim prefix="createUserId=(case" suffix="ELSE createUserId end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('createUserId')) or (colPickMode==1 and !item.containsKey('createUserId'))">
                            when a.id=#{item.id} then #{item.createUserId}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('createUserIdIncrement')) or (colPickMode==1 and !item.containsKey('createUserIdIncrement'))">
                            when a.id=#{item.id} then ifnull(a.createUserId,0) + #{item.createUserIdIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="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="salaId=(case" suffix="ELSE salaId end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('salaId')) or (colPickMode==1 and !item.containsKey('salaId'))">
                            when a.id=#{item.id} then #{item.salaId}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('salaIdIncrement')) or (colPickMode==1 and !item.containsKey('salaIdIncrement'))">
                            when a.id=#{item.id} then ifnull(a.salaId,0) + #{item.salaIdIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="salaName=(case" suffix="ELSE salaName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('salaName')) or (colPickMode==1 and !item.containsKey('salaName'))">
                        when a.id=#{item.id} then #{item.salaName}
                    </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="PerformErrorRecordEntity-Map">
        select <include refid="_columns"/>
        from mortals_xhx_perform_error_record as a
        where a.id=#{condition.id}
    </select>
    <!-- 根据主健删除 -->
    <delete id="deleteByKey" parameterType="paramDto">
        delete a.* from mortals_xhx_perform_error_record as a where a.id=#{condition.id}
    </delete>
    <!-- 根据主健删除一批，针对单一主健有效 -->
    <delete id="deleteByKeys">
        delete from mortals_xhx_perform_error_record where id in
        <foreach collection="array" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>
    <!-- 根据主健列表删除一批，针对单一主健有效 -->
    <delete id="deleteByKeyList">
        delete from mortals_xhx_perform_error_record where id in
        <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>

    <!-- 根据对象列表删除一批，针对单一主健有效 -->
    <delete id="deleteByEntityList">
        delete from mortals_xhx_perform_error_record 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_perform_error_record as a
        <trim suffixOverrides="where" suffix="">
            where
            <trim prefixOverrides="and" prefix="">
                <include refid="_condition_"/>
            </trim>
        </trim>
    </delete>
    <!-- 获取列表 -->
    <select id="getList" parameterType="paramDto" resultMap="PerformErrorRecordEntity-Map">
        select <include refid="_columns"/>
        from mortals_xhx_perform_error_record 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_perform_error_record as a
        <trim suffixOverrides="where" suffix="">
            where
            <trim prefixOverrides="and" prefix="">
                <include refid="_condition_"/>
            </trim>
        </trim>
    </select>
    <!-- 条件映射 -->
    <sql id="_condition_">
        <if test="condition != null and !condition.isEmpty()">
            <!-- 条件映射-普通条件 -->
            <include refid="_condition_param_">
                <property name="_conditionParam_" value="condition"/>
                <property name="_conditionType_" value="and"/>
            </include>
            <!-- 条件映射-集合之间使用AND，集合中元素使用OR-(list[0].1 or list[0].2) and (list[1].3 or list[1].4) -->
            <if test="condition.containsKey('andConditionList') and !condition.andConditionList.isEmpty()">
                and
                <foreach collection="condition.andConditionList" open="(" close=")" index="index" item="andCondition" separator=" and ">
                    <trim prefixOverrides="or" prefix="(" suffix=")">
                        <include refid="_condition_param_">
                            <property name="_conditionParam_" value="andCondition"/>
                            <property name="_conditionType_" value="or"/>
                        </include>
                    </trim>
                </foreach>
            </if>
            <!-- 条件映射-集合之间使用OR，集合中元素使用AND-(list[0].1 and list[0].2) or (list[1].3 and list[1].4) -->
            <if test="condition.containsKey('orConditionList') and !condition.orConditionList.isEmpty()">
                and
                <foreach collection="condition.orConditionList" open="(" close=")" index="index" item="orCondition" separator=" or ">
                    <trim prefixOverrides="and" prefix="(" suffix=")">
                        <include refid="_condition_param_">
                            <property name="_conditionParam_" value="orCondition"/>
                            <property name="_conditionType_" value="and"/>
                        </include>
                    </trim>
                </foreach>
            </if>
        </if>
    </sql>
    <!-- 条件映射-代参数 -->
    <sql id="_condition_param_">
        <bind name="conditionParamRef" value="${_conditionParam_}"/>
        <if test="conditionParamRef.containsKey('id')">
            <if test="conditionParamRef.id != null">
                ${_conditionType_} a.id=#{${_conditionParam_}.id}
            </if>
        </if>
        <if test="conditionParamRef.containsKey('id')">
            <if test="conditionParamRef.id != null ">
                ${_conditionType_} a.id = #{${_conditionParam_}.id}
            </if>
            <if test="conditionParamRef.id == null">
                ${_conditionType_} a.id is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
            ${_conditionType_} a.id in
            <foreach collection="conditionParamRef.idList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('idNotList') and conditionParamRef.idNotList.size() > 0">
            ${_conditionType_} a.id not in
            <foreach collection="conditionParamRef.idNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null">
            ${_conditionType_} a.id <![CDATA[ >= ]]> #{${_conditionParam_}.idStart}
        </if>
        <if test="conditionParamRef.containsKey('idEnd') and conditionParamRef.idEnd != null">
            ${_conditionType_} a.id <![CDATA[ <= ]]> #{${_conditionParam_}.idEnd}
        </if>

        <if test="conditionParamRef.containsKey('staffId')">
            <if test="conditionParamRef.staffId != null ">
                ${_conditionType_} a.staffId = #{${_conditionParam_}.staffId}
            </if>
            <if test="conditionParamRef.staffId == null">
                ${_conditionType_} a.staffId is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('staffIdList') and conditionParamRef.staffIdList.size() > 0">
            ${_conditionType_} a.staffId in
            <foreach collection="conditionParamRef.staffIdList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('staffIdNotList') and conditionParamRef.staffIdNotList.size() > 0">
            ${_conditionType_} a.staffId not in
            <foreach collection="conditionParamRef.staffIdNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('staffIdStart') and conditionParamRef.staffIdStart != null">
            ${_conditionType_} a.staffId <![CDATA[ >= ]]> #{${_conditionParam_}.staffIdStart}
        </if>
        <if test="conditionParamRef.containsKey('staffIdEnd') and conditionParamRef.staffIdEnd != null">
            ${_conditionType_} a.staffId <![CDATA[ <= ]]> #{${_conditionParam_}.staffIdEnd}
        </if>


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

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

        <if test="conditionParamRef.containsKey('windowNum')">
            <if test="conditionParamRef.windowNum != null and conditionParamRef.windowNum != ''">
                ${_conditionType_} a.windowNum like #{${_conditionParam_}.windowNum}
            </if>
            <if test="conditionParamRef.windowNum == null">
                ${_conditionType_} a.windowNum is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('windowNumList') and conditionParamRef.windowNumList.size() > 0">
            ${_conditionType_} a.windowNum in
            <foreach collection="conditionParamRef.windowNumList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('windowNumNotList') and conditionParamRef.windowNumNotList.size() > 0">
            ${_conditionType_} a.windowNum not in
            <foreach collection="conditionParamRef.windowNumNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deptId')">
            <if test="conditionParamRef.deptId != null ">
                ${_conditionType_} a.deptId = #{${_conditionParam_}.deptId}
            </if>
            <if test="conditionParamRef.deptId == null">
                ${_conditionType_} a.deptId is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
            ${_conditionType_} a.deptId in
            <foreach collection="conditionParamRef.deptIdList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deptIdNotList') and conditionParamRef.deptIdNotList.size() > 0">
            ${_conditionType_} a.deptId not in
            <foreach collection="conditionParamRef.deptIdNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deptIdStart') and conditionParamRef.deptIdStart != null">
            ${_conditionType_} a.deptId <![CDATA[ >= ]]> #{${_conditionParam_}.deptIdStart}
        </if>
        <if test="conditionParamRef.containsKey('deptIdEnd') and conditionParamRef.deptIdEnd != null">
            ${_conditionType_} a.deptId <![CDATA[ <= ]]> #{${_conditionParam_}.deptIdEnd}
        </if>


        <if test="conditionParamRef.containsKey('deptName')">
            <if test="conditionParamRef.deptName != null and conditionParamRef.deptName != ''">
                ${_conditionType_} a.deptName like #{${_conditionParam_}.deptName}
            </if>
            <if test="conditionParamRef.deptName == null">
                ${_conditionType_} a.deptName is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('deptNameList') and conditionParamRef.deptNameList.size() > 0">
            ${_conditionType_} a.deptName in
            <foreach collection="conditionParamRef.deptNameList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('deptNameNotList') and conditionParamRef.deptNameNotList.size() > 0">
            ${_conditionType_} a.deptName not in
            <foreach collection="conditionParamRef.deptNameNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('irregularType')">
            <if test="conditionParamRef.irregularType != null ">
                ${_conditionType_} a.irregularType = #{${_conditionParam_}.irregularType}
            </if>
            <if test="conditionParamRef.irregularType == null">
                ${_conditionType_} a.irregularType is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('irregularTypeList') and conditionParamRef.irregularTypeList.size() > 0">
            ${_conditionType_} a.irregularType in
            <foreach collection="conditionParamRef.irregularTypeList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('irregularTypeNotList') and conditionParamRef.irregularTypeNotList.size() > 0">
            ${_conditionType_} a.irregularType not in
            <foreach collection="conditionParamRef.irregularTypeNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('irregularTypeStart') and conditionParamRef.irregularTypeStart != null">
            ${_conditionType_} a.irregularType <![CDATA[ >= ]]> #{${_conditionParam_}.irregularTypeStart}
        </if>
        <if test="conditionParamRef.containsKey('irregularTypeEnd') and conditionParamRef.irregularTypeEnd != null">
            ${_conditionType_} a.irregularType <![CDATA[ <= ]]> #{${_conditionParam_}.irregularTypeEnd}
        </if>


        <if test="conditionParamRef.containsKey('happenTime')">
            <if test="conditionParamRef.happenTime != null ">
                ${_conditionType_} a.happenTime = #{${_conditionParam_}.happenTime}
            </if>
            <if test="conditionParamRef.happenTime == null">
                ${_conditionType_} a.happenTime is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('happenTimeStart') and conditionParamRef.happenTimeStart != null and conditionParamRef.happenTimeStart!=''">
            ${_conditionType_} a.happenTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.happenTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
        </if>
        <if test="conditionParamRef.containsKey('happenTimeEnd') and conditionParamRef.happenTimeEnd != null and conditionParamRef.happenTimeEnd!=''">
            ${_conditionType_} a.happenTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.happenTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
        </if>
        <if test="conditionParamRef.containsKey('duration')">
            <if test="conditionParamRef.duration != null ">
                ${_conditionType_} a.duration = #{${_conditionParam_}.duration}
            </if>
            <if test="conditionParamRef.duration == null">
                ${_conditionType_} a.duration is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('durationList') and conditionParamRef.durationList.size() > 0">
            ${_conditionType_} a.duration in
            <foreach collection="conditionParamRef.durationList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('durationNotList') and conditionParamRef.durationNotList.size() > 0">
            ${_conditionType_} a.duration not in
            <foreach collection="conditionParamRef.durationNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('durationStart') and conditionParamRef.durationStart != null">
            ${_conditionType_} a.duration <![CDATA[ >= ]]> #{${_conditionParam_}.durationStart}
        </if>
        <if test="conditionParamRef.containsKey('durationEnd') and conditionParamRef.durationEnd != null">
            ${_conditionType_} a.duration <![CDATA[ <= ]]> #{${_conditionParam_}.durationEnd}
        </if>


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

        <if test="conditionParamRef.containsKey('snapPath')">
            <if test="conditionParamRef.snapPath != null and conditionParamRef.snapPath != ''">
                ${_conditionType_} a.snapPath like #{${_conditionParam_}.snapPath}
            </if>
            <if test="conditionParamRef.snapPath == null">
                ${_conditionType_} a.snapPath is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('snapPathList') and conditionParamRef.snapPathList.size() > 0">
            ${_conditionType_} a.snapPath in
            <foreach collection="conditionParamRef.snapPathList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('snapPathNotList') and conditionParamRef.snapPathNotList.size() > 0">
            ${_conditionType_} a.snapPath not in
            <foreach collection="conditionParamRef.snapPathNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('categoryId')">
            <if test="conditionParamRef.categoryId != null ">
                ${_conditionType_} a.categoryId = #{${_conditionParam_}.categoryId}
            </if>
            <if test="conditionParamRef.categoryId == null">
                ${_conditionType_} a.categoryId is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('categoryIdList') and conditionParamRef.categoryIdList.size() > 0">
            ${_conditionType_} a.categoryId in
            <foreach collection="conditionParamRef.categoryIdList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('categoryIdNotList') and conditionParamRef.categoryIdNotList.size() > 0">
            ${_conditionType_} a.categoryId not in
            <foreach collection="conditionParamRef.categoryIdNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('categoryIdStart') and conditionParamRef.categoryIdStart != null">
            ${_conditionType_} a.categoryId <![CDATA[ >= ]]> #{${_conditionParam_}.categoryIdStart}
        </if>
        <if test="conditionParamRef.containsKey('categoryIdEnd') and conditionParamRef.categoryIdEnd != null">
            ${_conditionType_} a.categoryId <![CDATA[ <= ]]> #{${_conditionParam_}.categoryIdEnd}
        </if>


        <if test="conditionParamRef.containsKey('categoryName')">
            <if test="conditionParamRef.categoryName != null and conditionParamRef.categoryName != ''">
                ${_conditionType_} a.categoryName like #{${_conditionParam_}.categoryName}
            </if>
            <if test="conditionParamRef.categoryName == null">
                ${_conditionType_} a.categoryName is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('categoryNameList') and conditionParamRef.categoryNameList.size() > 0">
            ${_conditionType_} a.categoryName in
            <foreach collection="conditionParamRef.categoryNameList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('categoryNameNotList') and conditionParamRef.categoryNameNotList.size() > 0">
            ${_conditionType_} a.categoryName not in
            <foreach collection="conditionParamRef.categoryNameNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('ruleId')">
            <if test="conditionParamRef.ruleId != null ">
                ${_conditionType_} a.ruleId = #{${_conditionParam_}.ruleId}
            </if>
            <if test="conditionParamRef.ruleId == null">
                ${_conditionType_} a.ruleId is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('ruleIdList') and conditionParamRef.ruleIdList.size() > 0">
            ${_conditionType_} a.ruleId in
            <foreach collection="conditionParamRef.ruleIdList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('ruleIdNotList') and conditionParamRef.ruleIdNotList.size() > 0">
            ${_conditionType_} a.ruleId not in
            <foreach collection="conditionParamRef.ruleIdNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('ruleIdStart') and conditionParamRef.ruleIdStart != null">
            ${_conditionType_} a.ruleId <![CDATA[ >= ]]> #{${_conditionParam_}.ruleIdStart}
        </if>
        <if test="conditionParamRef.containsKey('ruleIdEnd') and conditionParamRef.ruleIdEnd != null">
            ${_conditionType_} a.ruleId <![CDATA[ <= ]]> #{${_conditionParam_}.ruleIdEnd}
        </if>


        <if test="conditionParamRef.containsKey('ruleName')">
            <if test="conditionParamRef.ruleName != null and conditionParamRef.ruleName != ''">
                ${_conditionType_} a.ruleName like #{${_conditionParam_}.ruleName}
            </if>
            <if test="conditionParamRef.ruleName == null">
                ${_conditionType_} a.ruleName is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('ruleNameList') and conditionParamRef.ruleNameList.size() > 0">
            ${_conditionType_} a.ruleName in
            <foreach collection="conditionParamRef.ruleNameList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('ruleNameNotList') and conditionParamRef.ruleNameNotList.size() > 0">
            ${_conditionType_} a.ruleName not in
            <foreach collection="conditionParamRef.ruleNameNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('subMethod')">
            <if test="conditionParamRef.subMethod != null ">
                ${_conditionType_} a.subMethod = #{${_conditionParam_}.subMethod}
            </if>
            <if test="conditionParamRef.subMethod == null">
                ${_conditionType_} a.subMethod is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('subMethodList') and conditionParamRef.subMethodList.size() > 0">
            ${_conditionType_} a.subMethod in
            <foreach collection="conditionParamRef.subMethodList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('subMethodNotList') and conditionParamRef.subMethodNotList.size() > 0">
            ${_conditionType_} a.subMethod not in
            <foreach collection="conditionParamRef.subMethodNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('subMethodStart') and conditionParamRef.subMethodStart != null">
            ${_conditionType_} a.subMethod <![CDATA[ >= ]]> #{${_conditionParam_}.subMethodStart}
        </if>
        <if test="conditionParamRef.containsKey('subMethodEnd') and conditionParamRef.subMethodEnd != null">
            ${_conditionType_} a.subMethod <![CDATA[ <= ]]> #{${_conditionParam_}.subMethodEnd}
        </if>


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

        <if test="conditionParamRef.containsKey('deductTime')">
            <if test="conditionParamRef.deductTime != null ">
                ${_conditionType_} a.deductTime = #{${_conditionParam_}.deductTime}
            </if>
            <if test="conditionParamRef.deductTime == null">
                ${_conditionType_} a.deductTime is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('deductTimeStart') and conditionParamRef.deductTimeStart != null and conditionParamRef.deductTimeStart!=''">
            ${_conditionType_} a.deductTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.deductTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
        </if>
        <if test="conditionParamRef.containsKey('deductTimeEnd') and conditionParamRef.deductTimeEnd != null and conditionParamRef.deductTimeEnd!=''">
            ${_conditionType_} a.deductTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.deductTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
        </if>
        <if test="conditionParamRef.containsKey('subAddType')">
            <if test="conditionParamRef.subAddType != null ">
                ${_conditionType_} a.subAddType = #{${_conditionParam_}.subAddType}
            </if>
            <if test="conditionParamRef.subAddType == null">
                ${_conditionType_} a.subAddType is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('subAddTypeList') and conditionParamRef.subAddTypeList.size() > 0">
            ${_conditionType_} a.subAddType in
            <foreach collection="conditionParamRef.subAddTypeList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('subAddTypeNotList') and conditionParamRef.subAddTypeNotList.size() > 0">
            ${_conditionType_} a.subAddType not in
            <foreach collection="conditionParamRef.subAddTypeNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('subAddTypeStart') and conditionParamRef.subAddTypeStart != null">
            ${_conditionType_} a.subAddType <![CDATA[ >= ]]> #{${_conditionParam_}.subAddTypeStart}
        </if>
        <if test="conditionParamRef.containsKey('subAddTypeEnd') and conditionParamRef.subAddTypeEnd != null">
            ${_conditionType_} a.subAddType <![CDATA[ <= ]]> #{${_conditionParam_}.subAddTypeEnd}
        </if>

        <if test="conditionParamRef.containsKey('score')">
            <if test="conditionParamRef.score != null ">
                ${_conditionType_} a.score = #{${_conditionParam_}.score}
            </if>
            <if test="conditionParamRef.score == null">
                ${_conditionType_} a.score is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('scoreList') and conditionParamRef.scoreList.size() > 0">
            ${_conditionType_} a.score in
            <foreach collection="conditionParamRef.scoreList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('scoreNotList') and conditionParamRef.scoreNotList.size() > 0">
            ${_conditionType_} a.score not in
            <foreach collection="conditionParamRef.scoreNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('scoreStart') and conditionParamRef.scoreStart != null">
            ${_conditionType_} a.score <![CDATA[ >= ]]> #{${_conditionParam_}.scoreStart}
        </if>
        <if test="conditionParamRef.containsKey('scoreEnd') and conditionParamRef.scoreEnd != null">
            ${_conditionType_} a.score <![CDATA[ <= ]]> #{${_conditionParam_}.scoreEnd}
        </if>

        <if test="conditionParamRef.containsKey('processStatus')">
            <if test="conditionParamRef.processStatus != null ">
                ${_conditionType_} a.processStatus = #{${_conditionParam_}.processStatus}
            </if>
            <if test="conditionParamRef.processStatus == null">
                ${_conditionType_} a.processStatus is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('processStatusList') and conditionParamRef.processStatusList.size() > 0">
            ${_conditionType_} a.processStatus in
            <foreach collection="conditionParamRef.processStatusList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('processStatusNotList') and conditionParamRef.processStatusNotList.size() > 0">
            ${_conditionType_} a.processStatus not in
            <foreach collection="conditionParamRef.processStatusNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('processStatusStart') and conditionParamRef.processStatusStart != null">
            ${_conditionType_} a.processStatus <![CDATA[ >= ]]> #{${_conditionParam_}.processStatusStart}
        </if>
        <if test="conditionParamRef.containsKey('processStatusEnd') and conditionParamRef.processStatusEnd != null">
            ${_conditionType_} a.processStatus <![CDATA[ <= ]]> #{${_conditionParam_}.processStatusEnd}
        </if>


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

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

        <if test="conditionParamRef.containsKey('remark')">
            <if test="conditionParamRef.remark != null and conditionParamRef.remark != ''">
                ${_conditionType_} a.remark like #{${_conditionParam_}.remark}
            </if>
            <if test="conditionParamRef.remark == null">
                ${_conditionType_} a.remark is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('remarkList') and conditionParamRef.remarkList.size() > 0">
            ${_conditionType_} a.remark in
            <foreach collection="conditionParamRef.remarkList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('remarkNotList') and conditionParamRef.remarkNotList.size() > 0">
            ${_conditionType_} a.remark not in
            <foreach collection="conditionParamRef.remarkNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </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('salaId')">
            <if test="conditionParamRef.salaId != null ">
                ${_conditionType_} a.salaId = #{${_conditionParam_}.salaId}
            </if>
            <if test="conditionParamRef.salaId == null">
                ${_conditionType_} a.salaId is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('salaIdList') and conditionParamRef.salaIdList.size() > 0">
            ${_conditionType_} a.salaId in
            <foreach collection="conditionParamRef.salaIdList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('salaIdNotList') and conditionParamRef.salaIdNotList.size() > 0">
            ${_conditionType_} a.salaId not in
            <foreach collection="conditionParamRef.salaIdNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('salaIdStart') and conditionParamRef.salaIdStart != null">
            ${_conditionType_} a.salaId <![CDATA[ >= ]]> #{${_conditionParam_}.salaIdStart}
        </if>
        <if test="conditionParamRef.containsKey('salaIdEnd') and conditionParamRef.salaIdEnd != null">
            ${_conditionType_} a.salaId <![CDATA[ <= ]]> #{${_conditionParam_}.salaIdEnd}
        </if>


        <if test="conditionParamRef.containsKey('salaName')">
            <if test="conditionParamRef.salaName != null and conditionParamRef.salaName != ''">
                ${_conditionType_} a.salaName like #{${_conditionParam_}.salaName}
            </if>
            <if test="conditionParamRef.salaName == null">
                ${_conditionType_} a.salaName is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('salaNameList') and conditionParamRef.salaNameList.size() > 0">
            ${_conditionType_} a.salaName in
            <foreach collection="conditionParamRef.salaNameList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('salaNameNotList') and conditionParamRef.salaNameNotList.size() > 0">
            ${_conditionType_} a.salaName not in
            <foreach collection="conditionParamRef.salaNameNotList" 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('staffIdList') and conditionParamRef.staffIdList.size() > 0">
                field(a.staffId,
                <foreach collection="conditionParamRef.staffIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
                field(a.deptId,
                <foreach collection="conditionParamRef.deptIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('irregularTypeList') and conditionParamRef.irregularTypeList.size() > 0">
                field(a.irregularType,
                <foreach collection="conditionParamRef.irregularTypeList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('durationList') and conditionParamRef.durationList.size() > 0">
                field(a.duration,
                <foreach collection="conditionParamRef.durationList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('categoryIdList') and conditionParamRef.categoryIdList.size() > 0">
                field(a.categoryId,
                <foreach collection="conditionParamRef.categoryIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('ruleIdList') and conditionParamRef.ruleIdList.size() > 0">
                field(a.ruleId,
                <foreach collection="conditionParamRef.ruleIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('subMethodList') and conditionParamRef.subMethodList.size() > 0">
                field(a.subMethod,
                <foreach collection="conditionParamRef.subMethodList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('subAddTypeList') and conditionParamRef.subAddTypeList.size() > 0">
                field(a.subAddType,
                <foreach collection="conditionParamRef.subAddTypeList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('scoreList') and conditionParamRef.scoreList.size() > 0">
                field(a.score,
                <foreach collection="conditionParamRef.scoreList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('processStatusList') and conditionParamRef.processStatusList.size() > 0">
                field(a.processStatus,
                <foreach collection="conditionParamRef.processStatusList" 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('salaIdList') and conditionParamRef.salaIdList.size() > 0">
                field(a.salaId,
                <foreach collection="conditionParamRef.salaIdList" 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('staffIdList') and conditionParamRef.staffIdList.size() > 0">
                field(a.staffId,
                <foreach collection="conditionParamRef.staffIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
                field(a.deptId,
                <foreach collection="conditionParamRef.deptIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('irregularTypeList') and conditionParamRef.irregularTypeList.size() > 0">
                field(a.irregularType,
                <foreach collection="conditionParamRef.irregularTypeList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('durationList') and conditionParamRef.durationList.size() > 0">
                field(a.duration,
                <foreach collection="conditionParamRef.durationList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('categoryIdList') and conditionParamRef.categoryIdList.size() > 0">
                field(a.categoryId,
                <foreach collection="conditionParamRef.categoryIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('ruleIdList') and conditionParamRef.ruleIdList.size() > 0">
                field(a.ruleId,
                <foreach collection="conditionParamRef.ruleIdList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('subMethodList') and conditionParamRef.subMethodList.size() > 0">
                field(a.subMethod,
                <foreach collection="conditionParamRef.subMethodList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('subAddTypeList') and conditionParamRef.subAddTypeList.size() > 0">
                field(a.subAddType,
                <foreach collection="conditionParamRef.subAddTypeList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('scoreList') and conditionParamRef.scoreList.size() > 0">
                field(a.score,
                <foreach collection="conditionParamRef.scoreList" open="" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
                ,
            </if>
            <if test="conditionParamRef.containsKey('processStatusList') and conditionParamRef.processStatusList.size() > 0">
                field(a.processStatus,
                <foreach collection="conditionParamRef.processStatusList" 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('salaIdList') and conditionParamRef.salaIdList.size() > 0">
                field(a.salaId,
                <foreach collection="conditionParamRef.salaIdList" 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('staffId')">
                    a.staffId
                    <if test='orderCol.staffId != null and "DESC".equalsIgnoreCase(orderCol.staffId)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('staffName')">
                    a.staffName
                    <if test='orderCol.staffName != null and "DESC".equalsIgnoreCase(orderCol.staffName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('workNum')">
                    a.workNum
                    <if test='orderCol.workNum != null and "DESC".equalsIgnoreCase(orderCol.workNum)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('windowNum')">
                    a.windowNum
                    <if test='orderCol.windowNum != null and "DESC".equalsIgnoreCase(orderCol.windowNum)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deptId')">
                    a.deptId
                    <if test='orderCol.deptId != null and "DESC".equalsIgnoreCase(orderCol.deptId)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deptName')">
                    a.deptName
                    <if test='orderCol.deptName != null and "DESC".equalsIgnoreCase(orderCol.deptName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('irregularType')">
                    a.irregularType
                    <if test='orderCol.irregularType != null and "DESC".equalsIgnoreCase(orderCol.irregularType)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('happenTime')">
                    a.happenTime
                    <if test='orderCol.happenTime != null and "DESC".equalsIgnoreCase(orderCol.happenTime)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('duration')">
                    a.duration
                    <if test='orderCol.duration != null and "DESC".equalsIgnoreCase(orderCol.duration)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('alarmTime')">
                    a.alarmTime
                    <if test='orderCol.alarmTime != null and "DESC".equalsIgnoreCase(orderCol.alarmTime)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('snapPath')">
                    a.snapPath
                    <if test='orderCol.snapPath != null and "DESC".equalsIgnoreCase(orderCol.snapPath)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('categoryId')">
                    a.categoryId
                    <if test='orderCol.categoryId != null and "DESC".equalsIgnoreCase(orderCol.categoryId)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('categoryName')">
                    a.categoryName
                    <if test='orderCol.categoryName != null and "DESC".equalsIgnoreCase(orderCol.categoryName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('ruleId')">
                    a.ruleId
                    <if test='orderCol.ruleId != null and "DESC".equalsIgnoreCase(orderCol.ruleId)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('ruleName')">
                    a.ruleName
                    <if test='orderCol.ruleName != null and "DESC".equalsIgnoreCase(orderCol.ruleName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('subMethod')">
                    a.subMethod
                    <if test='orderCol.subMethod != null and "DESC".equalsIgnoreCase(orderCol.subMethod)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deductPerson')">
                    a.deductPerson
                    <if test='orderCol.deductPerson != null and "DESC".equalsIgnoreCase(orderCol.deductPerson)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('deductTime')">
                    a.deductTime
                    <if test='orderCol.deductTime != null and "DESC".equalsIgnoreCase(orderCol.deductTime)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('subAddType')">
                    a.subAddType
                    <if test='orderCol.subAddType != null and "DESC".equalsIgnoreCase(orderCol.subAddType)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('score')">
                    a.score
                    <if test='orderCol.score != null and "DESC".equalsIgnoreCase(orderCol.score)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('processStatus')">
                    a.processStatus
                    <if test='orderCol.processStatus != null and "DESC".equalsIgnoreCase(orderCol.processStatus)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('fileNames')">
                    a.fileNames
                    <if test='orderCol.fileNames != null and "DESC".equalsIgnoreCase(orderCol.fileNames)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('filePaths')">
                    a.filePaths
                    <if test='orderCol.filePaths != null and "DESC".equalsIgnoreCase(orderCol.filePaths)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('remark')">
                    a.remark
                    <if test='orderCol.remark != null and "DESC".equalsIgnoreCase(orderCol.remark)'>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('salaId')">
                    a.salaId
                    <if test='orderCol.salaId != null and "DESC".equalsIgnoreCase(orderCol.salaId)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('salaName')">
                    a.salaName
                    <if test='orderCol.salaName != null and "DESC".equalsIgnoreCase(orderCol.salaName)'>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>