<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.perform.dao.ibatis.PerformPerposeStaffStatDaoImpl">

    <!-- 字段和属性映射 -->
    <resultMap type="PerformPerposeStaffStatEntity" id="PerformPerposeStaffStatEntity-Map">
            <id  property="id" column="id" />
            <result property="staffId" column="staffId" />
            <result property="staffName" column="staffName" />
            <result property="number" column="number" />
            <result property="absentRate" column="absentRate" />
            <result property="absenceRate" column="absenceRate" />
            <result property="lateRate" column="lateRate" />
            <result property="earlyRate" column="earlyRate" />
            <result property="leaveRate" column="leaveRate" />
            <result property="turnoverRate" column="turnoverRate" />
            <result property="sleepRate" column="sleepRate" />
            <result property="playPhoneRate" column="playPhoneRate" />
            <result property="expireWorkRate" column="expireWorkRate" />
            <result property="negaReviewRate" column="negaReviewRate" />
            <result property="remark" column="remark" />
            <result property="year" column="year" />
            <result property="month" column="month" />
            <result property="day" column="day" />
            <result property="createTime" column="createTime" />
            <result property="createUserId" column="createUserId" />
            <result property="updateTime" column="updateTime" />
            <result property="updateUserId" column="updateUserId" />
            
    </resultMap>


    <!-- 表所有列 -->
    <sql id="_columns">
        <trim suffixOverrides="," suffix="">
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))">
                    a.id,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('staffId') or colPickMode == 1 and data.containsKey('staffId')))">
                    a.staffId,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('staffName') or colPickMode == 1 and data.containsKey('staffName')))">
                    a.staffName,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('number') or colPickMode == 1 and data.containsKey('number')))">
                    a.number,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('absentRate') or colPickMode == 1 and data.containsKey('absentRate')))">
                    a.absentRate,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('absenceRate') or colPickMode == 1 and data.containsKey('absenceRate')))">
                    a.absenceRate,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lateRate') or colPickMode == 1 and data.containsKey('lateRate')))">
                    a.lateRate,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('earlyRate') or colPickMode == 1 and data.containsKey('earlyRate')))">
                    a.earlyRate,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('leaveRate') or colPickMode == 1 and data.containsKey('leaveRate')))">
                    a.leaveRate,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('turnoverRate') or colPickMode == 1 and data.containsKey('turnoverRate')))">
                    a.turnoverRate,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('sleepRate') or colPickMode == 1 and data.containsKey('sleepRate')))">
                    a.sleepRate,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('playPhoneRate') or colPickMode == 1 and data.containsKey('playPhoneRate')))">
                    a.playPhoneRate,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('expireWorkRate') or colPickMode == 1 and data.containsKey('expireWorkRate')))">
                    a.expireWorkRate,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('negaReviewRate') or colPickMode == 1 and data.containsKey('negaReviewRate')))">
                    a.negaReviewRate,
                </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('year') or colPickMode == 1 and data.containsKey('year')))">
                    a.year,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('month') or colPickMode == 1 and data.containsKey('month')))">
                    a.month,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('day') or colPickMode == 1 and data.containsKey('day')))">
                    a.day,
                </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('createUserId') or colPickMode == 1 and data.containsKey('createUserId')))">
                    a.createUserId,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
                    a.updateTime,
                </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>
        </trim>
    </sql>
    <!-- 新增 区分主键自增加还是业务插入 -->
    <insert id="insert" parameterType="PerformPerposeStaffStatEntity"  useGeneratedKeys="true" keyProperty="id">
        insert into mortals_xhx_perform_perpose_staff_stat
        (staffId,staffName,number,absentRate,absenceRate,lateRate,earlyRate,leaveRate,turnoverRate,sleepRate,playPhoneRate,expireWorkRate,negaReviewRate,remark,year,month,day,createTime,createUserId,updateTime,updateUserId)
        VALUES
        (#{staffId},#{staffName},#{number},#{absentRate},#{absenceRate},#{lateRate},#{earlyRate},#{leaveRate},#{turnoverRate},#{sleepRate},#{playPhoneRate},#{expireWorkRate},#{negaReviewRate},#{remark},#{year},#{month},#{day},#{createTime},#{createUserId},#{updateTime},#{updateUserId})
    </insert>

    <!-- 批量新增 -->
    <insert id="insertBatch" parameterType="paramDto">
        insert into mortals_xhx_perform_perpose_staff_stat
        (staffId,staffName,number,absentRate,absenceRate,lateRate,earlyRate,leaveRate,turnoverRate,sleepRate,playPhoneRate,expireWorkRate,negaReviewRate,remark,year,month,day,createTime,createUserId,updateTime,updateUserId)
        VALUES
        <foreach collection="data.dataList" item="item" index="index" separator="," >
            (#{item.staffId},#{item.staffName},#{item.number},#{item.absentRate},#{item.absenceRate},#{item.lateRate},#{item.earlyRate},#{item.leaveRate},#{item.turnoverRate},#{item.sleepRate},#{item.playPhoneRate},#{item.expireWorkRate},#{item.negaReviewRate},#{item.remark},#{item.year},#{item.month},#{item.day},#{item.createTime},#{item.createUserId},#{item.updateTime},#{item.updateUserId})
        </foreach>
    </insert>


    <!-- 根据ParamDto更新 -->
    <update id="update" parameterType="paramDto">
        update mortals_xhx_perform_perpose_staff_stat as a
        set
        <trim suffixOverrides="," suffix="">
            <if test="(colPickMode==0 and data.containsKey('staffId')) or (colPickMode==1 and !data.containsKey('staffId'))">
                a.staffId=#{data.staffId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('staffIdIncrement')) or (colPickMode==1 and !data.containsKey('staffIdIncrement'))">
                a.staffId=ifnull(a.staffId,0) + #{data.staffIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('staffName')) or (colPickMode==1 and !data.containsKey('staffName'))">
                a.staffName=#{data.staffName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('number')) or (colPickMode==1 and !data.containsKey('number'))">
                a.number=#{data.number},
            </if>
            <if test="(colPickMode==0 and data.containsKey('absentRate')) or (colPickMode==1 and !data.containsKey('absentRate'))">
                a.absentRate=#{data.absentRate},
            </if>
            <if test="(colPickMode==0 and data.containsKey('absentRateIncrement')) or (colPickMode==1 and !data.containsKey('absentRateIncrement'))">
                a.absentRate=ifnull(a.absentRate,0) + #{data.absentRateIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('absenceRate')) or (colPickMode==1 and !data.containsKey('absenceRate'))">
                a.absenceRate=#{data.absenceRate},
            </if>
            <if test="(colPickMode==0 and data.containsKey('absenceRateIncrement')) or (colPickMode==1 and !data.containsKey('absenceRateIncrement'))">
                a.absenceRate=ifnull(a.absenceRate,0) + #{data.absenceRateIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('lateRate')) or (colPickMode==1 and !data.containsKey('lateRate'))">
                a.lateRate=#{data.lateRate},
            </if>
            <if test="(colPickMode==0 and data.containsKey('lateRateIncrement')) or (colPickMode==1 and !data.containsKey('lateRateIncrement'))">
                a.lateRate=ifnull(a.lateRate,0) + #{data.lateRateIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('earlyRate')) or (colPickMode==1 and !data.containsKey('earlyRate'))">
                a.earlyRate=#{data.earlyRate},
            </if>
            <if test="(colPickMode==0 and data.containsKey('earlyRateIncrement')) or (colPickMode==1 and !data.containsKey('earlyRateIncrement'))">
                a.earlyRate=ifnull(a.earlyRate,0) + #{data.earlyRateIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('leaveRate')) or (colPickMode==1 and !data.containsKey('leaveRate'))">
                a.leaveRate=#{data.leaveRate},
            </if>
            <if test="(colPickMode==0 and data.containsKey('leaveRateIncrement')) or (colPickMode==1 and !data.containsKey('leaveRateIncrement'))">
                a.leaveRate=ifnull(a.leaveRate,0) + #{data.leaveRateIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('turnoverRate')) or (colPickMode==1 and !data.containsKey('turnoverRate'))">
                a.turnoverRate=#{data.turnoverRate},
            </if>
            <if test="(colPickMode==0 and data.containsKey('turnoverRateIncrement')) or (colPickMode==1 and !data.containsKey('turnoverRateIncrement'))">
                a.turnoverRate=ifnull(a.turnoverRate,0) + #{data.turnoverRateIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('sleepRate')) or (colPickMode==1 and !data.containsKey('sleepRate'))">
                a.sleepRate=#{data.sleepRate},
            </if>
            <if test="(colPickMode==0 and data.containsKey('sleepRateIncrement')) or (colPickMode==1 and !data.containsKey('sleepRateIncrement'))">
                a.sleepRate=ifnull(a.sleepRate,0) + #{data.sleepRateIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('playPhoneRate')) or (colPickMode==1 and !data.containsKey('playPhoneRate'))">
                a.playPhoneRate=#{data.playPhoneRate},
            </if>
            <if test="(colPickMode==0 and data.containsKey('playPhoneRateIncrement')) or (colPickMode==1 and !data.containsKey('playPhoneRateIncrement'))">
                a.playPhoneRate=ifnull(a.playPhoneRate,0) + #{data.playPhoneRateIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('expireWorkRate')) or (colPickMode==1 and !data.containsKey('expireWorkRate'))">
                a.expireWorkRate=#{data.expireWorkRate},
            </if>
            <if test="(colPickMode==0 and data.containsKey('expireWorkRateIncrement')) or (colPickMode==1 and !data.containsKey('expireWorkRateIncrement'))">
                a.expireWorkRate=ifnull(a.expireWorkRate,0) + #{data.expireWorkRateIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('negaReviewRate')) or (colPickMode==1 and !data.containsKey('negaReviewRate'))">
                a.negaReviewRate=#{data.negaReviewRate},
            </if>
            <if test="(colPickMode==0 and data.containsKey('negaReviewRateIncrement')) or (colPickMode==1 and !data.containsKey('negaReviewRateIncrement'))">
                a.negaReviewRate=ifnull(a.negaReviewRate,0) + #{data.negaReviewRateIncrement},
            </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('year')) or (colPickMode==1 and !data.containsKey('year'))">
                a.year=#{data.year},
            </if>
            <if test="(colPickMode==0 and data.containsKey('yearIncrement')) or (colPickMode==1 and !data.containsKey('yearIncrement'))">
                a.year=ifnull(a.year,0) + #{data.yearIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('month')) or (colPickMode==1 and !data.containsKey('month'))">
                a.month=#{data.month},
            </if>
            <if test="(colPickMode==0 and data.containsKey('monthIncrement')) or (colPickMode==1 and !data.containsKey('monthIncrement'))">
                a.month=ifnull(a.month,0) + #{data.monthIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('day')) or (colPickMode==1 and !data.containsKey('day'))">
                a.day=#{data.day},
            </if>
            <if test="(colPickMode==0 and data.containsKey('dayIncrement')) or (colPickMode==1 and !data.containsKey('dayIncrement'))">
                a.day=ifnull(a.day,0) + #{data.dayIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))">
                a.createTime=#{data.createTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('createUserId')) or (colPickMode==1 and !data.containsKey('createUserId'))">
                a.createUserId=#{data.createUserId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('createUserIdIncrement')) or (colPickMode==1 and !data.containsKey('createUserIdIncrement'))">
                a.createUserId=ifnull(a.createUserId,0) + #{data.createUserIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
                a.updateTime=#{data.updateTime},
            </if>
            <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>
        </trim>
        <trim suffixOverrides="where" suffix="">
            where
            <trim prefixOverrides="and" prefix="">
                <include refid="_condition_"/>
            </trim>
        </trim>
    </update>
    <!-- 批量更新 -->
    <update id="updateBatch" parameterType="paramDto">
        update mortals_xhx_perform_perpose_staff_stat as a
        <trim prefix="set" suffixOverrides=",">
                        <trim prefix="staffId=(case" suffix="ELSE staffId end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('staffId')) or (colPickMode==1 and !item.containsKey('staffId'))">
                                        when a.id=#{item.id} then #{item.staffId}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('staffIdIncrement')) or (colPickMode==1 and !item.containsKey('staffIdIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.staffId,0) + #{item.staffIdIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                <trim prefix="staffName=(case" suffix="ELSE staffName end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('staffName')) or (colPickMode==1 and !item.containsKey('staffName'))">
                            when a.id=#{item.id} then #{item.staffName}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="number=(case" suffix="ELSE number end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('number')) or (colPickMode==1 and !item.containsKey('number'))">
                            when a.id=#{item.id} then #{item.number}
                        </if>
                    </foreach>
                </trim>
                        <trim prefix="absentRate=(case" suffix="ELSE absentRate end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('absentRate')) or (colPickMode==1 and !item.containsKey('absentRate'))">
                                        when a.id=#{item.id} then #{item.absentRate}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('absentRateIncrement')) or (colPickMode==1 and !item.containsKey('absentRateIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.absentRate,0) + #{item.absentRateIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="absenceRate=(case" suffix="ELSE absenceRate end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('absenceRate')) or (colPickMode==1 and !item.containsKey('absenceRate'))">
                                        when a.id=#{item.id} then #{item.absenceRate}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('absenceRateIncrement')) or (colPickMode==1 and !item.containsKey('absenceRateIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.absenceRate,0) + #{item.absenceRateIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="lateRate=(case" suffix="ELSE lateRate end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('lateRate')) or (colPickMode==1 and !item.containsKey('lateRate'))">
                                        when a.id=#{item.id} then #{item.lateRate}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('lateRateIncrement')) or (colPickMode==1 and !item.containsKey('lateRateIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.lateRate,0) + #{item.lateRateIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="earlyRate=(case" suffix="ELSE earlyRate end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('earlyRate')) or (colPickMode==1 and !item.containsKey('earlyRate'))">
                                        when a.id=#{item.id} then #{item.earlyRate}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('earlyRateIncrement')) or (colPickMode==1 and !item.containsKey('earlyRateIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.earlyRate,0) + #{item.earlyRateIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="leaveRate=(case" suffix="ELSE leaveRate end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('leaveRate')) or (colPickMode==1 and !item.containsKey('leaveRate'))">
                                        when a.id=#{item.id} then #{item.leaveRate}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('leaveRateIncrement')) or (colPickMode==1 and !item.containsKey('leaveRateIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.leaveRate,0) + #{item.leaveRateIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="turnoverRate=(case" suffix="ELSE turnoverRate end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('turnoverRate')) or (colPickMode==1 and !item.containsKey('turnoverRate'))">
                                        when a.id=#{item.id} then #{item.turnoverRate}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('turnoverRateIncrement')) or (colPickMode==1 and !item.containsKey('turnoverRateIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.turnoverRate,0) + #{item.turnoverRateIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="sleepRate=(case" suffix="ELSE sleepRate end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('sleepRate')) or (colPickMode==1 and !item.containsKey('sleepRate'))">
                                        when a.id=#{item.id} then #{item.sleepRate}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('sleepRateIncrement')) or (colPickMode==1 and !item.containsKey('sleepRateIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.sleepRate,0) + #{item.sleepRateIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="playPhoneRate=(case" suffix="ELSE playPhoneRate end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('playPhoneRate')) or (colPickMode==1 and !item.containsKey('playPhoneRate'))">
                                        when a.id=#{item.id} then #{item.playPhoneRate}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('playPhoneRateIncrement')) or (colPickMode==1 and !item.containsKey('playPhoneRateIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.playPhoneRate,0) + #{item.playPhoneRateIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="expireWorkRate=(case" suffix="ELSE expireWorkRate end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('expireWorkRate')) or (colPickMode==1 and !item.containsKey('expireWorkRate'))">
                                        when a.id=#{item.id} then #{item.expireWorkRate}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('expireWorkRateIncrement')) or (colPickMode==1 and !item.containsKey('expireWorkRateIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.expireWorkRate,0) + #{item.expireWorkRateIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="negaReviewRate=(case" suffix="ELSE negaReviewRate end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('negaReviewRate')) or (colPickMode==1 and !item.containsKey('negaReviewRate'))">
                                        when a.id=#{item.id} then #{item.negaReviewRate}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('negaReviewRateIncrement')) or (colPickMode==1 and !item.containsKey('negaReviewRateIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.negaReviewRate,0) + #{item.negaReviewRateIncrement}
                                    </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="year=(case" suffix="ELSE year end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('year')) or (colPickMode==1 and !item.containsKey('year'))">
                                        when a.id=#{item.id} then #{item.year}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('yearIncrement')) or (colPickMode==1 and !item.containsKey('yearIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.year,0) + #{item.yearIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="month=(case" suffix="ELSE month end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('month')) or (colPickMode==1 and !item.containsKey('month'))">
                                        when a.id=#{item.id} then #{item.month}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('monthIncrement')) or (colPickMode==1 and !item.containsKey('monthIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.month,0) + #{item.monthIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="day=(case" suffix="ELSE day end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('day')) or (colPickMode==1 and !item.containsKey('day'))">
                                        when a.id=#{item.id} then #{item.day}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('dayIncrement')) or (colPickMode==1 and !item.containsKey('dayIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.day,0) + #{item.dayIncrement}
                                    </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="createUserId=(case" suffix="ELSE createUserId end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('createUserId')) or (colPickMode==1 and !item.containsKey('createUserId'))">
                                        when a.id=#{item.id} then #{item.createUserId}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('createUserIdIncrement')) or (colPickMode==1 and !item.containsKey('createUserIdIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.createUserId,0) + #{item.createUserIdIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                <trim prefix="updateTime=(case" suffix="ELSE updateTime end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('updateTime')) or (colPickMode==1 and !item.containsKey('updateTime'))">
                            when a.id=#{item.id} then #{item.updateTime}
                        </if>
                    </foreach>
                </trim>
                        <trim 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>
        where id in
        <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
            #{item.id}
        </foreach>
    </update>
    <!-- 根据主健查询 -->
    <select id="getByKey" parameterType="paramDto" resultMap="PerformPerposeStaffStatEntity-Map">
        select <include refid="_columns"/>
        from mortals_xhx_perform_perpose_staff_stat as a
        where a.id=#{condition.id}
    </select>
    <!-- 根据主健删除 -->
    <delete id="deleteByKey" parameterType="paramDto">
        delete a.* from mortals_xhx_perform_perpose_staff_stat as a where a.id=#{condition.id}
    </delete>
    <!-- 根据主健删除一批，针对单一主健有效 -->
    <delete id="deleteByKeys">
        delete from mortals_xhx_perform_perpose_staff_stat where id in
        <foreach collection="array" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>
    <!-- 根据主健列表删除一批，针对单一主健有效 -->
    <delete id="deleteByKeyList">
        delete from mortals_xhx_perform_perpose_staff_stat where id in
        <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>

    <!-- 根据对象列表删除一批，针对单一主健有效 -->
    <delete id="deleteByEntityList">
        delete from mortals_xhx_perform_perpose_staff_stat where id in
        <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
            #{item.id}
        </foreach>
    </delete>
    <!-- 根据paramDto删除一批 -->
    <delete id="deleteByMap" parameterType="paramDto">
        delete a.* from mortals_xhx_perform_perpose_staff_stat as a
        <trim suffixOverrides="where" suffix="">
            where
            <trim prefixOverrides="and" prefix="">
                <include refid="_condition_"/>
            </trim>
        </trim>
    </delete>
    <!-- 获取列表 -->
    <select id="getList" parameterType="paramDto" resultMap="PerformPerposeStaffStatEntity-Map">
        select <include refid="_columns"/>
        from mortals_xhx_perform_perpose_staff_stat as a
        <trim suffixOverrides="where" suffix="">
            where
            <trim prefixOverrides="and" prefix="">
                <include refid="_condition_"/>
            </trim>
        </trim>
        <include refid="_orderCols_"/>
    </select>



    <!-- 获取 -->
    <select id="getListCount" parameterType="paramDto" resultType="int">
        select count(1)
        from mortals_xhx_perform_perpose_staff_stat as a
        <trim suffixOverrides="where" suffix="">
            where
            <trim prefixOverrides="and" prefix="">
                <include refid="_condition_"/>
            </trim>
        </trim>
    </select>
    <!-- 条件映射 -->
    <sql id="_condition_">
        <if test="condition != null and !condition.isEmpty()">
            <!-- 条件映射-普通条件 -->
            <include refid="_condition_param_">
                <property name="_conditionParam_" value="condition"/>
                <property name="_conditionType_" value="and"/>
            </include>
            <!-- 条件映射-集合之间使用AND，集合中元素使用OR-(list[0].1 or list[0].2) and (list[1].3 or list[1].4) -->
            <if test="condition.containsKey('andConditionList') and !condition.andConditionList.isEmpty()">
                and
                <foreach collection="condition.andConditionList" open="(" close=")" index="index" item="andCondition" separator=" and ">
                    <trim prefixOverrides="or" prefix="(" suffix=")">
                        <include refid="_condition_param_">
                            <property name="_conditionParam_" value="andCondition"/>
                            <property name="_conditionType_" value="or"/>
                        </include>
                    </trim>
                </foreach>
            </if>
            <!-- 条件映射-集合之间使用OR，集合中元素使用AND-(list[0].1 and list[0].2) or (list[1].3 and list[1].4) -->
            <if test="condition.containsKey('orConditionList') and !condition.orConditionList.isEmpty()">
                and
                <foreach collection="condition.orConditionList" open="(" close=")" index="index" item="orCondition" separator=" or ">
                    <trim prefixOverrides="and" prefix="(" suffix=")">
                        <include refid="_condition_param_">
                            <property name="_conditionParam_" value="orCondition"/>
                            <property name="_conditionType_" value="and"/>
                        </include>
                    </trim>
                </foreach>
            </if>
        </if>
    </sql>
    <!-- 条件映射-代参数 -->
    <sql id="_condition_param_">
        <bind name="conditionParamRef" value="${_conditionParam_}"/>
        <if test="conditionParamRef.containsKey('id')">
            <if test="conditionParamRef.id != null">
                ${_conditionType_} a.id=#{${_conditionParam_}.id}
            </if>
        </if>
            <if test="conditionParamRef.containsKey('id')">
                <if test="conditionParamRef.id != null ">
                    ${_conditionType_} a.id = #{${_conditionParam_}.id}
                </if>
                <if test="conditionParamRef.id == null">
                    ${_conditionType_} a.id is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('idList') and conditionParamRef.idList.size() > 0">
                ${_conditionType_} a.id in
                <foreach collection="conditionParamRef.idList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('idNotList') and conditionParamRef.idNotList.size() > 0">
                ${_conditionType_} a.id not in
                <foreach collection="conditionParamRef.idNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('idStart') and conditionParamRef.idStart != null">
                ${_conditionType_} a.id <![CDATA[ >= ]]> #{${_conditionParam_}.idStart}
            </if>
            <if test="conditionParamRef.containsKey('idEnd') and conditionParamRef.idEnd != null">
                ${_conditionType_} a.id <![CDATA[ <= ]]> #{${_conditionParam_}.idEnd}
            </if>

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


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

            <if test="conditionParamRef.containsKey('number')">
                <if test="conditionParamRef.number != null and conditionParamRef.number != ''">
                    ${_conditionType_} a.number like #{${_conditionParam_}.number}
                </if>
                <if test="conditionParamRef.number == null">
                    ${_conditionType_} a.number is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('numberList') and conditionParamRef.numberList.size() > 0">
                ${_conditionType_} a.number in
                <foreach collection="conditionParamRef.numberList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('numberNotList') and conditionParamRef.numberNotList.size() > 0">
                ${_conditionType_} a.number not in
                <foreach collection="conditionParamRef.numberNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('absentRate')">
                <if test="conditionParamRef.absentRate != null ">
                    ${_conditionType_} a.absentRate = #{${_conditionParam_}.absentRate}
                </if>
                <if test="conditionParamRef.absentRate == null">
                    ${_conditionType_} a.absentRate is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('absentRateList') and conditionParamRef.absentRateList.size() > 0">
                ${_conditionType_} a.absentRate in
                <foreach collection="conditionParamRef.absentRateList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('absentRateNotList') and conditionParamRef.absentRateNotList.size() > 0">
                ${_conditionType_} a.absentRate not in
                <foreach collection="conditionParamRef.absentRateNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('absentRateStart') and conditionParamRef.absentRateStart != null">
                ${_conditionType_} a.absentRate <![CDATA[ >= ]]> #{${_conditionParam_}.absentRateStart}
            </if>
            <if test="conditionParamRef.containsKey('absentRateEnd') and conditionParamRef.absentRateEnd != null">
                ${_conditionType_} a.absentRate <![CDATA[ <= ]]> #{${_conditionParam_}.absentRateEnd}
            </if>

            <if test="conditionParamRef.containsKey('absenceRate')">
                <if test="conditionParamRef.absenceRate != null ">
                    ${_conditionType_} a.absenceRate = #{${_conditionParam_}.absenceRate}
                </if>
                <if test="conditionParamRef.absenceRate == null">
                    ${_conditionType_} a.absenceRate is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('absenceRateList') and conditionParamRef.absenceRateList.size() > 0">
                ${_conditionType_} a.absenceRate in
                <foreach collection="conditionParamRef.absenceRateList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('absenceRateNotList') and conditionParamRef.absenceRateNotList.size() > 0">
                ${_conditionType_} a.absenceRate not in
                <foreach collection="conditionParamRef.absenceRateNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('absenceRateStart') and conditionParamRef.absenceRateStart != null">
                ${_conditionType_} a.absenceRate <![CDATA[ >= ]]> #{${_conditionParam_}.absenceRateStart}
            </if>
            <if test="conditionParamRef.containsKey('absenceRateEnd') and conditionParamRef.absenceRateEnd != null">
                ${_conditionType_} a.absenceRate <![CDATA[ <= ]]> #{${_conditionParam_}.absenceRateEnd}
            </if>

            <if test="conditionParamRef.containsKey('lateRate')">
                <if test="conditionParamRef.lateRate != null ">
                    ${_conditionType_} a.lateRate = #{${_conditionParam_}.lateRate}
                </if>
                <if test="conditionParamRef.lateRate == null">
                    ${_conditionType_} a.lateRate is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('lateRateList') and conditionParamRef.lateRateList.size() > 0">
                ${_conditionType_} a.lateRate in
                <foreach collection="conditionParamRef.lateRateList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('lateRateNotList') and conditionParamRef.lateRateNotList.size() > 0">
                ${_conditionType_} a.lateRate not in
                <foreach collection="conditionParamRef.lateRateNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('lateRateStart') and conditionParamRef.lateRateStart != null">
                ${_conditionType_} a.lateRate <![CDATA[ >= ]]> #{${_conditionParam_}.lateRateStart}
            </if>
            <if test="conditionParamRef.containsKey('lateRateEnd') and conditionParamRef.lateRateEnd != null">
                ${_conditionType_} a.lateRate <![CDATA[ <= ]]> #{${_conditionParam_}.lateRateEnd}
            </if>

            <if test="conditionParamRef.containsKey('earlyRate')">
                <if test="conditionParamRef.earlyRate != null ">
                    ${_conditionType_} a.earlyRate = #{${_conditionParam_}.earlyRate}
                </if>
                <if test="conditionParamRef.earlyRate == null">
                    ${_conditionType_} a.earlyRate is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('earlyRateList') and conditionParamRef.earlyRateList.size() > 0">
                ${_conditionType_} a.earlyRate in
                <foreach collection="conditionParamRef.earlyRateList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('earlyRateNotList') and conditionParamRef.earlyRateNotList.size() > 0">
                ${_conditionType_} a.earlyRate not in
                <foreach collection="conditionParamRef.earlyRateNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('earlyRateStart') and conditionParamRef.earlyRateStart != null">
                ${_conditionType_} a.earlyRate <![CDATA[ >= ]]> #{${_conditionParam_}.earlyRateStart}
            </if>
            <if test="conditionParamRef.containsKey('earlyRateEnd') and conditionParamRef.earlyRateEnd != null">
                ${_conditionType_} a.earlyRate <![CDATA[ <= ]]> #{${_conditionParam_}.earlyRateEnd}
            </if>

            <if test="conditionParamRef.containsKey('leaveRate')">
                <if test="conditionParamRef.leaveRate != null ">
                    ${_conditionType_} a.leaveRate = #{${_conditionParam_}.leaveRate}
                </if>
                <if test="conditionParamRef.leaveRate == null">
                    ${_conditionType_} a.leaveRate is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('leaveRateList') and conditionParamRef.leaveRateList.size() > 0">
                ${_conditionType_} a.leaveRate in
                <foreach collection="conditionParamRef.leaveRateList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('leaveRateNotList') and conditionParamRef.leaveRateNotList.size() > 0">
                ${_conditionType_} a.leaveRate not in
                <foreach collection="conditionParamRef.leaveRateNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('leaveRateStart') and conditionParamRef.leaveRateStart != null">
                ${_conditionType_} a.leaveRate <![CDATA[ >= ]]> #{${_conditionParam_}.leaveRateStart}
            </if>
            <if test="conditionParamRef.containsKey('leaveRateEnd') and conditionParamRef.leaveRateEnd != null">
                ${_conditionType_} a.leaveRate <![CDATA[ <= ]]> #{${_conditionParam_}.leaveRateEnd}
            </if>

            <if test="conditionParamRef.containsKey('turnoverRate')">
                <if test="conditionParamRef.turnoverRate != null ">
                    ${_conditionType_} a.turnoverRate = #{${_conditionParam_}.turnoverRate}
                </if>
                <if test="conditionParamRef.turnoverRate == null">
                    ${_conditionType_} a.turnoverRate is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('turnoverRateList') and conditionParamRef.turnoverRateList.size() > 0">
                ${_conditionType_} a.turnoverRate in
                <foreach collection="conditionParamRef.turnoverRateList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('turnoverRateNotList') and conditionParamRef.turnoverRateNotList.size() > 0">
                ${_conditionType_} a.turnoverRate not in
                <foreach collection="conditionParamRef.turnoverRateNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('turnoverRateStart') and conditionParamRef.turnoverRateStart != null">
                ${_conditionType_} a.turnoverRate <![CDATA[ >= ]]> #{${_conditionParam_}.turnoverRateStart}
            </if>
            <if test="conditionParamRef.containsKey('turnoverRateEnd') and conditionParamRef.turnoverRateEnd != null">
                ${_conditionType_} a.turnoverRate <![CDATA[ <= ]]> #{${_conditionParam_}.turnoverRateEnd}
            </if>

            <if test="conditionParamRef.containsKey('sleepRate')">
                <if test="conditionParamRef.sleepRate != null ">
                    ${_conditionType_} a.sleepRate = #{${_conditionParam_}.sleepRate}
                </if>
                <if test="conditionParamRef.sleepRate == null">
                    ${_conditionType_} a.sleepRate is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('sleepRateList') and conditionParamRef.sleepRateList.size() > 0">
                ${_conditionType_} a.sleepRate in
                <foreach collection="conditionParamRef.sleepRateList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('sleepRateNotList') and conditionParamRef.sleepRateNotList.size() > 0">
                ${_conditionType_} a.sleepRate not in
                <foreach collection="conditionParamRef.sleepRateNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('sleepRateStart') and conditionParamRef.sleepRateStart != null">
                ${_conditionType_} a.sleepRate <![CDATA[ >= ]]> #{${_conditionParam_}.sleepRateStart}
            </if>
            <if test="conditionParamRef.containsKey('sleepRateEnd') and conditionParamRef.sleepRateEnd != null">
                ${_conditionType_} a.sleepRate <![CDATA[ <= ]]> #{${_conditionParam_}.sleepRateEnd}
            </if>

            <if test="conditionParamRef.containsKey('playPhoneRate')">
                <if test="conditionParamRef.playPhoneRate != null ">
                    ${_conditionType_} a.playPhoneRate = #{${_conditionParam_}.playPhoneRate}
                </if>
                <if test="conditionParamRef.playPhoneRate == null">
                    ${_conditionType_} a.playPhoneRate is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('playPhoneRateList') and conditionParamRef.playPhoneRateList.size() > 0">
                ${_conditionType_} a.playPhoneRate in
                <foreach collection="conditionParamRef.playPhoneRateList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('playPhoneRateNotList') and conditionParamRef.playPhoneRateNotList.size() > 0">
                ${_conditionType_} a.playPhoneRate not in
                <foreach collection="conditionParamRef.playPhoneRateNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('playPhoneRateStart') and conditionParamRef.playPhoneRateStart != null">
                ${_conditionType_} a.playPhoneRate <![CDATA[ >= ]]> #{${_conditionParam_}.playPhoneRateStart}
            </if>
            <if test="conditionParamRef.containsKey('playPhoneRateEnd') and conditionParamRef.playPhoneRateEnd != null">
                ${_conditionType_} a.playPhoneRate <![CDATA[ <= ]]> #{${_conditionParam_}.playPhoneRateEnd}
            </if>

            <if test="conditionParamRef.containsKey('expireWorkRate')">
                <if test="conditionParamRef.expireWorkRate != null ">
                    ${_conditionType_} a.expireWorkRate = #{${_conditionParam_}.expireWorkRate}
                </if>
                <if test="conditionParamRef.expireWorkRate == null">
                    ${_conditionType_} a.expireWorkRate is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('expireWorkRateList') and conditionParamRef.expireWorkRateList.size() > 0">
                ${_conditionType_} a.expireWorkRate in
                <foreach collection="conditionParamRef.expireWorkRateList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('expireWorkRateNotList') and conditionParamRef.expireWorkRateNotList.size() > 0">
                ${_conditionType_} a.expireWorkRate not in
                <foreach collection="conditionParamRef.expireWorkRateNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('expireWorkRateStart') and conditionParamRef.expireWorkRateStart != null">
                ${_conditionType_} a.expireWorkRate <![CDATA[ >= ]]> #{${_conditionParam_}.expireWorkRateStart}
            </if>
            <if test="conditionParamRef.containsKey('expireWorkRateEnd') and conditionParamRef.expireWorkRateEnd != null">
                ${_conditionType_} a.expireWorkRate <![CDATA[ <= ]]> #{${_conditionParam_}.expireWorkRateEnd}
            </if>

            <if test="conditionParamRef.containsKey('negaReviewRate')">
                <if test="conditionParamRef.negaReviewRate != null ">
                    ${_conditionType_} a.negaReviewRate = #{${_conditionParam_}.negaReviewRate}
                </if>
                <if test="conditionParamRef.negaReviewRate == null">
                    ${_conditionType_} a.negaReviewRate is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('negaReviewRateList') and conditionParamRef.negaReviewRateList.size() > 0">
                ${_conditionType_} a.negaReviewRate in
                <foreach collection="conditionParamRef.negaReviewRateList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('negaReviewRateNotList') and conditionParamRef.negaReviewRateNotList.size() > 0">
                ${_conditionType_} a.negaReviewRate not in
                <foreach collection="conditionParamRef.negaReviewRateNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('negaReviewRateStart') and conditionParamRef.negaReviewRateStart != null">
                ${_conditionType_} a.negaReviewRate <![CDATA[ >= ]]> #{${_conditionParam_}.negaReviewRateStart}
            </if>
            <if test="conditionParamRef.containsKey('negaReviewRateEnd') and conditionParamRef.negaReviewRateEnd != null">
                ${_conditionType_} a.negaReviewRate <![CDATA[ <= ]]> #{${_conditionParam_}.negaReviewRateEnd}
            </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('year')">
                <if test="conditionParamRef.year != null ">
                    ${_conditionType_} a.year = #{${_conditionParam_}.year}
                </if>
                <if test="conditionParamRef.year == null">
                    ${_conditionType_} a.year is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('yearList') and conditionParamRef.yearList.size() > 0">
                ${_conditionType_} a.year in
                <foreach collection="conditionParamRef.yearList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('yearNotList') and conditionParamRef.yearNotList.size() > 0">
                ${_conditionType_} a.year not in
                <foreach collection="conditionParamRef.yearNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('yearStart') and conditionParamRef.yearStart != null">
                ${_conditionType_} a.year <![CDATA[ >= ]]> #{${_conditionParam_}.yearStart}
            </if>
            <if test="conditionParamRef.containsKey('yearEnd') and conditionParamRef.yearEnd != null">
                ${_conditionType_} a.year <![CDATA[ <= ]]> #{${_conditionParam_}.yearEnd}
            </if>

            <if test="conditionParamRef.containsKey('month')">
                <if test="conditionParamRef.month != null ">
                    ${_conditionType_} a.month = #{${_conditionParam_}.month}
                </if>
                <if test="conditionParamRef.month == null">
                    ${_conditionType_} a.month is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('monthList') and conditionParamRef.monthList.size() > 0">
                ${_conditionType_} a.month in
                <foreach collection="conditionParamRef.monthList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('monthNotList') and conditionParamRef.monthNotList.size() > 0">
                ${_conditionType_} a.month not in
                <foreach collection="conditionParamRef.monthNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('monthStart') and conditionParamRef.monthStart != null">
                ${_conditionType_} a.month <![CDATA[ >= ]]> #{${_conditionParam_}.monthStart}
            </if>
            <if test="conditionParamRef.containsKey('monthEnd') and conditionParamRef.monthEnd != null">
                ${_conditionType_} a.month <![CDATA[ <= ]]> #{${_conditionParam_}.monthEnd}
            </if>

            <if test="conditionParamRef.containsKey('day')">
                <if test="conditionParamRef.day != null ">
                    ${_conditionType_} a.day = #{${_conditionParam_}.day}
                </if>
                <if test="conditionParamRef.day == null">
                    ${_conditionType_} a.day is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('dayList') and conditionParamRef.dayList.size() > 0">
                ${_conditionType_} a.day in
                <foreach collection="conditionParamRef.dayList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('dayNotList') and conditionParamRef.dayNotList.size() > 0">
                ${_conditionType_} a.day not in
                <foreach collection="conditionParamRef.dayNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('dayStart') and conditionParamRef.dayStart != null">
                ${_conditionType_} a.day <![CDATA[ >= ]]> #{${_conditionParam_}.dayStart}
            </if>
            <if test="conditionParamRef.containsKey('dayEnd') and conditionParamRef.dayEnd != null">
                ${_conditionType_} a.day <![CDATA[ <= ]]> #{${_conditionParam_}.dayEnd}
            </if>


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

    </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('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('number')">
                        a.number
                        <if test='orderCol.number != null and "DESC".equalsIgnoreCase(orderCol.number)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('absentRate')">
                        a.absentRate
                        <if test='orderCol.absentRate != null and "DESC".equalsIgnoreCase(orderCol.absentRate)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('absenceRate')">
                        a.absenceRate
                        <if test='orderCol.absenceRate != null and "DESC".equalsIgnoreCase(orderCol.absenceRate)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('lateRate')">
                        a.lateRate
                        <if test='orderCol.lateRate != null and "DESC".equalsIgnoreCase(orderCol.lateRate)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('earlyRate')">
                        a.earlyRate
                        <if test='orderCol.earlyRate != null and "DESC".equalsIgnoreCase(orderCol.earlyRate)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('leaveRate')">
                        a.leaveRate
                        <if test='orderCol.leaveRate != null and "DESC".equalsIgnoreCase(orderCol.leaveRate)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('turnoverRate')">
                        a.turnoverRate
                        <if test='orderCol.turnoverRate != null and "DESC".equalsIgnoreCase(orderCol.turnoverRate)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('sleepRate')">
                        a.sleepRate
                        <if test='orderCol.sleepRate != null and "DESC".equalsIgnoreCase(orderCol.sleepRate)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('playPhoneRate')">
                        a.playPhoneRate
                        <if test='orderCol.playPhoneRate != null and "DESC".equalsIgnoreCase(orderCol.playPhoneRate)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('expireWorkRate')">
                        a.expireWorkRate
                        <if test='orderCol.expireWorkRate != null and "DESC".equalsIgnoreCase(orderCol.expireWorkRate)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('negaReviewRate')">
                        a.negaReviewRate
                        <if test='orderCol.negaReviewRate != null and "DESC".equalsIgnoreCase(orderCol.negaReviewRate)'>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('year')">
                        a.year
                        <if test='orderCol.year != null and "DESC".equalsIgnoreCase(orderCol.year)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('month')">
                        a.month
                        <if test='orderCol.month != null and "DESC".equalsIgnoreCase(orderCol.month)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('day')">
                        a.day
                        <if test='orderCol.day != null and "DESC".equalsIgnoreCase(orderCol.day)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('createTime')">
                        a.createTime
                        <if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('createUserId')">
                        a.createUserId
                        <if test='orderCol.createUserId != null and "DESC".equalsIgnoreCase(orderCol.createUserId)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('updateTime')">
                        a.updateTime
                        <if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('updateUserId')">
                        a.updateUserId
                        <if test='orderCol.updateUserId != null and "DESC".equalsIgnoreCase(orderCol.updateUserId)'>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>