<?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.staff.dao.ibatis.StaffContractDaoImpl">

    <!-- 字段和属性映射 -->
    <resultMap type="StaffContractEntity" id="StaffContractEntity-Map">
            <id  property="id" column="id" />
            <result property="staffId" column="staffId" />
            <result property="staffName" column="staffName" />
            <result property="gender" column="gender" />
            <result property="birthday" column="birthday" />
            <result property="photoPath" column="photoPath" />
            <result property="phoneNumber" column="phoneNumber" />
            <result property="idCard" column="idCard" />
            <result property="workNum" column="workNum" />
            <result property="politicalstatus" column="politicalstatus" />
            <result property="deptId" column="deptId" />
            <result property="deptName" column="deptName" />
            <result property="jobId" column="jobId" />
            <result property="jobName" column="jobName" />
            <result property="staffType" column="staffType" />
            <result property="status" column="status" />
            <result property="entryDate" column="entryDate" />
            <result property="contractStartDate" column="contractStartDate" />
            <result property="contractEndDate" column="contractEndDate" />
            <result property="contractCompany" column="contractCompany" />
            <result property="contractType" column="contractType" />
            <result property="newStartDate" column="newStartDate" />
            <result property="newEndDate" column="newEndDate" />
            <result property="auditStatus" column="auditStatus" />
            <result property="createUserId" column="createUserId" />
            <result property="createTime" column="createTime" />
            <result property="updateUserId" column="updateUserId" />
            <result property="updateTime" column="updateTime" />
            
    </resultMap>


    <!-- 表所有列 -->
    <sql id="_columns">
        <trim suffixOverrides="," suffix="">
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))">
                    a.id,
                </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('gender') or colPickMode == 1 and data.containsKey('gender')))">
                    a.gender,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('birthday') or colPickMode == 1 and data.containsKey('birthday')))">
                    a.birthday,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('photoPath') or colPickMode == 1 and data.containsKey('photoPath')))">
                    a.photoPath,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('phoneNumber') or colPickMode == 1 and data.containsKey('phoneNumber')))">
                    a.phoneNumber,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('idCard') or colPickMode == 1 and data.containsKey('idCard')))">
                    a.idCard,
                </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('politicalstatus') or colPickMode == 1 and data.containsKey('politicalstatus')))">
                    a.politicalstatus,
                </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('jobId') or colPickMode == 1 and data.containsKey('jobId')))">
                    a.jobId,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('jobName') or colPickMode == 1 and data.containsKey('jobName')))">
                    a.jobName,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('staffType') or colPickMode == 1 and data.containsKey('staffType')))">
                    a.staffType,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('status') or colPickMode == 1 and data.containsKey('status')))">
                    a.status,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('entryDate') or colPickMode == 1 and data.containsKey('entryDate')))">
                    a.entryDate,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('contractStartDate') or colPickMode == 1 and data.containsKey('contractStartDate')))">
                    a.contractStartDate,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('contractEndDate') or colPickMode == 1 and data.containsKey('contractEndDate')))">
                    a.contractEndDate,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('contractCompany') or colPickMode == 1 and data.containsKey('contractCompany')))">
                    a.contractCompany,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('contractType') or colPickMode == 1 and data.containsKey('contractType')))">
                    a.contractType,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('newStartDate') or colPickMode == 1 and data.containsKey('newStartDate')))">
                    a.newStartDate,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('newEndDate') or colPickMode == 1 and data.containsKey('newEndDate')))">
                    a.newEndDate,
                </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>
                <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>
        </trim>
    </sql>
    <!-- 新增 区分主键自增加还是业务插入 -->
    <insert id="insert" parameterType="StaffContractEntity"  useGeneratedKeys="true" keyProperty="id">
        insert into mortals_xhx_staff_contract
        (staffId,staffName,gender,birthday,photoPath,phoneNumber,idCard,workNum,politicalstatus,deptId,deptName,jobId,jobName,staffType,status,entryDate,contractStartDate,contractEndDate,contractCompany,contractType,newStartDate,newEndDate,auditStatus,createUserId,createTime,updateUserId,updateTime)
        VALUES
        (#{staffId},#{staffName},#{gender},#{birthday},#{photoPath},#{phoneNumber},#{idCard},#{workNum},#{politicalstatus},#{deptId},#{deptName},#{jobId},#{jobName},#{staffType},#{status},#{entryDate},#{contractStartDate},#{contractEndDate},#{contractCompany},#{contractType},#{newStartDate},#{newEndDate},#{auditStatus},#{createUserId},#{createTime},#{updateUserId},#{updateTime})
    </insert>

    <!-- 批量新增 -->
    <insert id="insertBatch" parameterType="paramDto">
        insert into mortals_xhx_staff_contract
        (staffId,staffName,gender,birthday,photoPath,phoneNumber,idCard,workNum,politicalstatus,deptId,deptName,jobId,jobName,staffType,status,entryDate,contractStartDate,contractEndDate,contractCompany,contractType,newStartDate,newEndDate,auditStatus,createUserId,createTime,updateUserId,updateTime)
        VALUES
        <foreach collection="data.dataList" item="item" index="index" separator="," >
            (#{item.staffId},#{item.staffName},#{item.gender},#{item.birthday},#{item.photoPath},#{item.phoneNumber},#{item.idCard},#{item.workNum},#{item.politicalstatus},#{item.deptId},#{item.deptName},#{item.jobId},#{item.jobName},#{item.staffType},#{item.status},#{item.entryDate},#{item.contractStartDate},#{item.contractEndDate},#{item.contractCompany},#{item.contractType},#{item.newStartDate},#{item.newEndDate},#{item.auditStatus},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime})
        </foreach>
    </insert>


    <!-- 根据ParamDto更新 -->
    <update id="update" parameterType="paramDto">
        update mortals_xhx_staff_contract 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('gender')) or (colPickMode==1 and !data.containsKey('gender'))">
                a.gender=#{data.gender},
            </if>
            <if test="(colPickMode==0 and data.containsKey('genderIncrement')) or (colPickMode==1 and !data.containsKey('genderIncrement'))">
                a.gender=ifnull(a.gender,0) + #{data.genderIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('birthday')) or (colPickMode==1 and !data.containsKey('birthday'))">
                a.birthday=#{data.birthday},
            </if>
            <if test="(colPickMode==0 and data.containsKey('photoPath')) or (colPickMode==1 and !data.containsKey('photoPath'))">
                a.photoPath=#{data.photoPath},
            </if>
            <if test="(colPickMode==0 and data.containsKey('phoneNumber')) or (colPickMode==1 and !data.containsKey('phoneNumber'))">
                a.phoneNumber=#{data.phoneNumber},
            </if>
            <if test="(colPickMode==0 and data.containsKey('idCard')) or (colPickMode==1 and !data.containsKey('idCard'))">
                a.idCard=#{data.idCard},
            </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('politicalstatus')) or (colPickMode==1 and !data.containsKey('politicalstatus'))">
                a.politicalstatus=#{data.politicalstatus},
            </if>
            <if test="(colPickMode==0 and data.containsKey('politicalstatusIncrement')) or (colPickMode==1 and !data.containsKey('politicalstatusIncrement'))">
                a.politicalstatus=ifnull(a.politicalstatus,0) + #{data.politicalstatusIncrement},
            </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('jobId')) or (colPickMode==1 and !data.containsKey('jobId'))">
                a.jobId=#{data.jobId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('jobIdIncrement')) or (colPickMode==1 and !data.containsKey('jobIdIncrement'))">
                a.jobId=ifnull(a.jobId,0) + #{data.jobIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('jobName')) or (colPickMode==1 and !data.containsKey('jobName'))">
                a.jobName=#{data.jobName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('staffType')) or (colPickMode==1 and !data.containsKey('staffType'))">
                a.staffType=#{data.staffType},
            </if>
            <if test="(colPickMode==0 and data.containsKey('staffTypeIncrement')) or (colPickMode==1 and !data.containsKey('staffTypeIncrement'))">
                a.staffType=ifnull(a.staffType,0) + #{data.staffTypeIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('status')) or (colPickMode==1 and !data.containsKey('status'))">
                a.status=#{data.status},
            </if>
            <if test="(colPickMode==0 and data.containsKey('statusIncrement')) or (colPickMode==1 and !data.containsKey('statusIncrement'))">
                a.status=ifnull(a.status,0) + #{data.statusIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('entryDate')) or (colPickMode==1 and !data.containsKey('entryDate'))">
                a.entryDate=#{data.entryDate},
            </if>
            <if test="(colPickMode==0 and data.containsKey('contractStartDate')) or (colPickMode==1 and !data.containsKey('contractStartDate'))">
                a.contractStartDate=#{data.contractStartDate},
            </if>
            <if test="(colPickMode==0 and data.containsKey('contractEndDate')) or (colPickMode==1 and !data.containsKey('contractEndDate'))">
                a.contractEndDate=#{data.contractEndDate},
            </if>
            <if test="(colPickMode==0 and data.containsKey('contractCompany')) or (colPickMode==1 and !data.containsKey('contractCompany'))">
                a.contractCompany=#{data.contractCompany},
            </if>
            <if test="(colPickMode==0 and data.containsKey('contractType')) or (colPickMode==1 and !data.containsKey('contractType'))">
                a.contractType=#{data.contractType},
            </if>
            <if test="(colPickMode==0 and data.containsKey('contractTypeIncrement')) or (colPickMode==1 and !data.containsKey('contractTypeIncrement'))">
                a.contractType=ifnull(a.contractType,0) + #{data.contractTypeIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('newStartDate')) or (colPickMode==1 and !data.containsKey('newStartDate'))">
                a.newStartDate=#{data.newStartDate},
            </if>
            <if test="(colPickMode==0 and data.containsKey('newEndDate')) or (colPickMode==1 and !data.containsKey('newEndDate'))">
                a.newEndDate=#{data.newEndDate},
            </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>
            <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>
        </trim>
        <trim suffixOverrides="where" suffix="">
            where
            <trim prefixOverrides="and" prefix="">
                <include refid="_condition_"/>
            </trim>
        </trim>
    </update>
    <!-- 批量更新 -->
    <update id="updateBatch" parameterType="paramDto">
        update mortals_xhx_staff_contract 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="gender=(case" suffix="ELSE gender end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('gender')) or (colPickMode==1 and !item.containsKey('gender'))">
                                        when a.id=#{item.id} then #{item.gender}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('genderIncrement')) or (colPickMode==1 and !item.containsKey('genderIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.gender,0) + #{item.genderIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                <trim prefix="birthday=(case" suffix="ELSE birthday end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('birthday')) or (colPickMode==1 and !item.containsKey('birthday'))">
                            when a.id=#{item.id} then #{item.birthday}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="photoPath=(case" suffix="ELSE photoPath end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('photoPath')) or (colPickMode==1 and !item.containsKey('photoPath'))">
                            when a.id=#{item.id} then #{item.photoPath}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="phoneNumber=(case" suffix="ELSE phoneNumber end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('phoneNumber')) or (colPickMode==1 and !item.containsKey('phoneNumber'))">
                            when a.id=#{item.id} then #{item.phoneNumber}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="idCard=(case" suffix="ELSE idCard end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('idCard')) or (colPickMode==1 and !item.containsKey('idCard'))">
                            when a.id=#{item.id} then #{item.idCard}
                        </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="politicalstatus=(case" suffix="ELSE politicalstatus end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('politicalstatus')) or (colPickMode==1 and !item.containsKey('politicalstatus'))">
                                        when a.id=#{item.id} then #{item.politicalstatus}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('politicalstatusIncrement')) or (colPickMode==1 and !item.containsKey('politicalstatusIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.politicalstatus,0) + #{item.politicalstatusIncrement}
                                    </when>
                                </choose>
                            </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="jobId=(case" suffix="ELSE jobId end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('jobId')) or (colPickMode==1 and !item.containsKey('jobId'))">
                                        when a.id=#{item.id} then #{item.jobId}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('jobIdIncrement')) or (colPickMode==1 and !item.containsKey('jobIdIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.jobId,0) + #{item.jobIdIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                <trim prefix="jobName=(case" suffix="ELSE jobName end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('jobName')) or (colPickMode==1 and !item.containsKey('jobName'))">
                            when a.id=#{item.id} then #{item.jobName}
                        </if>
                    </foreach>
                </trim>
                        <trim prefix="staffType=(case" suffix="ELSE staffType end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('staffType')) or (colPickMode==1 and !item.containsKey('staffType'))">
                                        when a.id=#{item.id} then #{item.staffType}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('staffTypeIncrement')) or (colPickMode==1 and !item.containsKey('staffTypeIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.staffType,0) + #{item.staffTypeIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                        <trim prefix="status=(case" suffix="ELSE status end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('status')) or (colPickMode==1 and !item.containsKey('status'))">
                                        when a.id=#{item.id} then #{item.status}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('statusIncrement')) or (colPickMode==1 and !item.containsKey('statusIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.status,0) + #{item.statusIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                <trim prefix="entryDate=(case" suffix="ELSE entryDate end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('entryDate')) or (colPickMode==1 and !item.containsKey('entryDate'))">
                            when a.id=#{item.id} then #{item.entryDate}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="contractStartDate=(case" suffix="ELSE contractStartDate end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('contractStartDate')) or (colPickMode==1 and !item.containsKey('contractStartDate'))">
                            when a.id=#{item.id} then #{item.contractStartDate}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="contractEndDate=(case" suffix="ELSE contractEndDate end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('contractEndDate')) or (colPickMode==1 and !item.containsKey('contractEndDate'))">
                            when a.id=#{item.id} then #{item.contractEndDate}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="contractCompany=(case" suffix="ELSE contractCompany end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('contractCompany')) or (colPickMode==1 and !item.containsKey('contractCompany'))">
                            when a.id=#{item.id} then #{item.contractCompany}
                        </if>
                    </foreach>
                </trim>
                        <trim prefix="contractType=(case" suffix="ELSE contractType end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('contractType')) or (colPickMode==1 and !item.containsKey('contractType'))">
                                        when a.id=#{item.id} then #{item.contractType}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('contractTypeIncrement')) or (colPickMode==1 and !item.containsKey('contractTypeIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.contractType,0) + #{item.contractTypeIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                <trim prefix="newStartDate=(case" suffix="ELSE newStartDate end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('newStartDate')) or (colPickMode==1 and !item.containsKey('newStartDate'))">
                            when a.id=#{item.id} then #{item.newStartDate}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="newEndDate=(case" suffix="ELSE newEndDate end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('newEndDate')) or (colPickMode==1 and !item.containsKey('newEndDate'))">
                            when a.id=#{item.id} then #{item.newEndDate}
                        </if>
                    </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 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>
        where id in
        <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
            #{item.id}
        </foreach>
    </update>
    <!-- 根据主健查询 -->
    <select id="getByKey" parameterType="paramDto" resultMap="StaffContractEntity-Map">
        select <include refid="_columns"/>
        from mortals_xhx_staff_contract as a
        where a.id=#{condition.id}
    </select>
    <!-- 根据主健删除 -->
    <delete id="deleteByKey" parameterType="paramDto">
        delete a.* from mortals_xhx_staff_contract as a where a.id=#{condition.id}
    </delete>
    <!-- 根据主健删除一批，针对单一主健有效 -->
    <delete id="deleteByKeys">
        delete from mortals_xhx_staff_contract where id in
        <foreach collection="array" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>
    <!-- 根据主健列表删除一批，针对单一主健有效 -->
    <delete id="deleteByKeyList">
        delete from mortals_xhx_staff_contract where id in
        <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>

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


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

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

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

            <if test="conditionParamRef.containsKey('idCard')">
                <if test="conditionParamRef.idCard != null and conditionParamRef.idCard != ''">
                    ${_conditionType_} a.idCard like #{${_conditionParam_}.idCard}
                </if>
                <if test="conditionParamRef.idCard == null">
                    ${_conditionType_} a.idCard is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('idCardList')">
                ${_conditionType_} a.idCard in
                <foreach collection="conditionParamRef.idCardList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('idCardNotList')">
                ${_conditionType_} a.idCard not in
                <foreach collection="conditionParamRef.idCardNotList" 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')">
                ${_conditionType_} a.workNum in
                <foreach collection="conditionParamRef.workNumList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('workNumNotList')">
                ${_conditionType_} a.workNum not in
                <foreach collection="conditionParamRef.workNumNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('politicalstatus')">
                <if test="conditionParamRef.politicalstatus != null ">
                    ${_conditionType_} a.politicalstatus = #{${_conditionParam_}.politicalstatus}
                </if>
                <if test="conditionParamRef.politicalstatus == null">
                    ${_conditionType_} a.politicalstatus is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('politicalstatusList')">
                ${_conditionType_} a.politicalstatus in
                <foreach collection="conditionParamRef.politicalstatusList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('politicalstatusNotList')">
                ${_conditionType_} a.politicalstatus not in
                <foreach collection="conditionParamRef.politicalstatusNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('politicalstatusStart') and conditionParamRef.politicalstatusStart != null">
                ${_conditionType_} a.politicalstatus <![CDATA[ >= ]]> #{${_conditionParam_}.politicalstatusStart}
            </if>
            <if test="conditionParamRef.containsKey('politicalstatusEnd') and conditionParamRef.politicalstatusEnd != null">
                ${_conditionType_} a.politicalstatus <![CDATA[ <= ]]> #{${_conditionParam_}.politicalstatusEnd}
            </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')">
                ${_conditionType_} a.deptId in
                <foreach collection="conditionParamRef.deptIdList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('deptIdNotList')">
                ${_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')">
                ${_conditionType_} a.deptName in
                <foreach collection="conditionParamRef.deptNameList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('deptNameNotList')">
                ${_conditionType_} a.deptName not in
                <foreach collection="conditionParamRef.deptNameNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('jobId')">
                <if test="conditionParamRef.jobId != null ">
                    ${_conditionType_} a.jobId = #{${_conditionParam_}.jobId}
                </if>
                <if test="conditionParamRef.jobId == null">
                    ${_conditionType_} a.jobId is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('jobIdList')">
                ${_conditionType_} a.jobId in
                <foreach collection="conditionParamRef.jobIdList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('jobIdNotList')">
                ${_conditionType_} a.jobId not in
                <foreach collection="conditionParamRef.jobIdNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('jobIdStart') and conditionParamRef.jobIdStart != null">
                ${_conditionType_} a.jobId <![CDATA[ >= ]]> #{${_conditionParam_}.jobIdStart}
            </if>
            <if test="conditionParamRef.containsKey('jobIdEnd') and conditionParamRef.jobIdEnd != null">
                ${_conditionType_} a.jobId <![CDATA[ <= ]]> #{${_conditionParam_}.jobIdEnd}
            </if>


            <if test="conditionParamRef.containsKey('jobName')">
                <if test="conditionParamRef.jobName != null and conditionParamRef.jobName != ''">
                    ${_conditionType_} a.jobName like #{${_conditionParam_}.jobName}
                </if>
                <if test="conditionParamRef.jobName == null">
                    ${_conditionType_} a.jobName is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('jobNameList')">
                ${_conditionType_} a.jobName in
                <foreach collection="conditionParamRef.jobNameList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('jobNameNotList')">
                ${_conditionType_} a.jobName not in
                <foreach collection="conditionParamRef.jobNameNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('staffType')">
                <if test="conditionParamRef.staffType != null ">
                    ${_conditionType_} a.staffType = #{${_conditionParam_}.staffType}
                </if>
                <if test="conditionParamRef.staffType == null">
                    ${_conditionType_} a.staffType is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('staffTypeList')">
                ${_conditionType_} a.staffType in
                <foreach collection="conditionParamRef.staffTypeList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('staffTypeNotList')">
                ${_conditionType_} a.staffType not in
                <foreach collection="conditionParamRef.staffTypeNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('staffTypeStart') and conditionParamRef.staffTypeStart != null">
                ${_conditionType_} a.staffType <![CDATA[ >= ]]> #{${_conditionParam_}.staffTypeStart}
            </if>
            <if test="conditionParamRef.containsKey('staffTypeEnd') and conditionParamRef.staffTypeEnd != null">
                ${_conditionType_} a.staffType <![CDATA[ <= ]]> #{${_conditionParam_}.staffTypeEnd}
            </if>

            <if test="conditionParamRef.containsKey('status')">
                <if test="conditionParamRef.status != null ">
                    ${_conditionType_} a.status = #{${_conditionParam_}.status}
                </if>
                <if test="conditionParamRef.status == null">
                    ${_conditionType_} a.status is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('statusList')">
                ${_conditionType_} a.status in
                <foreach collection="conditionParamRef.statusList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('statusNotList')">
                ${_conditionType_} a.status not in
                <foreach collection="conditionParamRef.statusNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('statusStart') and conditionParamRef.statusStart != null">
                ${_conditionType_} a.status <![CDATA[ >= ]]> #{${_conditionParam_}.statusStart}
            </if>
            <if test="conditionParamRef.containsKey('statusEnd') and conditionParamRef.statusEnd != null">
                ${_conditionType_} a.status <![CDATA[ <= ]]> #{${_conditionParam_}.statusEnd}
            </if>


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

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

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

            <if test="conditionParamRef.containsKey('contractCompany')">
                <if test="conditionParamRef.contractCompany != null and conditionParamRef.contractCompany != ''">
                    ${_conditionType_} a.contractCompany like #{${_conditionParam_}.contractCompany}
                </if>
                <if test="conditionParamRef.contractCompany == null">
                    ${_conditionType_} a.contractCompany is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('contractCompanyList')">
                ${_conditionType_} a.contractCompany in
                <foreach collection="conditionParamRef.contractCompanyList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('contractCompanyNotList')">
                ${_conditionType_} a.contractCompany not in
                <foreach collection="conditionParamRef.contractCompanyNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('contractType')">
                <if test="conditionParamRef.contractType != null ">
                    ${_conditionType_} a.contractType = #{${_conditionParam_}.contractType}
                </if>
                <if test="conditionParamRef.contractType == null">
                    ${_conditionType_} a.contractType is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('contractTypeList')">
                ${_conditionType_} a.contractType in
                <foreach collection="conditionParamRef.contractTypeList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('contractTypeNotList')">
                ${_conditionType_} a.contractType not in
                <foreach collection="conditionParamRef.contractTypeNotList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('contractTypeStart') and conditionParamRef.contractTypeStart != null">
                ${_conditionType_} a.contractType <![CDATA[ >= ]]> #{${_conditionParam_}.contractTypeStart}
            </if>
            <if test="conditionParamRef.containsKey('contractTypeEnd') and conditionParamRef.contractTypeEnd != null">
                ${_conditionType_} a.contractType <![CDATA[ <= ]]> #{${_conditionParam_}.contractTypeEnd}
            </if>


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

            <if test="conditionParamRef.containsKey('newEndDate')">
                <if test="conditionParamRef.newEndDate != null ">
                    ${_conditionType_} a.newEndDate = #{${_conditionParam_}.newEndDate}
                </if>
                <if test="conditionParamRef.newEndDate == null">
                    ${_conditionType_} a.newEndDate is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('newEndDateStart') and conditionParamRef.newEndDateStart != null and conditionParamRef.newEndDateStart!=''">
                ${_conditionType_} a.newEndDate <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.newEndDateStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
            </if>
            <if test="conditionParamRef.containsKey('newEndDateEnd') and conditionParamRef.newEndDateEnd != null and conditionParamRef.newEndDateEnd!=''">
                ${_conditionType_} a.newEndDate <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.newEndDateEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
            </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')">
                ${_conditionType_} a.auditStatus in
                <foreach collection="conditionParamRef.auditStatusList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('auditStatusNotList')">
                ${_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>

            <if test="conditionParamRef.containsKey('createUserId')">
                <if test="conditionParamRef.createUserId != null ">
                    ${_conditionType_} a.createUserId = #{${_conditionParam_}.createUserId}
                </if>
                <if test="conditionParamRef.createUserId == null">
                    ${_conditionType_} a.createUserId is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('createUserIdList')">
                ${_conditionType_} a.createUserId in
                <foreach collection="conditionParamRef.createUserIdList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('createUserIdNotList')">
                ${_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')">
                ${_conditionType_} a.updateUserId in
                <foreach collection="conditionParamRef.updateUserIdList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('updateUserIdNotList')">
                ${_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>
    </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('gender')">
                        a.gender
                        <if test='orderCol.gender != null and "DESC".equalsIgnoreCase(orderCol.gender)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('birthday')">
                        a.birthday
                        <if test='orderCol.birthday != null and "DESC".equalsIgnoreCase(orderCol.birthday)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('photoPath')">
                        a.photoPath
                        <if test='orderCol.photoPath != null and "DESC".equalsIgnoreCase(orderCol.photoPath)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('phoneNumber')">
                        a.phoneNumber
                        <if test='orderCol.phoneNumber != null and "DESC".equalsIgnoreCase(orderCol.phoneNumber)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('idCard')">
                        a.idCard
                        <if test='orderCol.idCard != null and "DESC".equalsIgnoreCase(orderCol.idCard)'>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('politicalstatus')">
                        a.politicalstatus
                        <if test='orderCol.politicalstatus != null and "DESC".equalsIgnoreCase(orderCol.politicalstatus)'>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('jobId')">
                        a.jobId
                        <if test='orderCol.jobId != null and "DESC".equalsIgnoreCase(orderCol.jobId)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('jobName')">
                        a.jobName
                        <if test='orderCol.jobName != null and "DESC".equalsIgnoreCase(orderCol.jobName)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('staffType')">
                        a.staffType
                        <if test='orderCol.staffType != null and "DESC".equalsIgnoreCase(orderCol.staffType)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('status')">
                        a.status
                        <if test='orderCol.status != null and "DESC".equalsIgnoreCase(orderCol.status)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('entryDate')">
                        a.entryDate
                        <if test='orderCol.entryDate != null and "DESC".equalsIgnoreCase(orderCol.entryDate)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('contractStartDate')">
                        a.contractStartDate
                        <if test='orderCol.contractStartDate != null and "DESC".equalsIgnoreCase(orderCol.contractStartDate)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('contractEndDate')">
                        a.contractEndDate
                        <if test='orderCol.contractEndDate != null and "DESC".equalsIgnoreCase(orderCol.contractEndDate)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('contractCompany')">
                        a.contractCompany
                        <if test='orderCol.contractCompany != null and "DESC".equalsIgnoreCase(orderCol.contractCompany)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('contractType')">
                        a.contractType
                        <if test='orderCol.contractType != null and "DESC".equalsIgnoreCase(orderCol.contractType)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('newStartDate')">
                        a.newStartDate
                        <if test='orderCol.newStartDate != null and "DESC".equalsIgnoreCase(orderCol.newStartDate)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('newEndDate')">
                        a.newEndDate
                        <if test='orderCol.newEndDate != null and "DESC".equalsIgnoreCase(orderCol.newEndDate)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('auditStatus')">
                        a.auditStatus
                        <if test='orderCol.auditStatus != null and "DESC".equalsIgnoreCase(orderCol.auditStatus)'>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>
            </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>