<?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.PerformPerposeDaoImpl">

    <!-- 字段和属性映射 -->
    <resultMap type="PerformPerposeEntity" id="PerformPerposeEntity-Map">
        <id  property="id" column="id" />
        <result property="ownerId" column="ownerId" />
        <result property="ownerName" column="ownerName" />
        <result property="staffId" column="staffId" />
        <result property="assessmentType" column="assessmentType" />
        <result property="assessmentScope" column="assessmentScope" />
        <result property="compareScope" column="compareScope" />
        <result property="ratio" column="ratio" />
        <result property="periodType" column="periodType" />
        <result property="year" column="year" />
        <result property="month" column="month" />
        <result property="halfYear" column="halfYear" />
        <result property="quarter" column="quarter" />
        <result property="leaders" column="leaders" />
        <result property="leaderMobiles" column="leaderMobiles" />
        <result property="remark" column="remark" />
        <result property="createTime" column="createTime" />
        <result property="createUserId" column="createUserId" />
        <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('ownerId') or colPickMode == 1 and data.containsKey('ownerId')))">
                a.ownerId,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('ownerName') or colPickMode == 1 and data.containsKey('ownerName')))">
                a.ownerName,
            </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('assessmentType') or colPickMode == 1 and data.containsKey('assessmentType')))">
                a.assessmentType,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('assessmentScope') or colPickMode == 1 and data.containsKey('assessmentScope')))">
                a.assessmentScope,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('compareScope') or colPickMode == 1 and data.containsKey('compareScope')))">
                a.compareScope,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('ratio') or colPickMode == 1 and data.containsKey('ratio')))">
                a.ratio,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('periodType') or colPickMode == 1 and data.containsKey('periodType')))">
                a.periodType,
            </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('halfYear') or colPickMode == 1 and data.containsKey('halfYear')))">
                a.halfYear,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('quarter') or colPickMode == 1 and data.containsKey('quarter')))">
                a.quarter,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('leaders') or colPickMode == 1 and data.containsKey('leaders')))">
                a.leaders,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('leaderMobiles') or colPickMode == 1 and data.containsKey('leaderMobiles')))">
                a.leaderMobiles,
            </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('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('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="PerformPerposeEntity"  useGeneratedKeys="true" keyProperty="id">
        insert into mortals_xhx_perform_perpose
        (ownerId,ownerName,staffId,assessmentType,assessmentScope,compareScope,ratio,periodType,year,month,halfYear,quarter,leaders,leaderMobiles,remark,createTime,createUserId,updateUserId,updateTime)
        VALUES
        (#{ownerId},#{ownerName},#{staffId},#{assessmentType},#{assessmentScope},#{compareScope},#{ratio},#{periodType},#{year},#{month},#{halfYear},#{quarter},#{leaders},#{leaderMobiles},#{remark},#{createTime},#{createUserId},#{updateUserId},#{updateTime})
    </insert>

    <!-- 批量新增 -->
    <insert id="insertBatch" parameterType="paramDto">
        insert into mortals_xhx_perform_perpose
        (ownerId,ownerName,staffId,assessmentType,assessmentScope,compareScope,ratio,periodType,year,month,halfYear,quarter,leaders,leaderMobiles,remark,createTime,createUserId,updateUserId,updateTime)
        VALUES
        <foreach collection="data.dataList" item="item" index="index" separator="," >
            (#{item.ownerId},#{item.ownerName},#{item.staffId},#{item.assessmentType},#{item.assessmentScope},#{item.compareScope},#{item.ratio},#{item.periodType},#{item.year},#{item.month},#{item.halfYear},#{item.quarter},#{item.leaders},#{item.leaderMobiles},#{item.remark},#{item.createTime},#{item.createUserId},#{item.updateUserId},#{item.updateTime})
        </foreach>
    </insert>


    <!-- 根据ParamDto更新 -->
    <update id="update" parameterType="paramDto">
        update mortals_xhx_perform_perpose as a
        set
        <trim suffixOverrides="," suffix="">
            <if test="(colPickMode==0 and data.containsKey('ownerId')) or (colPickMode==1 and !data.containsKey('ownerId'))">
                a.ownerId=#{data.ownerId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('ownerIdIncrement')) or (colPickMode==1 and !data.containsKey('ownerIdIncrement'))">
                a.ownerId=ifnull(a.ownerId,0) + #{data.ownerIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('ownerName')) or (colPickMode==1 and !data.containsKey('ownerName'))">
                a.ownerName=#{data.ownerName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('staffId')) or (colPickMode==1 and !data.containsKey('staffId'))">
                a.staffId=#{data.staffId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('staffIdIncrement')) or (colPickMode==1 and !data.containsKey('staffIdIncrement'))">
                a.staffId=ifnull(a.staffId,0) + #{data.staffIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('assessmentType')) or (colPickMode==1 and !data.containsKey('assessmentType'))">
                a.assessmentType=#{data.assessmentType},
            </if>
            <if test="(colPickMode==0 and data.containsKey('assessmentTypeIncrement')) or (colPickMode==1 and !data.containsKey('assessmentTypeIncrement'))">
                a.assessmentType=ifnull(a.assessmentType,0) + #{data.assessmentTypeIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('assessmentScope')) or (colPickMode==1 and !data.containsKey('assessmentScope'))">
                a.assessmentScope=#{data.assessmentScope},
            </if>
            <if test="(colPickMode==0 and data.containsKey('assessmentScopeIncrement')) or (colPickMode==1 and !data.containsKey('assessmentScopeIncrement'))">
                a.assessmentScope=ifnull(a.assessmentScope,0) + #{data.assessmentScopeIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('compareScope')) or (colPickMode==1 and !data.containsKey('compareScope'))">
                a.compareScope=#{data.compareScope},
            </if>
            <if test="(colPickMode==0 and data.containsKey('compareScopeIncrement')) or (colPickMode==1 and !data.containsKey('compareScopeIncrement'))">
                a.compareScope=ifnull(a.compareScope,0) + #{data.compareScopeIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('ratio')) or (colPickMode==1 and !data.containsKey('ratio'))">
                a.ratio=#{data.ratio},
            </if>
            <if test="(colPickMode==0 and data.containsKey('ratioIncrement')) or (colPickMode==1 and !data.containsKey('ratioIncrement'))">
                a.ratio=ifnull(a.ratio,0) + #{data.ratioIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('periodType')) or (colPickMode==1 and !data.containsKey('periodType'))">
                a.periodType=#{data.periodType},
            </if>
            <if test="(colPickMode==0 and data.containsKey('periodTypeIncrement')) or (colPickMode==1 and !data.containsKey('periodTypeIncrement'))">
                a.periodType=ifnull(a.periodType,0) + #{data.periodTypeIncrement},
            </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('halfYear')) or (colPickMode==1 and !data.containsKey('halfYear'))">
                a.halfYear=#{data.halfYear},
            </if>
            <if test="(colPickMode==0 and data.containsKey('halfYearIncrement')) or (colPickMode==1 and !data.containsKey('halfYearIncrement'))">
                a.halfYear=ifnull(a.halfYear,0) + #{data.halfYearIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('quarter')) or (colPickMode==1 and !data.containsKey('quarter'))">
                a.quarter=#{data.quarter},
            </if>
            <if test="(colPickMode==0 and data.containsKey('quarterIncrement')) or (colPickMode==1 and !data.containsKey('quarterIncrement'))">
                a.quarter=ifnull(a.quarter,0) + #{data.quarterIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('leaders')) or (colPickMode==1 and !data.containsKey('leaders'))">
                a.leaders=#{data.leaders},
            </if>
            <if test="(colPickMode==0 and data.containsKey('leaderMobiles')) or (colPickMode==1 and !data.containsKey('leaderMobiles'))">
                a.leaderMobiles=#{data.leaderMobiles},
            </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('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('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_perform_perpose as a
        <trim prefix="set" suffixOverrides=",">
            <trim prefix="ownerId=(case" suffix="ELSE ownerId end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('ownerId')) or (colPickMode==1 and !item.containsKey('ownerId'))">
                            when a.id=#{item.id} then #{item.ownerId}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('ownerIdIncrement')) or (colPickMode==1 and !item.containsKey('ownerIdIncrement'))">
                            when a.id=#{item.id} then ifnull(a.ownerId,0) + #{item.ownerIdIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="ownerName=(case" suffix="ELSE ownerName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('ownerName')) or (colPickMode==1 and !item.containsKey('ownerName'))">
                        when a.id=#{item.id} then #{item.ownerName}
                    </if>
                </foreach>
            </trim>
            <trim prefix="staffId=(case" suffix="ELSE staffId end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('staffId')) or (colPickMode==1 and !item.containsKey('staffId'))">
                            when a.id=#{item.id} then #{item.staffId}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('staffIdIncrement')) or (colPickMode==1 and !item.containsKey('staffIdIncrement'))">
                            when a.id=#{item.id} then ifnull(a.staffId,0) + #{item.staffIdIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="assessmentType=(case" suffix="ELSE assessmentType end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('assessmentType')) or (colPickMode==1 and !item.containsKey('assessmentType'))">
                            when a.id=#{item.id} then #{item.assessmentType}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('assessmentTypeIncrement')) or (colPickMode==1 and !item.containsKey('assessmentTypeIncrement'))">
                            when a.id=#{item.id} then ifnull(a.assessmentType,0) + #{item.assessmentTypeIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="assessmentScope=(case" suffix="ELSE assessmentScope end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('assessmentScope')) or (colPickMode==1 and !item.containsKey('assessmentScope'))">
                            when a.id=#{item.id} then #{item.assessmentScope}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('assessmentScopeIncrement')) or (colPickMode==1 and !item.containsKey('assessmentScopeIncrement'))">
                            when a.id=#{item.id} then ifnull(a.assessmentScope,0) + #{item.assessmentScopeIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="compareScope=(case" suffix="ELSE compareScope end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('compareScope')) or (colPickMode==1 and !item.containsKey('compareScope'))">
                            when a.id=#{item.id} then #{item.compareScope}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('compareScopeIncrement')) or (colPickMode==1 and !item.containsKey('compareScopeIncrement'))">
                            when a.id=#{item.id} then ifnull(a.compareScope,0) + #{item.compareScopeIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="ratio=(case" suffix="ELSE ratio end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('ratio')) or (colPickMode==1 and !item.containsKey('ratio'))">
                            when a.id=#{item.id} then #{item.ratio}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('ratioIncrement')) or (colPickMode==1 and !item.containsKey('ratioIncrement'))">
                            when a.id=#{item.id} then ifnull(a.ratio,0) + #{item.ratioIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="periodType=(case" suffix="ELSE periodType end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('periodType')) or (colPickMode==1 and !item.containsKey('periodType'))">
                            when a.id=#{item.id} then #{item.periodType}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('periodTypeIncrement')) or (colPickMode==1 and !item.containsKey('periodTypeIncrement'))">
                            when a.id=#{item.id} then ifnull(a.periodType,0) + #{item.periodTypeIncrement}
                        </when>
                    </choose>
                </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="halfYear=(case" suffix="ELSE halfYear end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('halfYear')) or (colPickMode==1 and !item.containsKey('halfYear'))">
                            when a.id=#{item.id} then #{item.halfYear}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('halfYearIncrement')) or (colPickMode==1 and !item.containsKey('halfYearIncrement'))">
                            when a.id=#{item.id} then ifnull(a.halfYear,0) + #{item.halfYearIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="quarter=(case" suffix="ELSE quarter end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('quarter')) or (colPickMode==1 and !item.containsKey('quarter'))">
                            when a.id=#{item.id} then #{item.quarter}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('quarterIncrement')) or (colPickMode==1 and !item.containsKey('quarterIncrement'))">
                            when a.id=#{item.id} then ifnull(a.quarter,0) + #{item.quarterIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="leaders=(case" suffix="ELSE leaders end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('leaders')) or (colPickMode==1 and !item.containsKey('leaders'))">
                        when a.id=#{item.id} then #{item.leaders}
                    </if>
                </foreach>
            </trim>
            <trim prefix="leaderMobiles=(case" suffix="ELSE leaderMobiles end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('leaderMobiles')) or (colPickMode==1 and !item.containsKey('leaderMobiles'))">
                        when a.id=#{item.id} then #{item.leaderMobiles}
                    </if>
                </foreach>
            </trim>
            <trim prefix="remark=(case" suffix="ELSE remark end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('remark')) or (colPickMode==1 and !item.containsKey('remark'))">
                        when a.id=#{item.id} then #{item.remark}
                    </if>
                </foreach>
            </trim>
            <trim prefix="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="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="PerformPerposeEntity-Map">
        select <include refid="_columns"/>
        from mortals_xhx_perform_perpose as a
        where a.id=#{condition.id}
    </select>
    <!-- 根据主健删除 -->
    <delete id="deleteByKey" parameterType="paramDto">
        delete a.* from mortals_xhx_perform_perpose as a where a.id=#{condition.id}
    </delete>
    <!-- 根据主健删除一批，针对单一主健有效 -->
    <delete id="deleteByKeys">
        delete from mortals_xhx_perform_perpose 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 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 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 as a
        <trim suffixOverrides="where" suffix="">
            where
            <trim prefixOverrides="and" prefix="">
                <include refid="_condition_"/>
            </trim>
        </trim>
    </delete>
    <!-- 获取列表 -->
    <select id="getList" parameterType="paramDto" resultMap="PerformPerposeEntity-Map">
        select <include refid="_columns"/>
        from mortals_xhx_perform_perpose 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 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('ownerId')">
            <if test="conditionParamRef.ownerId != null ">
                ${_conditionType_} a.ownerId = #{${_conditionParam_}.ownerId}
            </if>
            <if test="conditionParamRef.ownerId == null">
                ${_conditionType_} a.ownerId is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('ownerIdList') and conditionParamRef.ownerIdList.size() > 0">
            ${_conditionType_} a.ownerId in
            <foreach collection="conditionParamRef.ownerIdList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('ownerIdNotList') and conditionParamRef.ownerIdNotList.size() > 0">
            ${_conditionType_} a.ownerId not in
            <foreach collection="conditionParamRef.ownerIdNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('ownerIdStart') and conditionParamRef.ownerIdStart != null">
            ${_conditionType_} a.ownerId <![CDATA[ >= ]]> #{${_conditionParam_}.ownerIdStart}
        </if>
        <if test="conditionParamRef.containsKey('ownerIdEnd') and conditionParamRef.ownerIdEnd != null">
            ${_conditionType_} a.ownerId <![CDATA[ <= ]]> #{${_conditionParam_}.ownerIdEnd}
        </if>


        <if test="conditionParamRef.containsKey('ownerName')">
            <if test="conditionParamRef.ownerName != null and conditionParamRef.ownerName != ''">
                ${_conditionType_} a.ownerName like #{${_conditionParam_}.ownerName}
            </if>
            <if test="conditionParamRef.ownerName == null">
                ${_conditionType_} a.ownerName is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('ownerNameList') and conditionParamRef.ownerNameList.size() > 0">
            ${_conditionType_} a.ownerName in
            <foreach collection="conditionParamRef.ownerNameList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('ownerNameNotList') and conditionParamRef.ownerNameNotList.size() > 0">
            ${_conditionType_} a.ownerName not in
            <foreach collection="conditionParamRef.ownerNameNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </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('assessmentType')">
            <if test="conditionParamRef.assessmentType != null ">
                ${_conditionType_} a.assessmentType = #{${_conditionParam_}.assessmentType}
            </if>
            <if test="conditionParamRef.assessmentType == null">
                ${_conditionType_} a.assessmentType is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('assessmentTypeList') and conditionParamRef.assessmentTypeList.size() > 0">
            ${_conditionType_} a.assessmentType in
            <foreach collection="conditionParamRef.assessmentTypeList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('assessmentTypeNotList') and conditionParamRef.assessmentTypeNotList.size() > 0">
            ${_conditionType_} a.assessmentType not in
            <foreach collection="conditionParamRef.assessmentTypeNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('assessmentTypeStart') and conditionParamRef.assessmentTypeStart != null">
            ${_conditionType_} a.assessmentType <![CDATA[ >= ]]> #{${_conditionParam_}.assessmentTypeStart}
        </if>
        <if test="conditionParamRef.containsKey('assessmentTypeEnd') and conditionParamRef.assessmentTypeEnd != null">
            ${_conditionType_} a.assessmentType <![CDATA[ <= ]]> #{${_conditionParam_}.assessmentTypeEnd}
        </if>

        <if test="conditionParamRef.containsKey('assessmentScope')">
            <if test="conditionParamRef.assessmentScope != null ">
                ${_conditionType_} a.assessmentScope = #{${_conditionParam_}.assessmentScope}
            </if>
            <if test="conditionParamRef.assessmentScope == null">
                ${_conditionType_} a.assessmentScope is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('assessmentScopeList') and conditionParamRef.assessmentScopeList.size() > 0">
            ${_conditionType_} a.assessmentScope in
            <foreach collection="conditionParamRef.assessmentScopeList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('assessmentScopeNotList') and conditionParamRef.assessmentScopeNotList.size() > 0">
            ${_conditionType_} a.assessmentScope not in
            <foreach collection="conditionParamRef.assessmentScopeNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('assessmentScopeStart') and conditionParamRef.assessmentScopeStart != null">
            ${_conditionType_} a.assessmentScope <![CDATA[ >= ]]> #{${_conditionParam_}.assessmentScopeStart}
        </if>
        <if test="conditionParamRef.containsKey('assessmentScopeEnd') and conditionParamRef.assessmentScopeEnd != null">
            ${_conditionType_} a.assessmentScope <![CDATA[ <= ]]> #{${_conditionParam_}.assessmentScopeEnd}
        </if>

        <if test="conditionParamRef.containsKey('compareScope')">
            <if test="conditionParamRef.compareScope != null ">
                ${_conditionType_} a.compareScope = #{${_conditionParam_}.compareScope}
            </if>
            <if test="conditionParamRef.compareScope == null">
                ${_conditionType_} a.compareScope is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('compareScopeList') and conditionParamRef.compareScopeList.size() > 0">
            ${_conditionType_} a.compareScope in
            <foreach collection="conditionParamRef.compareScopeList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('compareScopeNotList') and conditionParamRef.compareScopeNotList.size() > 0">
            ${_conditionType_} a.compareScope not in
            <foreach collection="conditionParamRef.compareScopeNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('compareScopeStart') and conditionParamRef.compareScopeStart != null">
            ${_conditionType_} a.compareScope <![CDATA[ >= ]]> #{${_conditionParam_}.compareScopeStart}
        </if>
        <if test="conditionParamRef.containsKey('compareScopeEnd') and conditionParamRef.compareScopeEnd != null">
            ${_conditionType_} a.compareScope <![CDATA[ <= ]]> #{${_conditionParam_}.compareScopeEnd}
        </if>

        <if test="conditionParamRef.containsKey('ratio')">
            <if test="conditionParamRef.ratio != null ">
                ${_conditionType_} a.ratio = #{${_conditionParam_}.ratio}
            </if>
            <if test="conditionParamRef.ratio == null">
                ${_conditionType_} a.ratio is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('ratioList') and conditionParamRef.ratioList.size() > 0">
            ${_conditionType_} a.ratio in
            <foreach collection="conditionParamRef.ratioList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('ratioNotList') and conditionParamRef.ratioNotList.size() > 0">
            ${_conditionType_} a.ratio not in
            <foreach collection="conditionParamRef.ratioNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('ratioStart') and conditionParamRef.ratioStart != null">
            ${_conditionType_} a.ratio <![CDATA[ >= ]]> #{${_conditionParam_}.ratioStart}
        </if>
        <if test="conditionParamRef.containsKey('ratioEnd') and conditionParamRef.ratioEnd != null">
            ${_conditionType_} a.ratio <![CDATA[ <= ]]> #{${_conditionParam_}.ratioEnd}
        </if>

        <if test="conditionParamRef.containsKey('periodType')">
            <if test="conditionParamRef.periodType != null ">
                ${_conditionType_} a.periodType = #{${_conditionParam_}.periodType}
            </if>
            <if test="conditionParamRef.periodType == null">
                ${_conditionType_} a.periodType is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('periodTypeList') and conditionParamRef.periodTypeList.size() > 0">
            ${_conditionType_} a.periodType in
            <foreach collection="conditionParamRef.periodTypeList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('periodTypeNotList') and conditionParamRef.periodTypeNotList.size() > 0">
            ${_conditionType_} a.periodType not in
            <foreach collection="conditionParamRef.periodTypeNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('periodTypeStart') and conditionParamRef.periodTypeStart != null">
            ${_conditionType_} a.periodType <![CDATA[ >= ]]> #{${_conditionParam_}.periodTypeStart}
        </if>
        <if test="conditionParamRef.containsKey('periodTypeEnd') and conditionParamRef.periodTypeEnd != null">
            ${_conditionType_} a.periodType <![CDATA[ <= ]]> #{${_conditionParam_}.periodTypeEnd}
        </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('halfYear')">
            <if test="conditionParamRef.halfYear != null ">
                ${_conditionType_} a.halfYear = #{${_conditionParam_}.halfYear}
            </if>
            <if test="conditionParamRef.halfYear == null">
                ${_conditionType_} a.halfYear is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('halfYearList') and conditionParamRef.halfYearList.size() > 0">
            ${_conditionType_} a.halfYear in
            <foreach collection="conditionParamRef.halfYearList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('halfYearNotList') and conditionParamRef.halfYearNotList.size() > 0">
            ${_conditionType_} a.halfYear not in
            <foreach collection="conditionParamRef.halfYearNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('halfYearStart') and conditionParamRef.halfYearStart != null">
            ${_conditionType_} a.halfYear <![CDATA[ >= ]]> #{${_conditionParam_}.halfYearStart}
        </if>
        <if test="conditionParamRef.containsKey('halfYearEnd') and conditionParamRef.halfYearEnd != null">
            ${_conditionType_} a.halfYear <![CDATA[ <= ]]> #{${_conditionParam_}.halfYearEnd}
        </if>

        <if test="conditionParamRef.containsKey('quarter')">
            <if test="conditionParamRef.quarter != null ">
                ${_conditionType_} a.quarter = #{${_conditionParam_}.quarter}
            </if>
            <if test="conditionParamRef.quarter == null">
                ${_conditionType_} a.quarter is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('quarterList') and conditionParamRef.quarterList.size() > 0">
            ${_conditionType_} a.quarter in
            <foreach collection="conditionParamRef.quarterList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('quarterNotList') and conditionParamRef.quarterNotList.size() > 0">
            ${_conditionType_} a.quarter not in
            <foreach collection="conditionParamRef.quarterNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('quarterStart') and conditionParamRef.quarterStart != null">
            ${_conditionType_} a.quarter <![CDATA[ >= ]]> #{${_conditionParam_}.quarterStart}
        </if>
        <if test="conditionParamRef.containsKey('quarterEnd') and conditionParamRef.quarterEnd != null">
            ${_conditionType_} a.quarter <![CDATA[ <= ]]> #{${_conditionParam_}.quarterEnd}
        </if>


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

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

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

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


        <if test="conditionParamRef.containsKey('updateTime')">
            <if test="conditionParamRef.updateTime != null ">
                ${_conditionType_} a.updateTime = #{${_conditionParam_}.updateTime}
            </if>
            <if test="conditionParamRef.updateTime == null">
                ${_conditionType_} a.updateTime is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('updateTimeStart') and conditionParamRef.updateTimeStart != null and conditionParamRef.updateTimeStart!=''">
            ${_conditionType_} a.updateTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
        </if>
        <if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
            ${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
        </if>
    </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('ownerId')">
                    a.ownerId
                    <if test='orderCol.ownerId != null and "DESC".equalsIgnoreCase(orderCol.ownerId)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('ownerName')">
                    a.ownerName
                    <if test='orderCol.ownerName != null and "DESC".equalsIgnoreCase(orderCol.ownerName)'>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('assessmentType')">
                    a.assessmentType
                    <if test='orderCol.assessmentType != null and "DESC".equalsIgnoreCase(orderCol.assessmentType)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('assessmentScope')">
                    a.assessmentScope
                    <if test='orderCol.assessmentScope != null and "DESC".equalsIgnoreCase(orderCol.assessmentScope)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('compareScope')">
                    a.compareScope
                    <if test='orderCol.compareScope != null and "DESC".equalsIgnoreCase(orderCol.compareScope)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('ratio')">
                    a.ratio
                    <if test='orderCol.ratio != null and "DESC".equalsIgnoreCase(orderCol.ratio)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('periodType')">
                    a.periodType
                    <if test='orderCol.periodType != null and "DESC".equalsIgnoreCase(orderCol.periodType)'>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('halfYear')">
                    a.halfYear
                    <if test='orderCol.halfYear != null and "DESC".equalsIgnoreCase(orderCol.halfYear)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('quarter')">
                    a.quarter
                    <if test='orderCol.quarter != null and "DESC".equalsIgnoreCase(orderCol.quarter)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('leaders')">
                    a.leaders
                    <if test='orderCol.leaders != null and "DESC".equalsIgnoreCase(orderCol.leaders)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('leaderMobiles')">
                    a.leaderMobiles
                    <if test='orderCol.leaderMobiles != null and "DESC".equalsIgnoreCase(orderCol.leaderMobiles)'>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('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('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>