<?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.check.dao.ibatis.CheckComplainRecordDaoImpl">

    <!-- 字段和属性映射 -->
    <resultMap type="CheckComplainRecordEntity" id="CheckComplainRecordEntity-Map">
        <id  property="id" column="id" />
        <result property="recordId" column="recordId" />
        <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="complainTitle" column="complainTitle" />
        <result property="complainContent" column="complainContent" />
        <result property="complainRealName" column="complainRealName" />
        <result property="contact" column="contact" />
        <result property="complainTime" column="complainTime" />
        <result property="complainSource" column="complainSource" />
        <result property="complainDevice" column="complainDevice" />
        <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="score" column="score" />
        <result property="checkPerson" column="checkPerson" />
        <result property="checkTime" column="checkTime" />
        <result property="checkDesc" column="checkDesc" />
        <result property="checkResult" column="checkResult" />
        <result property="checkStatus" column="checkStatus" />
        <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="fileNames" column="fileNames" />
        <result property="filePaths" column="filePaths" />
        <result property="categoryId" column="categoryId" />
        <result property="categoryName" column="categoryName" />
        <result property="subAddType" column="subAddType" />
        <result property="auditStatus" column="auditStatus" />

    </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('recordId') or colPickMode == 1 and data.containsKey('recordId')))">
                a.recordId,
            </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('complainTitle') or colPickMode == 1 and data.containsKey('complainTitle')))">
                a.complainTitle,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('complainContent') or colPickMode == 1 and data.containsKey('complainContent')))">
                a.complainContent,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('complainRealName') or colPickMode == 1 and data.containsKey('complainRealName')))">
                a.complainRealName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('contact') or colPickMode == 1 and data.containsKey('contact')))">
                a.contact,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('complainTime') or colPickMode == 1 and data.containsKey('complainTime')))">
                a.complainTime,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('complainSource') or colPickMode == 1 and data.containsKey('complainSource')))">
                a.complainSource,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('complainDevice') or colPickMode == 1 and data.containsKey('complainDevice')))">
                a.complainDevice,
            </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('score') or colPickMode == 1 and data.containsKey('score')))">
                a.score,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('checkPerson') or colPickMode == 1 and data.containsKey('checkPerson')))">
                a.checkPerson,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('checkTime') or colPickMode == 1 and data.containsKey('checkTime')))">
                a.checkTime,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('checkDesc') or colPickMode == 1 and data.containsKey('checkDesc')))">
                a.checkDesc,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('checkResult') or colPickMode == 1 and data.containsKey('checkResult')))">
                a.checkResult,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('checkStatus') or colPickMode == 1 and data.containsKey('checkStatus')))">
                a.checkStatus,
            </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('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('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('subAddType') or colPickMode == 1 and data.containsKey('subAddType')))">
                a.subAddType,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('auditStatus') or colPickMode == 1 and data.containsKey('auditStatus')))">
                a.auditStatus,
            </if>
        </trim>
    </sql>
    <!-- 新增 区分主键自增加还是业务插入 -->
    <insert id="insert" parameterType="CheckComplainRecordEntity"  useGeneratedKeys="true" keyProperty="id">
        insert into mortals_xhx_check_complain_record
        (recordId,staffId,staffName,workNum,windowNum,deptId,deptName,complainTitle,complainContent,complainRealName,contact,complainTime,complainSource,complainDevice,ruleId,ruleName,subMethod,deductPerson,deductTime,score,checkPerson,checkTime,checkDesc,checkResult,checkStatus,remark,createUserId,createTime,updateUserId,updateTime,fileNames,filePaths,categoryId,categoryName,subAddType,auditStatus)
        VALUES
        (#{recordId},#{staffId},#{staffName},#{workNum},#{windowNum},#{deptId},#{deptName},#{complainTitle},#{complainContent},#{complainRealName},#{contact},#{complainTime},#{complainSource},#{complainDevice},#{ruleId},#{ruleName},#{subMethod},#{deductPerson},#{deductTime},#{score},#{checkPerson},#{checkTime},#{checkDesc},#{checkResult},#{checkStatus},#{remark},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{fileNames},#{filePaths},#{categoryId},#{categoryName},#{subAddType},#{auditStatus})
    </insert>

    <!-- 批量新增 -->
    <insert id="insertBatch" parameterType="paramDto">
        insert into mortals_xhx_check_complain_record
        (recordId,staffId,staffName,workNum,windowNum,deptId,deptName,complainTitle,complainContent,complainRealName,contact,complainTime,complainSource,complainDevice,ruleId,ruleName,subMethod,deductPerson,deductTime,score,checkPerson,checkTime,checkDesc,checkResult,checkStatus,remark,createUserId,createTime,updateUserId,updateTime,fileNames,filePaths,categoryId,categoryName,subAddType,auditStatus)
        VALUES
        <foreach collection="data.dataList" item="item" index="index" separator="," >
            (#{item.recordId},#{item.staffId},#{item.staffName},#{item.workNum},#{item.windowNum},#{item.deptId},#{item.deptName},#{item.complainTitle},#{item.complainContent},#{item.complainRealName},#{item.contact},#{item.complainTime},#{item.complainSource},#{item.complainDevice},#{item.ruleId},#{item.ruleName},#{item.subMethod},#{item.deductPerson},#{item.deductTime},#{item.score},#{item.checkPerson},#{item.checkTime},#{item.checkDesc},#{item.checkResult},#{item.checkStatus},#{item.remark},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.fileNames},#{item.filePaths},#{item.categoryId},#{item.categoryName},#{item.subAddType},#{item.auditStatus})
        </foreach>
    </insert>


    <!-- 根据ParamDto更新 -->
    <update id="update" parameterType="paramDto">
        update mortals_xhx_check_complain_record as a
        set
        <trim suffixOverrides="," suffix="">
            <if test="(colPickMode==0 and data.containsKey('recordId')) or (colPickMode==1 and !data.containsKey('recordId'))">
                a.recordId=#{data.recordId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('recordIdIncrement')) or (colPickMode==1 and !data.containsKey('recordIdIncrement'))">
                a.recordId=ifnull(a.recordId,0) + #{data.recordIdIncrement},
            </if>
            <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('complainTitle')) or (colPickMode==1 and !data.containsKey('complainTitle'))">
                a.complainTitle=#{data.complainTitle},
            </if>
            <if test="(colPickMode==0 and data.containsKey('complainContent')) or (colPickMode==1 and !data.containsKey('complainContent'))">
                a.complainContent=#{data.complainContent},
            </if>
            <if test="(colPickMode==0 and data.containsKey('complainRealName')) or (colPickMode==1 and !data.containsKey('complainRealName'))">
                a.complainRealName=#{data.complainRealName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('contact')) or (colPickMode==1 and !data.containsKey('contact'))">
                a.contact=#{data.contact},
            </if>
            <if test="(colPickMode==0 and data.containsKey('complainTime')) or (colPickMode==1 and !data.containsKey('complainTime'))">
                a.complainTime=#{data.complainTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('complainSource')) or (colPickMode==1 and !data.containsKey('complainSource'))">
                a.complainSource=#{data.complainSource},
            </if>
            <if test="(colPickMode==0 and data.containsKey('complainDevice')) or (colPickMode==1 and !data.containsKey('complainDevice'))">
                a.complainDevice=#{data.complainDevice},
            </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('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('checkPerson')) or (colPickMode==1 and !data.containsKey('checkPerson'))">
                a.checkPerson=#{data.checkPerson},
            </if>
            <if test="(colPickMode==0 and data.containsKey('checkTime')) or (colPickMode==1 and !data.containsKey('checkTime'))">
                a.checkTime=#{data.checkTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('checkDesc')) or (colPickMode==1 and !data.containsKey('checkDesc'))">
                a.checkDesc=#{data.checkDesc},
            </if>
            <if test="(colPickMode==0 and data.containsKey('checkResult')) or (colPickMode==1 and !data.containsKey('checkResult'))">
                a.checkResult=#{data.checkResult},
            </if>
            <if test="(colPickMode==0 and data.containsKey('checkStatus')) or (colPickMode==1 and !data.containsKey('checkStatus'))">
                a.checkStatus=#{data.checkStatus},
            </if>
            <if test="(colPickMode==0 and data.containsKey('checkStatusIncrement')) or (colPickMode==1 and !data.containsKey('checkStatusIncrement'))">
                a.checkStatus=ifnull(a.checkStatus,0) + #{data.checkStatusIncrement},
            </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('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('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('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('auditStatus')) or (colPickMode==1 and !data.containsKey('auditStatus'))">
                a.auditStatus=#{data.auditStatus},
            </if>
            <if test="(colPickMode==0 and data.containsKey('auditStatusIncrement')) or (colPickMode==1 and !data.containsKey('auditStatusIncrement'))">
                a.auditStatus=ifnull(a.auditStatus,0) + #{data.auditStatusIncrement},
            </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_check_complain_record as a
        <trim prefix="set" suffixOverrides=",">
            <trim prefix="recordId=(case" suffix="ELSE recordId end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('recordId')) or (colPickMode==1 and !item.containsKey('recordId'))">
                            when a.id=#{item.id} then #{item.recordId}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('recordIdIncrement')) or (colPickMode==1 and !item.containsKey('recordIdIncrement'))">
                            when a.id=#{item.id} then ifnull(a.recordId,0) + #{item.recordIdIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <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="complainTitle=(case" suffix="ELSE complainTitle end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('complainTitle')) or (colPickMode==1 and !item.containsKey('complainTitle'))">
                        when a.id=#{item.id} then #{item.complainTitle}
                    </if>
                </foreach>
            </trim>
            <trim prefix="complainContent=(case" suffix="ELSE complainContent end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('complainContent')) or (colPickMode==1 and !item.containsKey('complainContent'))">
                        when a.id=#{item.id} then #{item.complainContent}
                    </if>
                </foreach>
            </trim>
            <trim prefix="complainRealName=(case" suffix="ELSE complainRealName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('complainRealName')) or (colPickMode==1 and !item.containsKey('complainRealName'))">
                        when a.id=#{item.id} then #{item.complainRealName}
                    </if>
                </foreach>
            </trim>
            <trim prefix="contact=(case" suffix="ELSE contact end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('contact')) or (colPickMode==1 and !item.containsKey('contact'))">
                        when a.id=#{item.id} then #{item.contact}
                    </if>
                </foreach>
            </trim>
            <trim prefix="complainTime=(case" suffix="ELSE complainTime end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('complainTime')) or (colPickMode==1 and !item.containsKey('complainTime'))">
                        when a.id=#{item.id} then #{item.complainTime}
                    </if>
                </foreach>
            </trim>
            <trim prefix="complainSource=(case" suffix="ELSE complainSource end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('complainSource')) or (colPickMode==1 and !item.containsKey('complainSource'))">
                        when a.id=#{item.id} then #{item.complainSource}
                    </if>
                </foreach>
            </trim>
            <trim prefix="complainDevice=(case" suffix="ELSE complainDevice end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('complainDevice')) or (colPickMode==1 and !item.containsKey('complainDevice'))">
                        when a.id=#{item.id} then #{item.complainDevice}
                    </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="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="checkPerson=(case" suffix="ELSE checkPerson end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('checkPerson')) or (colPickMode==1 and !item.containsKey('checkPerson'))">
                        when a.id=#{item.id} then #{item.checkPerson}
                    </if>
                </foreach>
            </trim>
            <trim prefix="checkTime=(case" suffix="ELSE checkTime end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('checkTime')) or (colPickMode==1 and !item.containsKey('checkTime'))">
                        when a.id=#{item.id} then #{item.checkTime}
                    </if>
                </foreach>
            </trim>
            <trim prefix="checkDesc=(case" suffix="ELSE checkDesc end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('checkDesc')) or (colPickMode==1 and !item.containsKey('checkDesc'))">
                        when a.id=#{item.id} then #{item.checkDesc}
                    </if>
                </foreach>
            </trim>
            <trim prefix="checkResult=(case" suffix="ELSE checkResult end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('checkResult')) or (colPickMode==1 and !item.containsKey('checkResult'))">
                        when a.id=#{item.id} then #{item.checkResult}
                    </if>
                </foreach>
            </trim>
            <trim prefix="checkStatus=(case" suffix="ELSE checkStatus end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('checkStatus')) or (colPickMode==1 and !item.containsKey('checkStatus'))">
                            when a.id=#{item.id} then #{item.checkStatus}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('checkStatusIncrement')) or (colPickMode==1 and !item.containsKey('checkStatusIncrement'))">
                            when a.id=#{item.id} then ifnull(a.checkStatus,0) + #{item.checkStatusIncrement}
                        </when>
                    </choose>
                </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="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="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="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="auditStatus=(case" suffix="ELSE auditStatus end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('auditStatus')) or (colPickMode==1 and !item.containsKey('auditStatus'))">
                            when a.id=#{item.id} then #{item.auditStatus}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('auditStatusIncrement')) or (colPickMode==1 and !item.containsKey('auditStatusIncrement'))">
                            when a.id=#{item.id} then ifnull(a.auditStatus,0) + #{item.auditStatusIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
        </trim>
        where id in
        <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
            #{item.id}
        </foreach>
    </update>
    <!-- 根据主健查询 -->
    <select id="getByKey" parameterType="paramDto" resultMap="CheckComplainRecordEntity-Map">
        select <include refid="_columns"/>
        from mortals_xhx_check_complain_record as a
        where a.id=#{condition.id}
    </select>
    <!-- 根据主健删除 -->
    <delete id="deleteByKey" parameterType="paramDto">
        delete a.* from mortals_xhx_check_complain_record as a where a.id=#{condition.id}
    </delete>
    <!-- 根据主健删除一批，针对单一主健有效 -->
    <delete id="deleteByKeys">
        delete from mortals_xhx_check_complain_record where id in
        <foreach collection="array" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>
    <!-- 根据主健列表删除一批，针对单一主健有效 -->
    <delete id="deleteByKeyList">
        delete from mortals_xhx_check_complain_record where id in
        <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>

    <!-- 根据对象列表删除一批，针对单一主健有效 -->
    <delete id="deleteByEntityList">
        delete from mortals_xhx_check_complain_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_check_complain_record as a
        <trim suffixOverrides="where" suffix="">
            where
            <trim prefixOverrides="and" prefix="">
                <include refid="_condition_"/>
            </trim>
        </trim>
    </delete>
    <!-- 获取列表 -->
    <select id="getList" parameterType="paramDto" resultMap="CheckComplainRecordEntity-Map">
        select <include refid="_columns"/>
        from mortals_xhx_check_complain_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_check_complain_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('recordId')">
            <if test="conditionParamRef.recordId != null ">
                ${_conditionType_} a.recordId = #{${_conditionParam_}.recordId}
            </if>
            <if test="conditionParamRef.recordId == null">
                ${_conditionType_} a.recordId is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('recordIdList') and conditionParamRef.recordIdList.size() > 0">
            ${_conditionType_} a.recordId in
            <foreach collection="conditionParamRef.recordIdList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('recordIdNotList') and conditionParamRef.recordIdNotList.size() > 0">
            ${_conditionType_} a.recordId not in
            <foreach collection="conditionParamRef.recordIdNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('recordIdStart') and conditionParamRef.recordIdStart != null">
            ${_conditionType_} a.recordId <![CDATA[ >= ]]> #{${_conditionParam_}.recordIdStart}
        </if>
        <if test="conditionParamRef.containsKey('recordIdEnd') and conditionParamRef.recordIdEnd != null">
            ${_conditionType_} a.recordId <![CDATA[ <= ]]> #{${_conditionParam_}.recordIdEnd}
        </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('complainTitle')">
            <if test="conditionParamRef.complainTitle != null and conditionParamRef.complainTitle != ''">
                ${_conditionType_} a.complainTitle like #{${_conditionParam_}.complainTitle}
            </if>
            <if test="conditionParamRef.complainTitle == null">
                ${_conditionType_} a.complainTitle is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('complainTitleList') and conditionParamRef.complainTitleList.size() > 0">
            ${_conditionType_} a.complainTitle in
            <foreach collection="conditionParamRef.complainTitleList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('complainTitleNotList') and conditionParamRef.complainTitleNotList.size() > 0">
            ${_conditionType_} a.complainTitle not in
            <foreach collection="conditionParamRef.complainTitleNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>

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

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

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

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

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

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

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

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

        <if test="conditionParamRef.containsKey('checkResult')">
            <if test="conditionParamRef.checkResult != null and conditionParamRef.checkResult != ''">
                ${_conditionType_} a.checkResult like #{${_conditionParam_}.checkResult}
            </if>
            <if test="conditionParamRef.checkResult == null">
                ${_conditionType_} a.checkResult is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('checkResultList') and conditionParamRef.checkResultList.size() > 0">
            ${_conditionType_} a.checkResult in
            <foreach collection="conditionParamRef.checkResultList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('checkResultNotList') and conditionParamRef.checkResultNotList.size() > 0">
            ${_conditionType_} a.checkResult not in
            <foreach collection="conditionParamRef.checkResultNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('checkStatus')">
            <if test="conditionParamRef.checkStatus != null ">
                ${_conditionType_} a.checkStatus = #{${_conditionParam_}.checkStatus}
            </if>
            <if test="conditionParamRef.checkStatus == null">
                ${_conditionType_} a.checkStatus is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('checkStatusList') and conditionParamRef.checkStatusList.size() > 0">
            ${_conditionType_} a.checkStatus in
            <foreach collection="conditionParamRef.checkStatusList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('checkStatusNotList') and conditionParamRef.checkStatusNotList.size() > 0">
            ${_conditionType_} a.checkStatus not in
            <foreach collection="conditionParamRef.checkStatusNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('checkStatusStart') and conditionParamRef.checkStatusStart != null">
            ${_conditionType_} a.checkStatus <![CDATA[ >= ]]> #{${_conditionParam_}.checkStatusStart}
        </if>
        <if test="conditionParamRef.containsKey('checkStatusEnd') and conditionParamRef.checkStatusEnd != null">
            ${_conditionType_} a.checkStatus <![CDATA[ <= ]]> #{${_conditionParam_}.checkStatusEnd}
        </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('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('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('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('auditStatus')">
            <if test="conditionParamRef.auditStatus != null ">
                ${_conditionType_} a.auditStatus = #{${_conditionParam_}.auditStatus}
            </if>
            <if test="conditionParamRef.auditStatus == null">
                ${_conditionType_} a.auditStatus is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('auditStatusList') and conditionParamRef.auditStatusList.size() > 0">
            ${_conditionType_} a.auditStatus in
            <foreach collection="conditionParamRef.auditStatusList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('auditStatusNotList') and conditionParamRef.auditStatusNotList.size() > 0">
            ${_conditionType_} a.auditStatus not in
            <foreach collection="conditionParamRef.auditStatusNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('auditStatusStart') and conditionParamRef.auditStatusStart != null">
            ${_conditionType_} a.auditStatus <![CDATA[ >= ]]> #{${_conditionParam_}.auditStatusStart}
        </if>
        <if test="conditionParamRef.containsKey('auditStatusEnd') and conditionParamRef.auditStatusEnd != null">
            ${_conditionType_} a.auditStatus <![CDATA[ <= ]]> #{${_conditionParam_}.auditStatusEnd}
        </if>

    </sql>
    <sql id="_orderCols_">
        <if test="orderColList != null and !orderColList.isEmpty()">
            order by
            <trim suffixOverrides=","  suffix="">
                <foreach collection="orderColList" open="" close="" index="index" item="item" separator=",">
                    ${item.colName} ${item.sortKind}
                </foreach>
            </trim>
        </if>
        <if test="(orderColList == null or orderColList.isEmpty()) and orderCol != null and !orderCol.isEmpty()">
            order by
            <trim suffixOverrides=","  suffix="">
                <if test="orderCol.containsKey('id')">
                    a.id
                    <if test='orderCol.id != null and "DESC".equalsIgnoreCase(orderCol.id)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('recordId')">
                    a.recordId
                    <if test='orderCol.recordId != null and "DESC".equalsIgnoreCase(orderCol.recordId)'>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('complainTitle')">
                    a.complainTitle
                    <if test='orderCol.complainTitle != null and "DESC".equalsIgnoreCase(orderCol.complainTitle)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('complainContent')">
                    a.complainContent
                    <if test='orderCol.complainContent != null and "DESC".equalsIgnoreCase(orderCol.complainContent)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('complainRealName')">
                    a.complainRealName
                    <if test='orderCol.complainRealName != null and "DESC".equalsIgnoreCase(orderCol.complainRealName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('contact')">
                    a.contact
                    <if test='orderCol.contact != null and "DESC".equalsIgnoreCase(orderCol.contact)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('complainTime')">
                    a.complainTime
                    <if test='orderCol.complainTime != null and "DESC".equalsIgnoreCase(orderCol.complainTime)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('complainSource')">
                    a.complainSource
                    <if test='orderCol.complainSource != null and "DESC".equalsIgnoreCase(orderCol.complainSource)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('complainDevice')">
                    a.complainDevice
                    <if test='orderCol.complainDevice != null and "DESC".equalsIgnoreCase(orderCol.complainDevice)'>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('score')">
                    a.score
                    <if test='orderCol.score != null and "DESC".equalsIgnoreCase(orderCol.score)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('checkPerson')">
                    a.checkPerson
                    <if test='orderCol.checkPerson != null and "DESC".equalsIgnoreCase(orderCol.checkPerson)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('checkTime')">
                    a.checkTime
                    <if test='orderCol.checkTime != null and "DESC".equalsIgnoreCase(orderCol.checkTime)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('checkDesc')">
                    a.checkDesc
                    <if test='orderCol.checkDesc != null and "DESC".equalsIgnoreCase(orderCol.checkDesc)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('checkResult')">
                    a.checkResult
                    <if test='orderCol.checkResult != null and "DESC".equalsIgnoreCase(orderCol.checkResult)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('checkStatus')">
                    a.checkStatus
                    <if test='orderCol.checkStatus != null and "DESC".equalsIgnoreCase(orderCol.checkStatus)'>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('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('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('subAddType')">
                    a.subAddType
                    <if test='orderCol.subAddType != null and "DESC".equalsIgnoreCase(orderCol.subAddType)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('auditStatus')">
                    a.auditStatus
                    <if test='orderCol.auditStatus != null and "DESC".equalsIgnoreCase(orderCol.auditStatus)'>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>