<?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.workman.dao.ibatis.WorkmanDaoImpl">

    <!-- 字段和属性映射 -->
    <resultMap type="WorkmanEntity" id="WorkmanEntity-Map">
            <id  property="id" column="id" />
            <result property="systemUserId" column="systemUserId" />
            <result property="deptId" column="deptId" />
            <result property="deptName" column="deptName" />
            <result property="windowId" column="windowId" />
            <result property="windowName" column="windowName" />
            <result property="siteId" column="siteId" />
            <result property="siteName" column="siteName" />
            <result property="name" column="name" />
            <result property="number" column="number" />
            <result property="userpost" column="userpost" />
            <result property="posttitle" column="posttitle" />
            <result property="politicalstatus" column="politicalstatus" />
            <result property="dangyuan" column="dangyuan" />
            <result property="phone" column="phone" />
            <result property="mobile" column="mobile" />
            <result property="starlevel" column="starlevel" />
            <result property="summary" column="summary" />
            <result property="photoPath" column="photoPath" />
            <result property="duty" column="duty" />
            <result property="promise" column="promise" />
            <result property="business" column="business" />
            <result property="online" column="online" />
            <result property="createTime" column="createTime" />
            <result property="createUserId" column="createUserId" />
            <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 as id,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('systemUserId') or colPickMode == 1 and data.containsKey('systemUserId')))">
                    a.systemUserId as systemUserId,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptId') or colPickMode == 1 and data.containsKey('deptId')))">
                    a.deptId as 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 as deptName,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('windowId') or colPickMode == 1 and data.containsKey('windowId')))">
                    a.windowId as windowId,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('windowName') or colPickMode == 1 and data.containsKey('windowName')))">
                    a.windowName as windowName,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteId') or colPickMode == 1 and data.containsKey('siteId')))">
                    a.siteId as siteId,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteName') or colPickMode == 1 and data.containsKey('siteName')))">
                    a.siteName as siteName,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('name') or colPickMode == 1 and data.containsKey('name')))">
                    a.name as name,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('number') or colPickMode == 1 and data.containsKey('number')))">
                    a.number as number,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('userpost') or colPickMode == 1 and data.containsKey('userpost')))">
                    a.userpost as userpost,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('posttitle') or colPickMode == 1 and data.containsKey('posttitle')))">
                    a.posttitle as posttitle,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('politicalstatus') or colPickMode == 1 and data.containsKey('politicalstatus')))">
                    a.politicalstatus as politicalstatus,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('dangyuan') or colPickMode == 1 and data.containsKey('dangyuan')))">
                    a.dangyuan as dangyuan,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('phone') or colPickMode == 1 and data.containsKey('phone')))">
                    a.phone as phone,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('mobile') or colPickMode == 1 and data.containsKey('mobile')))">
                    a.mobile as mobile,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('starlevel') or colPickMode == 1 and data.containsKey('starlevel')))">
                    a.starlevel as starlevel,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('summary') or colPickMode == 1 and data.containsKey('summary')))">
                    a.summary as summary,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('photoPath') or colPickMode == 1 and data.containsKey('photoPath')))">
                    a.photoPath as photoPath,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('duty') or colPickMode == 1 and data.containsKey('duty')))">
                    a.duty as duty,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('promise') or colPickMode == 1 and data.containsKey('promise')))">
                    a.promise as promise,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('business') or colPickMode == 1 and data.containsKey('business')))">
                    a.business as business,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('online') or colPickMode == 1 and data.containsKey('online')))">
                    a.online as online,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
                    a.createTime as 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 as createUserId,
                </if>
                <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
                    a.updateTime as updateTime,
                </if>
        </trim>
    </sql>
    <!-- 新增 区分主键自增加还是业务插入 -->
    <insert id="insert" parameterType="WorkmanEntity"  useGeneratedKeys="true" keyProperty="id">
        insert into mortals_sys_workman
        (systemUserId,deptId,deptName,windowId,windowName,siteId,siteName,name,number,userpost,posttitle,politicalstatus,dangyuan,phone,mobile,starlevel,summary,photoPath,duty,promise,business,online,createTime,createUserId,updateTime)
        VALUES
        (#{systemUserId},#{deptId},#{deptName},#{windowId},#{windowName},#{siteId},#{siteName},#{name},#{number},#{userpost},#{posttitle},#{politicalstatus},#{dangyuan},#{phone},#{mobile},#{starlevel},#{summary},#{photoPath},#{duty},#{promise},#{business},#{online},#{createTime},#{createUserId},#{updateTime})
    </insert>

    <!-- 批量新增 -->
    <insert id="insertBatch" parameterType="paramDto">
        insert into mortals_sys_workman
        (systemUserId,deptId,deptName,windowId,windowName,siteId,siteName,name,number,userpost,posttitle,politicalstatus,dangyuan,phone,mobile,starlevel,summary,photoPath,duty,promise,business,online,createTime,createUserId,updateTime)
        VALUES
        <foreach collection="data.dataList" item="item" index="index" separator="," >
            (#{item.systemUserId},#{item.deptId},#{item.deptName},#{item.windowId},#{item.windowName},#{item.siteId},#{item.siteName},#{item.name},#{item.number},#{item.userpost},#{item.posttitle},#{item.politicalstatus},#{item.dangyuan},#{item.phone},#{item.mobile},#{item.starlevel},#{item.summary},#{item.photoPath},#{item.duty},#{item.promise},#{item.business},#{item.online},#{item.createTime},#{item.createUserId},#{item.updateTime})
        </foreach>
    </insert>


    <!-- 根据ParamDto更新 -->
    <update id="update" parameterType="paramDto">
        update mortals_sys_workman as a
        set
        <trim suffixOverrides="," suffix="">
            <if test="(colPickMode==0 and data.containsKey('systemUserId')) or (colPickMode==1 and !data.containsKey('systemUserId'))">
                a.systemUserId=#{data.systemUserId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('systemUserIdIncrement')) or (colPickMode==1 and !data.containsKey('systemUserIdIncrement'))">
                a.systemUserId=ifnull(a.systemUserId,0) + #{data.systemUserIdIncrement},
            </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('windowId')) or (colPickMode==1 and !data.containsKey('windowId'))">
                a.windowId=#{data.windowId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('windowIdIncrement')) or (colPickMode==1 and !data.containsKey('windowIdIncrement'))">
                a.windowId=ifnull(a.windowId,0) + #{data.windowIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('windowName')) or (colPickMode==1 and !data.containsKey('windowName'))">
                a.windowName=#{data.windowName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('siteId')) or (colPickMode==1 and !data.containsKey('siteId'))">
                a.siteId=#{data.siteId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('siteIdIncrement')) or (colPickMode==1 and !data.containsKey('siteIdIncrement'))">
                a.siteId=ifnull(a.siteId,0) + #{data.siteIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('siteName')) or (colPickMode==1 and !data.containsKey('siteName'))">
                a.siteName=#{data.siteName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('name')) or (colPickMode==1 and !data.containsKey('name'))">
                a.name=#{data.name},
            </if>
            <if test="(colPickMode==0 and data.containsKey('number')) or (colPickMode==1 and !data.containsKey('number'))">
                a.number=#{data.number},
            </if>
            <if test="(colPickMode==0 and data.containsKey('userpost')) or (colPickMode==1 and !data.containsKey('userpost'))">
                a.userpost=#{data.userpost},
            </if>
            <if test="(colPickMode==0 and data.containsKey('posttitle')) or (colPickMode==1 and !data.containsKey('posttitle'))">
                a.posttitle=#{data.posttitle},
            </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('dangyuan')) or (colPickMode==1 and !data.containsKey('dangyuan'))">
                a.dangyuan=#{data.dangyuan},
            </if>
            <if test="(colPickMode==0 and data.containsKey('dangyuanIncrement')) or (colPickMode==1 and !data.containsKey('dangyuanIncrement'))">
                a.dangyuan=ifnull(a.dangyuan,0) + #{data.dangyuanIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('phone')) or (colPickMode==1 and !data.containsKey('phone'))">
                a.phone=#{data.phone},
            </if>
            <if test="(colPickMode==0 and data.containsKey('mobile')) or (colPickMode==1 and !data.containsKey('mobile'))">
                a.mobile=#{data.mobile},
            </if>
            <if test="(colPickMode==0 and data.containsKey('starlevel')) or (colPickMode==1 and !data.containsKey('starlevel'))">
                a.starlevel=#{data.starlevel},
            </if>
            <if test="(colPickMode==0 and data.containsKey('starlevelIncrement')) or (colPickMode==1 and !data.containsKey('starlevelIncrement'))">
                a.starlevel=ifnull(a.starlevel,0) + #{data.starlevelIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('summary')) or (colPickMode==1 and !data.containsKey('summary'))">
                a.summary=#{data.summary},
            </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('duty')) or (colPickMode==1 and !data.containsKey('duty'))">
                a.duty=#{data.duty},
            </if>
            <if test="(colPickMode==0 and data.containsKey('promise')) or (colPickMode==1 and !data.containsKey('promise'))">
                a.promise=#{data.promise},
            </if>
            <if test="(colPickMode==0 and data.containsKey('business')) or (colPickMode==1 and !data.containsKey('business'))">
                a.business=#{data.business},
            </if>
            <if test="(colPickMode==0 and data.containsKey('online')) or (colPickMode==1 and !data.containsKey('online'))">
                a.online=#{data.online},
            </if>
            <if test="(colPickMode==0 and data.containsKey('onlineIncrement')) or (colPickMode==1 and !data.containsKey('onlineIncrement'))">
                a.online=ifnull(a.online,0) + #{data.onlineIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))">
                a.createTime=#{data.createTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('createUserId')) or (colPickMode==1 and !data.containsKey('createUserId'))">
                a.createUserId=#{data.createUserId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('createUserIdIncrement')) or (colPickMode==1 and !data.containsKey('createUserIdIncrement'))">
                a.createUserId=ifnull(a.createUserId,0) + #{data.createUserIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
                a.updateTime=#{data.updateTime},
            </if>
        </trim>
        <trim suffixOverrides="where" suffix="">
            where
            <trim prefixOverrides="and" prefix="">
                <include refid="_condition_"/>
            </trim>
        </trim>
    </update>
    <!-- 批量更新 -->
    <update id="updateBatch" parameterType="paramDto">
        update mortals_sys_workman as a
        <trim prefix="set" suffixOverrides=",">
                        <trim prefix="systemUserId=(case" suffix="ELSE systemUserId end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('systemUserId')) or (colPickMode==1 and !item.containsKey('systemUserId'))">
                                        when a.id=#{item.id} then #{item.systemUserId}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('systemUserIdIncrement')) or (colPickMode==1 and !item.containsKey('systemUserIdIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.systemUserId,0) + #{item.systemUserIdIncrement}
                                    </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="windowId=(case" suffix="ELSE windowId end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('windowId')) or (colPickMode==1 and !item.containsKey('windowId'))">
                                        when a.id=#{item.id} then #{item.windowId}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('windowIdIncrement')) or (colPickMode==1 and !item.containsKey('windowIdIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.windowId,0) + #{item.windowIdIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                <trim prefix="windowName=(case" suffix="ELSE windowName end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('windowName')) or (colPickMode==1 and !item.containsKey('windowName'))">
                            when a.id=#{item.id} then #{item.windowName}
                        </if>
                    </foreach>
                </trim>
                        <trim prefix="siteId=(case" suffix="ELSE siteId end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('siteId')) or (colPickMode==1 and !item.containsKey('siteId'))">
                                        when a.id=#{item.id} then #{item.siteId}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('siteIdIncrement')) or (colPickMode==1 and !item.containsKey('siteIdIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.siteId,0) + #{item.siteIdIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                <trim prefix="siteName=(case" suffix="ELSE siteName end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('siteName')) or (colPickMode==1 and !item.containsKey('siteName'))">
                            when a.id=#{item.id} then #{item.siteName}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="name=(case" suffix="ELSE name end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('name')) or (colPickMode==1 and !item.containsKey('name'))">
                            when a.id=#{item.id} then #{item.name}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="number=(case" suffix="ELSE number end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('number')) or (colPickMode==1 and !item.containsKey('number'))">
                            when a.id=#{item.id} then #{item.number}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="userpost=(case" suffix="ELSE userpost end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('userpost')) or (colPickMode==1 and !item.containsKey('userpost'))">
                            when a.id=#{item.id} then #{item.userpost}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="posttitle=(case" suffix="ELSE posttitle end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('posttitle')) or (colPickMode==1 and !item.containsKey('posttitle'))">
                            when a.id=#{item.id} then #{item.posttitle}
                        </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="dangyuan=(case" suffix="ELSE dangyuan end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('dangyuan')) or (colPickMode==1 and !item.containsKey('dangyuan'))">
                                        when a.id=#{item.id} then #{item.dangyuan}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('dangyuanIncrement')) or (colPickMode==1 and !item.containsKey('dangyuanIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.dangyuan,0) + #{item.dangyuanIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                <trim prefix="phone=(case" suffix="ELSE phone end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('phone')) or (colPickMode==1 and !item.containsKey('phone'))">
                            when a.id=#{item.id} then #{item.phone}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="mobile=(case" suffix="ELSE mobile end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('mobile')) or (colPickMode==1 and !item.containsKey('mobile'))">
                            when a.id=#{item.id} then #{item.mobile}
                        </if>
                    </foreach>
                </trim>
                        <trim prefix="starlevel=(case" suffix="ELSE starlevel end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('starlevel')) or (colPickMode==1 and !item.containsKey('starlevel'))">
                                        when a.id=#{item.id} then #{item.starlevel}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('starlevelIncrement')) or (colPickMode==1 and !item.containsKey('starlevelIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.starlevel,0) + #{item.starlevelIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                <trim prefix="summary=(case" suffix="ELSE summary end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('summary')) or (colPickMode==1 and !item.containsKey('summary'))">
                            when a.id=#{item.id} then #{item.summary}
                        </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="duty=(case" suffix="ELSE duty end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('duty')) or (colPickMode==1 and !item.containsKey('duty'))">
                            when a.id=#{item.id} then #{item.duty}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="promise=(case" suffix="ELSE promise end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('promise')) or (colPickMode==1 and !item.containsKey('promise'))">
                            when a.id=#{item.id} then #{item.promise}
                        </if>
                    </foreach>
                </trim>
                <trim prefix="business=(case" suffix="ELSE business end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('business')) or (colPickMode==1 and !item.containsKey('business'))">
                            when a.id=#{item.id} then #{item.business}
                        </if>
                    </foreach>
                </trim>
                        <trim prefix="online=(case" suffix="ELSE online end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('online')) or (colPickMode==1 and !item.containsKey('online'))">
                                        when a.id=#{item.id} then #{item.online}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('onlineIncrement')) or (colPickMode==1 and !item.containsKey('onlineIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.online,0) + #{item.onlineIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                <trim prefix="createTime=(case" suffix="ELSE createTime end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))">
                            when a.id=#{item.id} then #{item.createTime}
                        </if>
                    </foreach>
                </trim>
                        <trim prefix="createUserId=(case" suffix="ELSE createUserId end),">
                            <foreach collection="data.dataList" item="item" index="index" separator="" >
                                <choose>
                                    <when test="(colPickMode==0 and item.containsKey('createUserId')) or (colPickMode==1 and !item.containsKey('createUserId'))">
                                        when a.id=#{item.id} then #{item.createUserId}
                                    </when>
                                    <when test="(colPickMode==0 and item.containsKey('createUserIdIncrement')) or (colPickMode==1 and !item.containsKey('createUserIdIncrement'))">
                                        when a.id=#{item.id} then ifnull(a.createUserId,0) + #{item.createUserIdIncrement}
                                    </when>
                                </choose>
                            </foreach>
                        </trim>
                <trim prefix="updateTime=(case" suffix="ELSE updateTime end),">
                    <foreach collection="data.dataList" item="item" index="index" separator="" >
                        <if test="(colPickMode==0 and item.containsKey('updateTime')) or (colPickMode==1 and !item.containsKey('updateTime'))">
                            when a.id=#{item.id} then #{item.updateTime}
                        </if>
                    </foreach>
                </trim>
        </trim>
        where id in
        <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
            #{item.id}
        </foreach>
    </update>
    <!-- 根据主健查询 -->
    <select id="getByKey" parameterType="paramDto" resultMap="WorkmanEntity-Map">
        select <include refid="_columns"/>
        from mortals_sys_workman as a
        where a.id=#{condition.id}
    </select>
    <!-- 根据主健删除 -->
    <delete id="deleteByKey" parameterType="paramDto">
        delete a.* from mortals_sys_workman as a where a.id=#{condition.id}
    </delete>
    <!-- 根据主健删除一批，针对单一主健有效 -->
    <delete id="deleteByKeys">
        delete from mortals_sys_workman where id in
        <foreach collection="array" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>
    <!-- 根据paramDto删除一批 -->
    <delete id="deleteByMap" parameterType="paramDto">
        delete a.* from mortals_sys_workman as a
        <trim suffixOverrides="where" suffix="">
            where
            <trim prefixOverrides="and" prefix="">
                <include refid="_condition_"/>
            </trim>
        </trim>
    </delete>
    <!-- 获取列表 -->
    <select id="getList" parameterType="paramDto" resultMap="WorkmanEntity-Map">
        select <include refid="_columns"/>
        from mortals_sys_workman 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_sys_workman 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('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('systemUserId')">
                <if test="conditionParamRef.systemUserId != null ">
                    ${_conditionType_} a.systemUserId = #{${_conditionParam_}.systemUserId}
                </if>
                <if test="conditionParamRef.systemUserId == null">
                    ${_conditionType_} a.systemUserId is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('systemUserIdList')">
                ${_conditionType_} a.systemUserId in
                <foreach collection="conditionParamRef.systemUserIdList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('systemUserIdStart') and conditionParamRef.systemUserIdStart != null">
                ${_conditionType_} a.systemUserId <![CDATA[ >= ]]> #{${_conditionParam_}.systemUserIdStart}
            </if>
            <if test="conditionParamRef.containsKey('systemUserIdEnd') and conditionParamRef.systemUserIdEnd != null">
                ${_conditionType_} a.systemUserId <![CDATA[ <= ]]> #{${_conditionParam_}.systemUserIdEnd}
            </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('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('windowId')">
                <if test="conditionParamRef.windowId != null ">
                    ${_conditionType_} a.windowId = #{${_conditionParam_}.windowId}
                </if>
                <if test="conditionParamRef.windowId == null">
                    ${_conditionType_} a.windowId is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('windowIdList')">
                ${_conditionType_} a.windowId in
                <foreach collection="conditionParamRef.windowIdList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('windowIdStart') and conditionParamRef.windowIdStart != null">
                ${_conditionType_} a.windowId <![CDATA[ >= ]]> #{${_conditionParam_}.windowIdStart}
            </if>
            <if test="conditionParamRef.containsKey('windowIdEnd') and conditionParamRef.windowIdEnd != null">
                ${_conditionType_} a.windowId <![CDATA[ <= ]]> #{${_conditionParam_}.windowIdEnd}
            </if>


            <if test="conditionParamRef.containsKey('windowName')">
                <if test="conditionParamRef.windowName != null and conditionParamRef.windowName != ''">
                    ${_conditionType_} a.windowName like #{${_conditionParam_}.windowName}
                </if>
                <if test="conditionParamRef.windowName == null">
                    ${_conditionType_} a.windowName is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('windowNameList')">
                ${_conditionType_} a.windowName in
                <foreach collection="conditionParamRef.windowNameList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('siteId')">
                <if test="conditionParamRef.siteId != null ">
                    ${_conditionType_} a.siteId = #{${_conditionParam_}.siteId}
                </if>
                <if test="conditionParamRef.siteId == null">
                    ${_conditionType_} a.siteId is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('siteIdList')">
                ${_conditionType_} a.siteId in
                <foreach collection="conditionParamRef.siteIdList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('siteIdStart') and conditionParamRef.siteIdStart != null">
                ${_conditionType_} a.siteId <![CDATA[ >= ]]> #{${_conditionParam_}.siteIdStart}
            </if>
            <if test="conditionParamRef.containsKey('siteIdEnd') and conditionParamRef.siteIdEnd != null">
                ${_conditionType_} a.siteId <![CDATA[ <= ]]> #{${_conditionParam_}.siteIdEnd}
            </if>


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

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

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

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

            <if test="conditionParamRef.containsKey('posttitle')">
                <if test="conditionParamRef.posttitle != null and conditionParamRef.posttitle != ''">
                    ${_conditionType_} a.posttitle like #{${_conditionParam_}.posttitle}
                </if>
                <if test="conditionParamRef.posttitle == null">
                    ${_conditionType_} a.posttitle is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('posttitleList')">
                ${_conditionType_} a.posttitle in
                <foreach collection="conditionParamRef.posttitleList" 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('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('dangyuan')">
                <if test="conditionParamRef.dangyuan != null ">
                    ${_conditionType_} a.dangyuan = #{${_conditionParam_}.dangyuan}
                </if>
                <if test="conditionParamRef.dangyuan == null">
                    ${_conditionType_} a.dangyuan is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('dangyuanList')">
                ${_conditionType_} a.dangyuan in
                <foreach collection="conditionParamRef.dangyuanList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('dangyuanStart') and conditionParamRef.dangyuanStart != null">
                ${_conditionType_} a.dangyuan <![CDATA[ >= ]]> #{${_conditionParam_}.dangyuanStart}
            </if>
            <if test="conditionParamRef.containsKey('dangyuanEnd') and conditionParamRef.dangyuanEnd != null">
                ${_conditionType_} a.dangyuan <![CDATA[ <= ]]> #{${_conditionParam_}.dangyuanEnd}
            </if>


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

            <if test="conditionParamRef.containsKey('mobile')">
                <if test="conditionParamRef.mobile != null and conditionParamRef.mobile != ''">
                    ${_conditionType_} a.mobile like #{${_conditionParam_}.mobile}
                </if>
                <if test="conditionParamRef.mobile == null">
                    ${_conditionType_} a.mobile is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('mobileList')">
                ${_conditionType_} a.mobile in
                <foreach collection="conditionParamRef.mobileList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('starlevel')">
                <if test="conditionParamRef.starlevel != null ">
                    ${_conditionType_} a.starlevel = #{${_conditionParam_}.starlevel}
                </if>
                <if test="conditionParamRef.starlevel == null">
                    ${_conditionType_} a.starlevel is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('starlevelList')">
                ${_conditionType_} a.starlevel in
                <foreach collection="conditionParamRef.starlevelList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('starlevelStart') and conditionParamRef.starlevelStart != null">
                ${_conditionType_} a.starlevel <![CDATA[ >= ]]> #{${_conditionParam_}.starlevelStart}
            </if>
            <if test="conditionParamRef.containsKey('starlevelEnd') and conditionParamRef.starlevelEnd != null">
                ${_conditionType_} a.starlevel <![CDATA[ <= ]]> #{${_conditionParam_}.starlevelEnd}
            </if>


            <if test="conditionParamRef.containsKey('summary')">
                <if test="conditionParamRef.summary != null and conditionParamRef.summary != ''">
                    ${_conditionType_} a.summary like #{${_conditionParam_}.summary}
                </if>
                <if test="conditionParamRef.summary == null">
                    ${_conditionType_} a.summary is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('summaryList')">
                ${_conditionType_} a.summary in
                <foreach collection="conditionParamRef.summaryList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </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('duty')">
                <if test="conditionParamRef.duty != null and conditionParamRef.duty != ''">
                    ${_conditionType_} a.duty like #{${_conditionParam_}.duty}
                </if>
                <if test="conditionParamRef.duty == null">
                    ${_conditionType_} a.duty is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('dutyList')">
                ${_conditionType_} a.duty in
                <foreach collection="conditionParamRef.dutyList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>

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

            <if test="conditionParamRef.containsKey('business')">
                <if test="conditionParamRef.business != null and conditionParamRef.business != ''">
                    ${_conditionType_} a.business like #{${_conditionParam_}.business}
                </if>
                <if test="conditionParamRef.business == null">
                    ${_conditionType_} a.business is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('businessList')">
                ${_conditionType_} a.business in
                <foreach collection="conditionParamRef.businessList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('online')">
                <if test="conditionParamRef.online != null ">
                    ${_conditionType_} a.online = #{${_conditionParam_}.online}
                </if>
                <if test="conditionParamRef.online == null">
                    ${_conditionType_} a.online is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('onlineList')">
                ${_conditionType_} a.online in
                <foreach collection="conditionParamRef.onlineList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('onlineStart') and conditionParamRef.onlineStart != null">
                ${_conditionType_} a.online <![CDATA[ >= ]]> #{${_conditionParam_}.onlineStart}
            </if>
            <if test="conditionParamRef.containsKey('onlineEnd') and conditionParamRef.onlineEnd != null">
                ${_conditionType_} a.online <![CDATA[ <= ]]> #{${_conditionParam_}.onlineEnd}
            </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')">
                ${_conditionType_} a.createUserId in
                <foreach collection="conditionParamRef.createUserIdList" open="(" close=")" index="index" item="item" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="conditionParamRef.containsKey('createUserIdStart') and conditionParamRef.createUserIdStart != null">
                ${_conditionType_} a.createUserId <![CDATA[ >= ]]> #{${_conditionParam_}.createUserIdStart}
            </if>
            <if test="conditionParamRef.containsKey('createUserIdEnd') and conditionParamRef.createUserIdEnd != null">
                ${_conditionType_} a.createUserId <![CDATA[ <= ]]> #{${_conditionParam_}.createUserIdEnd}
            </if>


            <if test="conditionParamRef.containsKey('updateTime')">
                <if test="conditionParamRef.updateTime != null ">
                    ${_conditionType_} a.updateTime = #{${_conditionParam_}.updateTime}
                </if>
                <if test="conditionParamRef.updateTime == null">
                    ${_conditionType_} a.updateTime is null
                </if>
            </if>
            <if test="conditionParamRef.containsKey('updateTimeStart') and conditionParamRef.updateTimeStart != null and conditionParamRef.updateTimeStart!=''">
                ${_conditionType_} a.updateTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
            </if>
            <if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
                ${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
            </if>
    </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('systemUserId')">
                        a.systemUserId
                        <if test='orderCol.systemUserId != null and "DESC".equalsIgnoreCase(orderCol.systemUserId)'>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('windowId')">
                        a.windowId
                        <if test='orderCol.windowId != null and "DESC".equalsIgnoreCase(orderCol.windowId)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('windowName')">
                        a.windowName
                        <if test='orderCol.windowName != null and "DESC".equalsIgnoreCase(orderCol.windowName)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('siteId')">
                        a.siteId
                        <if test='orderCol.siteId != null and "DESC".equalsIgnoreCase(orderCol.siteId)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('siteName')">
                        a.siteName
                        <if test='orderCol.siteName != null and "DESC".equalsIgnoreCase(orderCol.siteName)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('name')">
                        a.name
                        <if test='orderCol.name != null and "DESC".equalsIgnoreCase(orderCol.name)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('number')">
                        a.number
                        <if test='orderCol.number != null and "DESC".equalsIgnoreCase(orderCol.number)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('userpost')">
                        a.userpost
                        <if test='orderCol.userpost != null and "DESC".equalsIgnoreCase(orderCol.userpost)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('posttitle')">
                        a.posttitle
                        <if test='orderCol.posttitle != null and "DESC".equalsIgnoreCase(orderCol.posttitle)'>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('dangyuan')">
                        a.dangyuan
                        <if test='orderCol.dangyuan != null and "DESC".equalsIgnoreCase(orderCol.dangyuan)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('phone')">
                        a.phone
                        <if test='orderCol.phone != null and "DESC".equalsIgnoreCase(orderCol.phone)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('mobile')">
                        a.mobile
                        <if test='orderCol.mobile != null and "DESC".equalsIgnoreCase(orderCol.mobile)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('starlevel')">
                        a.starlevel
                        <if test='orderCol.starlevel != null and "DESC".equalsIgnoreCase(orderCol.starlevel)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('summary')">
                        a.summary
                        <if test='orderCol.summary != null and "DESC".equalsIgnoreCase(orderCol.summary)'>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('duty')">
                        a.duty
                        <if test='orderCol.duty != null and "DESC".equalsIgnoreCase(orderCol.duty)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('promise')">
                        a.promise
                        <if test='orderCol.promise != null and "DESC".equalsIgnoreCase(orderCol.promise)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('business')">
                        a.business
                        <if test='orderCol.business != null and "DESC".equalsIgnoreCase(orderCol.business)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('online')">
                        a.online
                        <if test='orderCol.online != null and "DESC".equalsIgnoreCase(orderCol.online)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('createTime')">
                        a.createTime
                        <if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('createUserId')">
                        a.createUserId
                        <if test='orderCol.createUserId != null and "DESC".equalsIgnoreCase(orderCol.createUserId)'>DESC</if>
                        ,
                    </if>
                    <if test="orderCol.containsKey('updateTime')">
                        a.updateTime
                        <if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
                        ,
                    </if>
            </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>