<?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.base.system.gentable.dao.ibatis.GentableDaoImpl">

    <!-- 字段和属性映射 -->
    <resultMap type="GentableEntity" id="GentableEntity-Map">
        <id  property="id" column="id" />
        <result property="tableName" column="tableName" />
        <result property="tableComment" column="tableComment" />
        <result property="subTableName" column="subTableName" />
        <result property="subTableFkName" column="subTableFkName" />
        <result property="className" column="className" />
        <result property="tplCategory" column="tplCategory" />
        <result property="packageName" column="packageName" />
        <result property="moduleName" column="moduleName" />
        <result property="businessName" column="businessName" />
        <result property="functionName" column="functionName" />
        <result property="functionAuthor" column="functionAuthor" />
        <result property="cacheServiceType" column="cacheServiceType" />
        <result property="genType" column="genType" />
        <result property="dividedTableType" column="dividedTableType" />
        <result property="genFeign" column="genFeign" />
        <result property="feignAppName" column="feignAppName" />
        <result property="detailShow" column="detailShow" />
        <result property="genApi" column="genApi" />
        <result property="isGenExport" column="isGenExport" />
        <result property="isShowControl" column="isShowControl" />
        <result property="genPath" column="genPath" />
        <result property="options" column="options" />
        <result property="remark" column="remark" />
        <result property="appId" column="appId" />
        <result property="updateTime" column="updateTime" />
        <result property="updateUser" column="updateUser" />
        <result property="createTime" column="createTime" />
        <result property="createUser" column="createUser" />

    </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('tableName') or colPickMode == 1 and data.containsKey('tableName')))">
                a.tableName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('tableComment') or colPickMode == 1 and data.containsKey('tableComment')))">
                a.tableComment,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('subTableName') or colPickMode == 1 and data.containsKey('subTableName')))">
                a.subTableName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('subTableFkName') or colPickMode == 1 and data.containsKey('subTableFkName')))">
                a.subTableFkName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('className') or colPickMode == 1 and data.containsKey('className')))">
                a.className,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('tplCategory') or colPickMode == 1 and data.containsKey('tplCategory')))">
                a.tplCategory,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('packageName') or colPickMode == 1 and data.containsKey('packageName')))">
                a.packageName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('moduleName') or colPickMode == 1 and data.containsKey('moduleName')))">
                a.moduleName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('businessName') or colPickMode == 1 and data.containsKey('businessName')))">
                a.businessName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('functionName') or colPickMode == 1 and data.containsKey('functionName')))">
                a.functionName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('functionAuthor') or colPickMode == 1 and data.containsKey('functionAuthor')))">
                a.functionAuthor,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('cacheServiceType') or colPickMode == 1 and data.containsKey('cacheServiceType')))">
                a.cacheServiceType,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('genType') or colPickMode == 1 and data.containsKey('genType')))">
                a.genType,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('dividedTableType') or colPickMode == 1 and data.containsKey('dividedTableType')))">
                a.dividedTableType,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('genFeign') or colPickMode == 1 and data.containsKey('genFeign')))">
                a.genFeign,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('feignAppName') or colPickMode == 1 and data.containsKey('feignAppName')))">
                a.feignAppName,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('detailShow') or colPickMode == 1 and data.containsKey('detailShow')))">
                a.detailShow,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('genApi') or colPickMode == 1 and data.containsKey('genApi')))">
                a.genApi,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('isGenExport') or colPickMode == 1 and data.containsKey('isGenExport')))">
                a.isGenExport,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('isShowControl') or colPickMode == 1 and data.containsKey('isShowControl')))">
                a.isShowControl,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('genPath') or colPickMode == 1 and data.containsKey('genPath')))">
                a.genPath,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('options') or colPickMode == 1 and data.containsKey('options')))">
                a.options,
            </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('appId') or colPickMode == 1 and data.containsKey('appId')))">
                a.appId,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
                a.updateTime,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateUser') or colPickMode == 1 and data.containsKey('updateUser')))">
                a.updateUser,
            </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('createUser') or colPickMode == 1 and data.containsKey('createUser')))">
                a.createUser,
            </if>
        </trim>
    </sql>
    <!-- 新增 区分主键自增加还是业务插入 -->
    <insert id="insert" parameterType="GentableEntity"  useGeneratedKeys="true" keyProperty="id">
        insert into mortals_xhx_gentable
        (tableName,tableComment,subTableName,subTableFkName,className,tplCategory,packageName,moduleName,businessName,functionName,functionAuthor,cacheServiceType,genType,dividedTableType,genFeign,feignAppName,detailShow,genApi,isGenExport,isShowControl,genPath,options,remark,appId,updateTime,updateUser,createTime,createUser)
        VALUES
        (#{tableName},#{tableComment},#{subTableName},#{subTableFkName},#{className},#{tplCategory},#{packageName},#{moduleName},#{businessName},#{functionName},#{functionAuthor},#{cacheServiceType},#{genType},#{dividedTableType},#{genFeign},#{feignAppName},#{detailShow},#{genApi},#{isGenExport},#{isShowControl},#{genPath},#{options},#{remark},#{appId},#{updateTime},#{updateUser},#{createTime},#{createUser})
    </insert>

    <!-- 批量新增 -->
    <insert id="insertBatch" parameterType="paramDto">
        insert into mortals_xhx_gentable
        (tableName,tableComment,subTableName,subTableFkName,className,tplCategory,packageName,moduleName,businessName,functionName,functionAuthor,cacheServiceType,genType,dividedTableType,genFeign,feignAppName,detailShow,genApi,isGenExport,isShowControl,genPath,options,remark,appId,updateTime,updateUser,createTime,createUser)
        VALUES
        <foreach collection="data.dataList" item="item" index="index" separator="," >
            (#{item.tableName},#{item.tableComment},#{item.subTableName},#{item.subTableFkName},#{item.className},#{item.tplCategory},#{item.packageName},#{item.moduleName},#{item.businessName},#{item.functionName},#{item.functionAuthor},#{item.cacheServiceType},#{item.genType},#{item.dividedTableType},#{item.genFeign},#{item.feignAppName},#{item.detailShow},#{item.genApi},#{item.isGenExport},#{item.isShowControl},#{item.genPath},#{item.options},#{item.remark},#{item.appId},#{item.updateTime},#{item.updateUser},#{item.createTime},#{item.createUser})
        </foreach>
    </insert>


    <!-- 根据ParamDto更新 -->
    <update id="update" parameterType="paramDto">
        update mortals_xhx_gentable as a
        set
        <trim suffixOverrides="," suffix="">
            <if test="(colPickMode==0 and data.containsKey('tableName')) or (colPickMode==1 and !data.containsKey('tableName'))">
                a.tableName=#{data.tableName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('tableComment')) or (colPickMode==1 and !data.containsKey('tableComment'))">
                a.tableComment=#{data.tableComment},
            </if>
            <if test="(colPickMode==0 and data.containsKey('subTableName')) or (colPickMode==1 and !data.containsKey('subTableName'))">
                a.subTableName=#{data.subTableName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('subTableFkName')) or (colPickMode==1 and !data.containsKey('subTableFkName'))">
                a.subTableFkName=#{data.subTableFkName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('className')) or (colPickMode==1 and !data.containsKey('className'))">
                a.className=#{data.className},
            </if>
            <if test="(colPickMode==0 and data.containsKey('tplCategory')) or (colPickMode==1 and !data.containsKey('tplCategory'))">
                a.tplCategory=#{data.tplCategory},
            </if>
            <if test="(colPickMode==0 and data.containsKey('packageName')) or (colPickMode==1 and !data.containsKey('packageName'))">
                a.packageName=#{data.packageName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('moduleName')) or (colPickMode==1 and !data.containsKey('moduleName'))">
                a.moduleName=#{data.moduleName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('businessName')) or (colPickMode==1 and !data.containsKey('businessName'))">
                a.businessName=#{data.businessName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('functionName')) or (colPickMode==1 and !data.containsKey('functionName'))">
                a.functionName=#{data.functionName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('functionAuthor')) or (colPickMode==1 and !data.containsKey('functionAuthor'))">
                a.functionAuthor=#{data.functionAuthor},
            </if>
            <if test="(colPickMode==0 and data.containsKey('cacheServiceType')) or (colPickMode==1 and !data.containsKey('cacheServiceType'))">
                a.cacheServiceType=#{data.cacheServiceType},
            </if>
            <if test="(colPickMode==0 and data.containsKey('cacheServiceTypeIncrement')) or (colPickMode==1 and !data.containsKey('cacheServiceTypeIncrement'))">
                a.cacheServiceType=ifnull(a.cacheServiceType,0) + #{data.cacheServiceTypeIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('genType')) or (colPickMode==1 and !data.containsKey('genType'))">
                a.genType=#{data.genType},
            </if>
            <if test="(colPickMode==0 and data.containsKey('genTypeIncrement')) or (colPickMode==1 and !data.containsKey('genTypeIncrement'))">
                a.genType=ifnull(a.genType,0) + #{data.genTypeIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('dividedTableType')) or (colPickMode==1 and !data.containsKey('dividedTableType'))">
                a.dividedTableType=#{data.dividedTableType},
            </if>
            <if test="(colPickMode==0 and data.containsKey('dividedTableTypeIncrement')) or (colPickMode==1 and !data.containsKey('dividedTableTypeIncrement'))">
                a.dividedTableType=ifnull(a.dividedTableType,0) + #{data.dividedTableTypeIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('genFeign')) or (colPickMode==1 and !data.containsKey('genFeign'))">
                a.genFeign=#{data.genFeign},
            </if>
            <if test="(colPickMode==0 and data.containsKey('genFeignIncrement')) or (colPickMode==1 and !data.containsKey('genFeignIncrement'))">
                a.genFeign=ifnull(a.genFeign,0) + #{data.genFeignIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('feignAppName')) or (colPickMode==1 and !data.containsKey('feignAppName'))">
                a.feignAppName=#{data.feignAppName},
            </if>
            <if test="(colPickMode==0 and data.containsKey('detailShow')) or (colPickMode==1 and !data.containsKey('detailShow'))">
                a.detailShow=#{data.detailShow},
            </if>
            <if test="(colPickMode==0 and data.containsKey('detailShowIncrement')) or (colPickMode==1 and !data.containsKey('detailShowIncrement'))">
                a.detailShow=ifnull(a.detailShow,0) + #{data.detailShowIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('genApi')) or (colPickMode==1 and !data.containsKey('genApi'))">
                a.genApi=#{data.genApi},
            </if>
            <if test="(colPickMode==0 and data.containsKey('genApiIncrement')) or (colPickMode==1 and !data.containsKey('genApiIncrement'))">
                a.genApi=ifnull(a.genApi,0) + #{data.genApiIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('isGenExport')) or (colPickMode==1 and !data.containsKey('isGenExport'))">
                a.isGenExport=#{data.isGenExport},
            </if>
            <if test="(colPickMode==0 and data.containsKey('isGenExportIncrement')) or (colPickMode==1 and !data.containsKey('isGenExportIncrement'))">
                a.isGenExport=ifnull(a.isGenExport,0) + #{data.isGenExportIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('isShowControl')) or (colPickMode==1 and !data.containsKey('isShowControl'))">
                a.isShowControl=#{data.isShowControl},
            </if>
            <if test="(colPickMode==0 and data.containsKey('isShowControlIncrement')) or (colPickMode==1 and !data.containsKey('isShowControlIncrement'))">
                a.isShowControl=ifnull(a.isShowControl,0) + #{data.isShowControlIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('genPath')) or (colPickMode==1 and !data.containsKey('genPath'))">
                a.genPath=#{data.genPath},
            </if>
            <if test="(colPickMode==0 and data.containsKey('options')) or (colPickMode==1 and !data.containsKey('options'))">
                a.options=#{data.options},
            </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('appId')) or (colPickMode==1 and !data.containsKey('appId'))">
                a.appId=#{data.appId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('appIdIncrement')) or (colPickMode==1 and !data.containsKey('appIdIncrement'))">
                a.appId=ifnull(a.appId,0) + #{data.appIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
                a.updateTime=#{data.updateTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('updateUser')) or (colPickMode==1 and !data.containsKey('updateUser'))">
                a.updateUser=#{data.updateUser},
            </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('createUser')) or (colPickMode==1 and !data.containsKey('createUser'))">
                a.createUser=#{data.createUser},
            </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_gentable as a
        <trim prefix="set" suffixOverrides=",">
            <trim prefix="tableName=(case" suffix="ELSE tableName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('tableName')) or (colPickMode==1 and !item.containsKey('tableName'))">
                        when a.id=#{item.id} then #{item.tableName}
                    </if>
                </foreach>
            </trim>
            <trim prefix="tableComment=(case" suffix="ELSE tableComment end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('tableComment')) or (colPickMode==1 and !item.containsKey('tableComment'))">
                        when a.id=#{item.id} then #{item.tableComment}
                    </if>
                </foreach>
            </trim>
            <trim prefix="subTableName=(case" suffix="ELSE subTableName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('subTableName')) or (colPickMode==1 and !item.containsKey('subTableName'))">
                        when a.id=#{item.id} then #{item.subTableName}
                    </if>
                </foreach>
            </trim>
            <trim prefix="subTableFkName=(case" suffix="ELSE subTableFkName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('subTableFkName')) or (colPickMode==1 and !item.containsKey('subTableFkName'))">
                        when a.id=#{item.id} then #{item.subTableFkName}
                    </if>
                </foreach>
            </trim>
            <trim prefix="className=(case" suffix="ELSE className end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('className')) or (colPickMode==1 and !item.containsKey('className'))">
                        when a.id=#{item.id} then #{item.className}
                    </if>
                </foreach>
            </trim>
            <trim prefix="tplCategory=(case" suffix="ELSE tplCategory end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('tplCategory')) or (colPickMode==1 and !item.containsKey('tplCategory'))">
                        when a.id=#{item.id} then #{item.tplCategory}
                    </if>
                </foreach>
            </trim>
            <trim prefix="packageName=(case" suffix="ELSE packageName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('packageName')) or (colPickMode==1 and !item.containsKey('packageName'))">
                        when a.id=#{item.id} then #{item.packageName}
                    </if>
                </foreach>
            </trim>
            <trim prefix="moduleName=(case" suffix="ELSE moduleName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('moduleName')) or (colPickMode==1 and !item.containsKey('moduleName'))">
                        when a.id=#{item.id} then #{item.moduleName}
                    </if>
                </foreach>
            </trim>
            <trim prefix="businessName=(case" suffix="ELSE businessName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('businessName')) or (colPickMode==1 and !item.containsKey('businessName'))">
                        when a.id=#{item.id} then #{item.businessName}
                    </if>
                </foreach>
            </trim>
            <trim prefix="functionName=(case" suffix="ELSE functionName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('functionName')) or (colPickMode==1 and !item.containsKey('functionName'))">
                        when a.id=#{item.id} then #{item.functionName}
                    </if>
                </foreach>
            </trim>
            <trim prefix="functionAuthor=(case" suffix="ELSE functionAuthor end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('functionAuthor')) or (colPickMode==1 and !item.containsKey('functionAuthor'))">
                        when a.id=#{item.id} then #{item.functionAuthor}
                    </if>
                </foreach>
            </trim>
            <trim prefix="cacheServiceType=(case" suffix="ELSE cacheServiceType end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('cacheServiceType')) or (colPickMode==1 and !item.containsKey('cacheServiceType'))">
                            when a.id=#{item.id} then #{item.cacheServiceType}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('cacheServiceTypeIncrement')) or (colPickMode==1 and !item.containsKey('cacheServiceTypeIncrement'))">
                            when a.id=#{item.id} then ifnull(a.cacheServiceType,0) + #{item.cacheServiceTypeIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="genType=(case" suffix="ELSE genType end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('genType')) or (colPickMode==1 and !item.containsKey('genType'))">
                            when a.id=#{item.id} then #{item.genType}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('genTypeIncrement')) or (colPickMode==1 and !item.containsKey('genTypeIncrement'))">
                            when a.id=#{item.id} then ifnull(a.genType,0) + #{item.genTypeIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="dividedTableType=(case" suffix="ELSE dividedTableType end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('dividedTableType')) or (colPickMode==1 and !item.containsKey('dividedTableType'))">
                            when a.id=#{item.id} then #{item.dividedTableType}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('dividedTableTypeIncrement')) or (colPickMode==1 and !item.containsKey('dividedTableTypeIncrement'))">
                            when a.id=#{item.id} then ifnull(a.dividedTableType,0) + #{item.dividedTableTypeIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="genFeign=(case" suffix="ELSE genFeign end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('genFeign')) or (colPickMode==1 and !item.containsKey('genFeign'))">
                            when a.id=#{item.id} then #{item.genFeign}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('genFeignIncrement')) or (colPickMode==1 and !item.containsKey('genFeignIncrement'))">
                            when a.id=#{item.id} then ifnull(a.genFeign,0) + #{item.genFeignIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="feignAppName=(case" suffix="ELSE feignAppName end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('feignAppName')) or (colPickMode==1 and !item.containsKey('feignAppName'))">
                        when a.id=#{item.id} then #{item.feignAppName}
                    </if>
                </foreach>
            </trim>
            <trim prefix="detailShow=(case" suffix="ELSE detailShow end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('detailShow')) or (colPickMode==1 and !item.containsKey('detailShow'))">
                            when a.id=#{item.id} then #{item.detailShow}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('detailShowIncrement')) or (colPickMode==1 and !item.containsKey('detailShowIncrement'))">
                            when a.id=#{item.id} then ifnull(a.detailShow,0) + #{item.detailShowIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="genApi=(case" suffix="ELSE genApi end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('genApi')) or (colPickMode==1 and !item.containsKey('genApi'))">
                            when a.id=#{item.id} then #{item.genApi}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('genApiIncrement')) or (colPickMode==1 and !item.containsKey('genApiIncrement'))">
                            when a.id=#{item.id} then ifnull(a.genApi,0) + #{item.genApiIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="isGenExport=(case" suffix="ELSE isGenExport end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('isGenExport')) or (colPickMode==1 and !item.containsKey('isGenExport'))">
                            when a.id=#{item.id} then #{item.isGenExport}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('isGenExportIncrement')) or (colPickMode==1 and !item.containsKey('isGenExportIncrement'))">
                            when a.id=#{item.id} then ifnull(a.isGenExport,0) + #{item.isGenExportIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="isShowControl=(case" suffix="ELSE isShowControl end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('isShowControl')) or (colPickMode==1 and !item.containsKey('isShowControl'))">
                            when a.id=#{item.id} then #{item.isShowControl}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('isShowControlIncrement')) or (colPickMode==1 and !item.containsKey('isShowControlIncrement'))">
                            when a.id=#{item.id} then ifnull(a.isShowControl,0) + #{item.isShowControlIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="genPath=(case" suffix="ELSE genPath end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('genPath')) or (colPickMode==1 and !item.containsKey('genPath'))">
                        when a.id=#{item.id} then #{item.genPath}
                    </if>
                </foreach>
            </trim>
            <trim prefix="options=(case" suffix="ELSE options end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('options')) or (colPickMode==1 and !item.containsKey('options'))">
                        when a.id=#{item.id} then #{item.options}
                    </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="appId=(case" suffix="ELSE appId end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('appId')) or (colPickMode==1 and !item.containsKey('appId'))">
                            when a.id=#{item.id} then #{item.appId}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('appIdIncrement')) or (colPickMode==1 and !item.containsKey('appIdIncrement'))">
                            when a.id=#{item.id} then ifnull(a.appId,0) + #{item.appIdIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="updateTime=(case" suffix="ELSE updateTime end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('updateTime')) or (colPickMode==1 and !item.containsKey('updateTime'))">
                        when a.id=#{item.id} then #{item.updateTime}
                    </if>
                </foreach>
            </trim>
            <trim prefix="updateUser=(case" suffix="ELSE updateUser end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('updateUser')) or (colPickMode==1 and !item.containsKey('updateUser'))">
                        when a.id=#{item.id} then #{item.updateUser}
                    </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="createUser=(case" suffix="ELSE createUser end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('createUser')) or (colPickMode==1 and !item.containsKey('createUser'))">
                        when a.id=#{item.id} then #{item.createUser}
                    </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="GentableEntity-Map">
        select <include refid="_columns"/>
        from mortals_xhx_gentable as a
        where a.id=#{condition.id}
    </select>
    <!-- 根据主健删除 -->
    <delete id="deleteByKey" parameterType="paramDto">
        delete a.* from mortals_xhx_gentable as a where a.id=#{condition.id}
    </delete>
    <!-- 根据主健删除一批，针对单一主健有效 -->
    <delete id="deleteByKeys">
        delete from mortals_xhx_gentable 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_xhx_gentable as a
        <trim suffixOverrides="where" suffix="">
            where
            <trim prefixOverrides="and" prefix="">
                <include refid="_condition_"/>
            </trim>
        </trim>
    </delete>
    <!-- 获取列表 -->
    <select id="getList" parameterType="paramDto" resultMap="GentableEntity-Map">
        select <include refid="_columns"/>
        from mortals_xhx_gentable 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_gentable 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('tableName')">
            <if test="conditionParamRef.tableName != null and conditionParamRef.tableName != ''">
                ${_conditionType_} a.tableName like #{${_conditionParam_}.tableName}
            </if>
            <if test="conditionParamRef.tableName == null">
                ${_conditionType_} a.tableName is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('tableNameList')">
            ${_conditionType_} a.tableName in
            <foreach collection="conditionParamRef.tableNameList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>

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

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

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

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

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

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

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

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

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

        <if test="conditionParamRef.containsKey('functionAuthor')">
            <if test="conditionParamRef.functionAuthor != null and conditionParamRef.functionAuthor != ''">
                ${_conditionType_} a.functionAuthor like #{${_conditionParam_}.functionAuthor}
            </if>
            <if test="conditionParamRef.functionAuthor == null">
                ${_conditionType_} a.functionAuthor is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('functionAuthorList')">
            ${_conditionType_} a.functionAuthor in
            <foreach collection="conditionParamRef.functionAuthorList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('cacheServiceType')">
            <if test="conditionParamRef.cacheServiceType != null ">
                ${_conditionType_} a.cacheServiceType = #{${_conditionParam_}.cacheServiceType}
            </if>
            <if test="conditionParamRef.cacheServiceType == null">
                ${_conditionType_} a.cacheServiceType is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('cacheServiceTypeList')">
            ${_conditionType_} a.cacheServiceType in
            <foreach collection="conditionParamRef.cacheServiceTypeList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('cacheServiceTypeStart') and conditionParamRef.cacheServiceTypeStart != null">
            ${_conditionType_} a.cacheServiceType <![CDATA[ >= ]]> #{${_conditionParam_}.cacheServiceTypeStart}
        </if>
        <if test="conditionParamRef.containsKey('cacheServiceTypeEnd') and conditionParamRef.cacheServiceTypeEnd != null">
            ${_conditionType_} a.cacheServiceType <![CDATA[ <= ]]> #{${_conditionParam_}.cacheServiceTypeEnd}
        </if>

        <if test="conditionParamRef.containsKey('genType')">
            <if test="conditionParamRef.genType != null ">
                ${_conditionType_} a.genType = #{${_conditionParam_}.genType}
            </if>
            <if test="conditionParamRef.genType == null">
                ${_conditionType_} a.genType is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('genTypeList')">
            ${_conditionType_} a.genType in
            <foreach collection="conditionParamRef.genTypeList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('genTypeStart') and conditionParamRef.genTypeStart != null">
            ${_conditionType_} a.genType <![CDATA[ >= ]]> #{${_conditionParam_}.genTypeStart}
        </if>
        <if test="conditionParamRef.containsKey('genTypeEnd') and conditionParamRef.genTypeEnd != null">
            ${_conditionType_} a.genType <![CDATA[ <= ]]> #{${_conditionParam_}.genTypeEnd}
        </if>

        <if test="conditionParamRef.containsKey('dividedTableType')">
            <if test="conditionParamRef.dividedTableType != null ">
                ${_conditionType_} a.dividedTableType = #{${_conditionParam_}.dividedTableType}
            </if>
            <if test="conditionParamRef.dividedTableType == null">
                ${_conditionType_} a.dividedTableType is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('dividedTableTypeList')">
            ${_conditionType_} a.dividedTableType in
            <foreach collection="conditionParamRef.dividedTableTypeList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('dividedTableTypeStart') and conditionParamRef.dividedTableTypeStart != null">
            ${_conditionType_} a.dividedTableType <![CDATA[ >= ]]> #{${_conditionParam_}.dividedTableTypeStart}
        </if>
        <if test="conditionParamRef.containsKey('dividedTableTypeEnd') and conditionParamRef.dividedTableTypeEnd != null">
            ${_conditionType_} a.dividedTableType <![CDATA[ <= ]]> #{${_conditionParam_}.dividedTableTypeEnd}
        </if>

        <if test="conditionParamRef.containsKey('genFeign')">
            <if test="conditionParamRef.genFeign != null ">
                ${_conditionType_} a.genFeign = #{${_conditionParam_}.genFeign}
            </if>
            <if test="conditionParamRef.genFeign == null">
                ${_conditionType_} a.genFeign is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('genFeignList')">
            ${_conditionType_} a.genFeign in
            <foreach collection="conditionParamRef.genFeignList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('genFeignStart') and conditionParamRef.genFeignStart != null">
            ${_conditionType_} a.genFeign <![CDATA[ >= ]]> #{${_conditionParam_}.genFeignStart}
        </if>
        <if test="conditionParamRef.containsKey('genFeignEnd') and conditionParamRef.genFeignEnd != null">
            ${_conditionType_} a.genFeign <![CDATA[ <= ]]> #{${_conditionParam_}.genFeignEnd}
        </if>


        <if test="conditionParamRef.containsKey('feignAppName')">
            <if test="conditionParamRef.feignAppName != null and conditionParamRef.feignAppName != ''">
                ${_conditionType_} a.feignAppName like #{${_conditionParam_}.feignAppName}
            </if>
            <if test="conditionParamRef.feignAppName == null">
                ${_conditionType_} a.feignAppName is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('feignAppNameList')">
            ${_conditionType_} a.feignAppName in
            <foreach collection="conditionParamRef.feignAppNameList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('detailShow')">
            <if test="conditionParamRef.detailShow != null ">
                ${_conditionType_} a.detailShow = #{${_conditionParam_}.detailShow}
            </if>
            <if test="conditionParamRef.detailShow == null">
                ${_conditionType_} a.detailShow is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('detailShowList')">
            ${_conditionType_} a.detailShow in
            <foreach collection="conditionParamRef.detailShowList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('detailShowStart') and conditionParamRef.detailShowStart != null">
            ${_conditionType_} a.detailShow <![CDATA[ >= ]]> #{${_conditionParam_}.detailShowStart}
        </if>
        <if test="conditionParamRef.containsKey('detailShowEnd') and conditionParamRef.detailShowEnd != null">
            ${_conditionType_} a.detailShow <![CDATA[ <= ]]> #{${_conditionParam_}.detailShowEnd}
        </if>

        <if test="conditionParamRef.containsKey('genApi')">
            <if test="conditionParamRef.genApi != null ">
                ${_conditionType_} a.genApi = #{${_conditionParam_}.genApi}
            </if>
            <if test="conditionParamRef.genApi == null">
                ${_conditionType_} a.genApi is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('genApiList')">
            ${_conditionType_} a.genApi in
            <foreach collection="conditionParamRef.genApiList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('genApiStart') and conditionParamRef.genApiStart != null">
            ${_conditionType_} a.genApi <![CDATA[ >= ]]> #{${_conditionParam_}.genApiStart}
        </if>
        <if test="conditionParamRef.containsKey('genApiEnd') and conditionParamRef.genApiEnd != null">
            ${_conditionType_} a.genApi <![CDATA[ <= ]]> #{${_conditionParam_}.genApiEnd}
        </if>

        <if test="conditionParamRef.containsKey('isGenExport')">
            <if test="conditionParamRef.isGenExport != null ">
                ${_conditionType_} a.isGenExport = #{${_conditionParam_}.isGenExport}
            </if>
            <if test="conditionParamRef.isGenExport == null">
                ${_conditionType_} a.isGenExport is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('isGenExportList')">
            ${_conditionType_} a.isGenExport in
            <foreach collection="conditionParamRef.isGenExportList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('isGenExportStart') and conditionParamRef.isGenExportStart != null">
            ${_conditionType_} a.isGenExport <![CDATA[ >= ]]> #{${_conditionParam_}.isGenExportStart}
        </if>
        <if test="conditionParamRef.containsKey('isGenExportEnd') and conditionParamRef.isGenExportEnd != null">
            ${_conditionType_} a.isGenExport <![CDATA[ <= ]]> #{${_conditionParam_}.isGenExportEnd}
        </if>

        <if test="conditionParamRef.containsKey('isShowControl')">
            <if test="conditionParamRef.isShowControl != null ">
                ${_conditionType_} a.isShowControl = #{${_conditionParam_}.isShowControl}
            </if>
            <if test="conditionParamRef.isShowControl == null">
                ${_conditionType_} a.isShowControl is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('isShowControlList')">
            ${_conditionType_} a.isShowControl in
            <foreach collection="conditionParamRef.isShowControlList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('isShowControlStart') and conditionParamRef.isShowControlStart != null">
            ${_conditionType_} a.isShowControl <![CDATA[ >= ]]> #{${_conditionParam_}.isShowControlStart}
        </if>
        <if test="conditionParamRef.containsKey('isShowControlEnd') and conditionParamRef.isShowControlEnd != null">
            ${_conditionType_} a.isShowControl <![CDATA[ <= ]]> #{${_conditionParam_}.isShowControlEnd}
        </if>


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

        <if test="conditionParamRef.containsKey('options')">
            <if test="conditionParamRef.options != null and conditionParamRef.options != ''">
                ${_conditionType_} a.options like #{${_conditionParam_}.options}
            </if>
            <if test="conditionParamRef.options == null">
                ${_conditionType_} a.options is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('optionsList')">
            ${_conditionType_} a.options in
            <foreach collection="conditionParamRef.optionsList" 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')">
            ${_conditionType_} a.remark in
            <foreach collection="conditionParamRef.remarkList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('appId')">
            <if test="conditionParamRef.appId != null ">
                ${_conditionType_} a.appId = #{${_conditionParam_}.appId}
            </if>
            <if test="conditionParamRef.appId == null">
                ${_conditionType_} a.appId is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('appIdList')">
            ${_conditionType_} a.appId in
            <foreach collection="conditionParamRef.appIdList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('appIdStart') and conditionParamRef.appIdStart != null">
            ${_conditionType_} a.appId <![CDATA[ >= ]]> #{${_conditionParam_}.appIdStart}
        </if>
        <if test="conditionParamRef.containsKey('appIdEnd') and conditionParamRef.appIdEnd != null">
            ${_conditionType_} a.appId <![CDATA[ <= ]]> #{${_conditionParam_}.appIdEnd}
        </if>


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

        <if test="conditionParamRef.containsKey('updateUser')">
            <if test="conditionParamRef.updateUser != null and conditionParamRef.updateUser != ''">
                ${_conditionType_} a.updateUser like #{${_conditionParam_}.updateUser}
            </if>
            <if test="conditionParamRef.updateUser == null">
                ${_conditionType_} a.updateUser is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('updateUserList')">
            ${_conditionType_} a.updateUser in
            <foreach collection="conditionParamRef.updateUserList" 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('createUser')">
            <if test="conditionParamRef.createUser != null and conditionParamRef.createUser != ''">
                ${_conditionType_} a.createUser like #{${_conditionParam_}.createUser}
            </if>
            <if test="conditionParamRef.createUser == null">
                ${_conditionType_} a.createUser is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('createUserList')">
            ${_conditionType_} a.createUser in
            <foreach collection="conditionParamRef.createUserList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </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('tableName')">
                    a.tableName
                    <if test='orderCol.tableName != null and "DESC".equalsIgnoreCase(orderCol.tableName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('tableComment')">
                    a.tableComment
                    <if test='orderCol.tableComment != null and "DESC".equalsIgnoreCase(orderCol.tableComment)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('subTableName')">
                    a.subTableName
                    <if test='orderCol.subTableName != null and "DESC".equalsIgnoreCase(orderCol.subTableName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('subTableFkName')">
                    a.subTableFkName
                    <if test='orderCol.subTableFkName != null and "DESC".equalsIgnoreCase(orderCol.subTableFkName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('className')">
                    a.className
                    <if test='orderCol.className != null and "DESC".equalsIgnoreCase(orderCol.className)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('tplCategory')">
                    a.tplCategory
                    <if test='orderCol.tplCategory != null and "DESC".equalsIgnoreCase(orderCol.tplCategory)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('packageName')">
                    a.packageName
                    <if test='orderCol.packageName != null and "DESC".equalsIgnoreCase(orderCol.packageName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('moduleName')">
                    a.moduleName
                    <if test='orderCol.moduleName != null and "DESC".equalsIgnoreCase(orderCol.moduleName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('businessName')">
                    a.businessName
                    <if test='orderCol.businessName != null and "DESC".equalsIgnoreCase(orderCol.businessName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('functionName')">
                    a.functionName
                    <if test='orderCol.functionName != null and "DESC".equalsIgnoreCase(orderCol.functionName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('functionAuthor')">
                    a.functionAuthor
                    <if test='orderCol.functionAuthor != null and "DESC".equalsIgnoreCase(orderCol.functionAuthor)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('cacheServiceType')">
                    a.cacheServiceType
                    <if test='orderCol.cacheServiceType != null and "DESC".equalsIgnoreCase(orderCol.cacheServiceType)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('genType')">
                    a.genType
                    <if test='orderCol.genType != null and "DESC".equalsIgnoreCase(orderCol.genType)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('dividedTableType')">
                    a.dividedTableType
                    <if test='orderCol.dividedTableType != null and "DESC".equalsIgnoreCase(orderCol.dividedTableType)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('genFeign')">
                    a.genFeign
                    <if test='orderCol.genFeign != null and "DESC".equalsIgnoreCase(orderCol.genFeign)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('feignAppName')">
                    a.feignAppName
                    <if test='orderCol.feignAppName != null and "DESC".equalsIgnoreCase(orderCol.feignAppName)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('detailShow')">
                    a.detailShow
                    <if test='orderCol.detailShow != null and "DESC".equalsIgnoreCase(orderCol.detailShow)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('genApi')">
                    a.genApi
                    <if test='orderCol.genApi != null and "DESC".equalsIgnoreCase(orderCol.genApi)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('isGenExport')">
                    a.isGenExport
                    <if test='orderCol.isGenExport != null and "DESC".equalsIgnoreCase(orderCol.isGenExport)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('isShowControl')">
                    a.isShowControl
                    <if test='orderCol.isShowControl != null and "DESC".equalsIgnoreCase(orderCol.isShowControl)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('genPath')">
                    a.genPath
                    <if test='orderCol.genPath != null and "DESC".equalsIgnoreCase(orderCol.genPath)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('options')">
                    a.options
                    <if test='orderCol.options != null and "DESC".equalsIgnoreCase(orderCol.options)'>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('appId')">
                    a.appId
                    <if test='orderCol.appId != null and "DESC".equalsIgnoreCase(orderCol.appId)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('updateTime')">
                    a.updateTime
                    <if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('updateUser')">
                    a.updateUser
                    <if test='orderCol.updateUser != null and "DESC".equalsIgnoreCase(orderCol.updateUser)'>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('createUser')">
                    a.createUser
                    <if test='orderCol.createUser != null and "DESC".equalsIgnoreCase(orderCol.createUser)'>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>