<?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.feedback.dao.ibatis.FeedbackDaoImpl">

    <!-- 字段和属性映射 -->
    <resultMap type="FeedbackEntity" id="FeedbackEntity-Map">
        <id  property="id" column="id" />
        <result property="title" column="title" />
        <result property="feedbackTimeStart" column="feedbackTimeStart" />
        <result property="feedbackTimeEnd" column="feedbackTimeEnd" />
        <result property="inviteNum" column="inviteNum" />
        <result property="feedbackNum" column="feedbackNum" />
        <result property="processStatus" column="processStatus" />
        <result property="weblink" column="weblink" />
        <result property="webUrl" column="webUrl" />
        <result property="remark" column="remark" />
        <result property="createUserId" column="createUserId" />
        <result property="createTime" column="createTime" />
        <result property="updateUserId" column="updateUserId" />
        <result property="updateTime" column="updateTime" />
        <result property="formContent" column="formContent" />
        <result property="ruleContent" column="ruleContent" />
        <collection property="feedbackQuestionList" column="id" ofType="FeedbackQuestionEntity" javaType="ArrayList" select="getFeedbackQuestionByFeedbackId"></collection>
    </resultMap>
    <resultMap type="FeedbackQuestionEntity" id="FeedbackQuestionEntity-Map">
        <result property="id" column="id" />
        <result property="feedbackId" column="feedbackId" />
        <result property="content" column="content" />
        <result property="questionType" column="questionType" />
        <result property="require" column="require" />
        <result property="style" column="style" />
        <result property="remark" column="remark" />
        <result property="createUserId" column="createUserId" />
        <result property="createTime" column="createTime" />
        <result property="updateUserId" column="updateUserId" />
        <result property="updateTime" column="updateTime" />
    </resultMap>


    <!-- 表所有列 -->
    <sql id="_columns">
        <trim suffixOverrides="," suffix="">
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('id') or colPickMode == 1 and data.containsKey('id')))">
                a.id,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('title') or colPickMode == 1 and data.containsKey('title')))">
                a.title,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('feedbackTimeStart') or colPickMode == 1 and data.containsKey('feedbackTimeStart')))">
                a.feedbackTimeStart,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('feedbackTimeEnd') or colPickMode == 1 and data.containsKey('feedbackTimeEnd')))">
                a.feedbackTimeEnd,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('inviteNum') or colPickMode == 1 and data.containsKey('inviteNum')))">
                a.inviteNum,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('feedbackNum') or colPickMode == 1 and data.containsKey('feedbackNum')))">
                a.feedbackNum,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('processStatus') or colPickMode == 1 and data.containsKey('processStatus')))">
                a.processStatus,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('weblink') or colPickMode == 1 and data.containsKey('weblink')))">
                a.weblink,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('webUrl') or colPickMode == 1 and data.containsKey('webUrl')))">
                a.webUrl,
            </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('createUserId') or colPickMode == 1 and data.containsKey('createUserId')))">
                a.createUserId,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('createTime') or colPickMode == 1 and data.containsKey('createTime')))">
                a.createTime,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateUserId') or colPickMode == 1 and data.containsKey('updateUserId')))">
                a.updateUserId,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
                a.updateTime,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('formContent') or colPickMode == 1 and data.containsKey('formContent')))">
                a.formContent,
            </if>
            <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('ruleContent') or colPickMode == 1 and data.containsKey('ruleContent')))">
                a.ruleContent,
            </if>
        </trim>
    </sql>
    <!-- 子表所有列 -->
    <sql id="_columns_sub">
        <trim suffixOverrides="," suffix="">
            b.id,b.feedbackId,b.content,b.questionType,b.`require`,b.style,b.remark,b.createUserId,b.createTime,b.updateUserId,b.updateTime,
        </trim>
    </sql>
    <!-- 新增 区分主键自增加还是业务插入 -->
    <insert id="insert" parameterType="FeedbackEntity"  useGeneratedKeys="true" keyProperty="id">
        insert into mortals_xhx_feedback
        (title,feedbackTimeStart,feedbackTimeEnd,inviteNum,feedbackNum,processStatus,weblink,webUrl,remark,createUserId,createTime,updateUserId,updateTime,formContent,ruleContent)
        VALUES
        (#{title},#{feedbackTimeStart},#{feedbackTimeEnd},#{inviteNum},#{feedbackNum},#{processStatus},#{weblink},#{webUrl},#{remark},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{formContent},#{ruleContent})
    </insert>

    <!-- 批量新增 -->
    <insert id="insertBatch" parameterType="paramDto">
        insert into mortals_xhx_feedback
        (title,feedbackTimeStart,feedbackTimeEnd,inviteNum,feedbackNum,processStatus,weblink,webUrl,remark,createUserId,createTime,updateUserId,updateTime,formContent,ruleContent)
        VALUES
        <foreach collection="data.dataList" item="item" index="index" separator="," >
            (#{item.title},#{item.feedbackTimeStart},#{item.feedbackTimeEnd},#{item.inviteNum},#{item.feedbackNum},#{item.processStatus},#{item.weblink},#{item.webUrl},#{item.remark},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.formContent},#{item.ruleContent})
        </foreach>
    </insert>


    <!-- 根据ParamDto更新 -->
    <update id="update" parameterType="paramDto">
        update mortals_xhx_feedback as a
        set
        <trim suffixOverrides="," suffix="">
            <if test="(colPickMode==0 and data.containsKey('title')) or (colPickMode==1 and !data.containsKey('title'))">
                a.title=#{data.title},
            </if>
            <if test="(colPickMode==0 and data.containsKey('feedbackTimeStart')) or (colPickMode==1 and !data.containsKey('feedbackTimeStart'))">
                a.feedbackTimeStart=#{data.feedbackTimeStart},
            </if>
            <if test="(colPickMode==0 and data.containsKey('feedbackTimeEnd')) or (colPickMode==1 and !data.containsKey('feedbackTimeEnd'))">
                a.feedbackTimeEnd=#{data.feedbackTimeEnd},
            </if>
            <if test="(colPickMode==0 and data.containsKey('inviteNum')) or (colPickMode==1 and !data.containsKey('inviteNum'))">
                a.inviteNum=#{data.inviteNum},
            </if>
            <if test="(colPickMode==0 and data.containsKey('inviteNumIncrement')) or (colPickMode==1 and !data.containsKey('inviteNumIncrement'))">
                a.inviteNum=ifnull(a.inviteNum,0) + #{data.inviteNumIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('feedbackNum')) or (colPickMode==1 and !data.containsKey('feedbackNum'))">
                a.feedbackNum=#{data.feedbackNum},
            </if>
            <if test="(colPickMode==0 and data.containsKey('feedbackNumIncrement')) or (colPickMode==1 and !data.containsKey('feedbackNumIncrement'))">
                a.feedbackNum=ifnull(a.feedbackNum,0) + #{data.feedbackNumIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('processStatus')) or (colPickMode==1 and !data.containsKey('processStatus'))">
                a.processStatus=#{data.processStatus},
            </if>
            <if test="(colPickMode==0 and data.containsKey('processStatusIncrement')) or (colPickMode==1 and !data.containsKey('processStatusIncrement'))">
                a.processStatus=ifnull(a.processStatus,0) + #{data.processStatusIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('weblink')) or (colPickMode==1 and !data.containsKey('weblink'))">
                a.weblink=#{data.weblink},
            </if>
            <if test="(colPickMode==0 and data.containsKey('weblinkIncrement')) or (colPickMode==1 and !data.containsKey('weblinkIncrement'))">
                a.weblink=ifnull(a.weblink,0) + #{data.weblinkIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('webUrl')) or (colPickMode==1 and !data.containsKey('webUrl'))">
                a.webUrl=#{data.webUrl},
            </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('createUserId')) or (colPickMode==1 and !data.containsKey('createUserId'))">
                a.createUserId=#{data.createUserId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('createUserIdIncrement')) or (colPickMode==1 and !data.containsKey('createUserIdIncrement'))">
                a.createUserId=ifnull(a.createUserId,0) + #{data.createUserIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('createTime')) or (colPickMode==1 and !data.containsKey('createTime'))">
                a.createTime=#{data.createTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('updateUserId')) or (colPickMode==1 and !data.containsKey('updateUserId'))">
                a.updateUserId=#{data.updateUserId},
            </if>
            <if test="(colPickMode==0 and data.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !data.containsKey('updateUserIdIncrement'))">
                a.updateUserId=ifnull(a.updateUserId,0) + #{data.updateUserIdIncrement},
            </if>
            <if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
                a.updateTime=#{data.updateTime},
            </if>
            <if test="(colPickMode==0 and data.containsKey('formContent')) or (colPickMode==1 and !data.containsKey('formContent'))">
                a.formContent=#{data.formContent},
            </if>
            <if test="(colPickMode==0 and data.containsKey('ruleContent')) or (colPickMode==1 and !data.containsKey('ruleContent'))">
                a.ruleContent=#{data.ruleContent},
            </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_feedback as a
        <trim prefix="set" suffixOverrides=",">
            <trim prefix="title=(case" suffix="ELSE title end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('title')) or (colPickMode==1 and !item.containsKey('title'))">
                        when a.id=#{item.id} then #{item.title}
                    </if>
                </foreach>
            </trim>
            <trim prefix="feedbackTimeStart=(case" suffix="ELSE feedbackTimeStart end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('feedbackTimeStart')) or (colPickMode==1 and !item.containsKey('feedbackTimeStart'))">
                        when a.id=#{item.id} then #{item.feedbackTimeStart}
                    </if>
                </foreach>
            </trim>
            <trim prefix="feedbackTimeEnd=(case" suffix="ELSE feedbackTimeEnd end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('feedbackTimeEnd')) or (colPickMode==1 and !item.containsKey('feedbackTimeEnd'))">
                        when a.id=#{item.id} then #{item.feedbackTimeEnd}
                    </if>
                </foreach>
            </trim>
            <trim prefix="inviteNum=(case" suffix="ELSE inviteNum end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('inviteNum')) or (colPickMode==1 and !item.containsKey('inviteNum'))">
                            when a.id=#{item.id} then #{item.inviteNum}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('inviteNumIncrement')) or (colPickMode==1 and !item.containsKey('inviteNumIncrement'))">
                            when a.id=#{item.id} then ifnull(a.inviteNum,0) + #{item.inviteNumIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="feedbackNum=(case" suffix="ELSE feedbackNum end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('feedbackNum')) or (colPickMode==1 and !item.containsKey('feedbackNum'))">
                            when a.id=#{item.id} then #{item.feedbackNum}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('feedbackNumIncrement')) or (colPickMode==1 and !item.containsKey('feedbackNumIncrement'))">
                            when a.id=#{item.id} then ifnull(a.feedbackNum,0) + #{item.feedbackNumIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="processStatus=(case" suffix="ELSE processStatus end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('processStatus')) or (colPickMode==1 and !item.containsKey('processStatus'))">
                            when a.id=#{item.id} then #{item.processStatus}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('processStatusIncrement')) or (colPickMode==1 and !item.containsKey('processStatusIncrement'))">
                            when a.id=#{item.id} then ifnull(a.processStatus,0) + #{item.processStatusIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="weblink=(case" suffix="ELSE weblink end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('weblink')) or (colPickMode==1 and !item.containsKey('weblink'))">
                            when a.id=#{item.id} then #{item.weblink}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('weblinkIncrement')) or (colPickMode==1 and !item.containsKey('weblinkIncrement'))">
                            when a.id=#{item.id} then ifnull(a.weblink,0) + #{item.weblinkIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="webUrl=(case" suffix="ELSE webUrl end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('webUrl')) or (colPickMode==1 and !item.containsKey('webUrl'))">
                        when a.id=#{item.id} then #{item.webUrl}
                    </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="createUserId=(case" suffix="ELSE createUserId end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('createUserId')) or (colPickMode==1 and !item.containsKey('createUserId'))">
                            when a.id=#{item.id} then #{item.createUserId}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('createUserIdIncrement')) or (colPickMode==1 and !item.containsKey('createUserIdIncrement'))">
                            when a.id=#{item.id} then ifnull(a.createUserId,0) + #{item.createUserIdIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="createTime=(case" suffix="ELSE createTime end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('createTime')) or (colPickMode==1 and !item.containsKey('createTime'))">
                        when a.id=#{item.id} then #{item.createTime}
                    </if>
                </foreach>
            </trim>
            <trim prefix="updateUserId=(case" suffix="ELSE updateUserId end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <choose>
                        <when test="(colPickMode==0 and item.containsKey('updateUserId')) or (colPickMode==1 and !item.containsKey('updateUserId'))">
                            when a.id=#{item.id} then #{item.updateUserId}
                        </when>
                        <when test="(colPickMode==0 and item.containsKey('updateUserIdIncrement')) or (colPickMode==1 and !item.containsKey('updateUserIdIncrement'))">
                            when a.id=#{item.id} then ifnull(a.updateUserId,0) + #{item.updateUserIdIncrement}
                        </when>
                    </choose>
                </foreach>
            </trim>
            <trim prefix="updateTime=(case" suffix="ELSE updateTime end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('updateTime')) or (colPickMode==1 and !item.containsKey('updateTime'))">
                        when a.id=#{item.id} then #{item.updateTime}
                    </if>
                </foreach>
            </trim>
            <trim prefix="formContent=(case" suffix="ELSE formContent end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('formContent')) or (colPickMode==1 and !item.containsKey('formContent'))">
                        when a.id=#{item.id} then #{item.formContent}
                    </if>
                </foreach>
            </trim>
            <trim prefix="ruleContent=(case" suffix="ELSE ruleContent end),">
                <foreach collection="data.dataList" item="item" index="index" separator="" >
                    <if test="(colPickMode==0 and item.containsKey('ruleContent')) or (colPickMode==1 and !item.containsKey('ruleContent'))">
                        when a.id=#{item.id} then #{item.ruleContent}
                    </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="FeedbackEntity-Map">
        select <include refid="_columns"/>
        from mortals_xhx_feedback as a
        where a.id=#{condition.id}
    </select>
    <!-- 根据主健删除 -->
    <delete id="deleteByKey" parameterType="paramDto">
        delete a.* from mortals_xhx_feedback as a where a.id=#{condition.id}
    </delete>
    <!-- 根据主健删除一批，针对单一主健有效 -->
    <delete id="deleteByKeys">
        delete from mortals_xhx_feedback where id in
        <foreach collection="array" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>
    <!-- 根据主健列表删除一批，针对单一主健有效 -->
    <delete id="deleteByKeyList">
        delete from mortals_xhx_feedback where id in
        <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>

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



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


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

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

        <if test="conditionParamRef.containsKey('feedbackTimeEnd')">
            <if test="conditionParamRef.feedbackTimeEnd != null ">
                ${_conditionType_} a.feedbackTimeEnd = #{${_conditionParam_}.feedbackTimeEnd}
            </if>
            <if test="conditionParamRef.feedbackTimeEnd == null">
                ${_conditionType_} a.feedbackTimeEnd is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('feedbackTimeEndStart') and conditionParamRef.feedbackTimeEndStart != null and conditionParamRef.feedbackTimeEndStart!=''">
            ${_conditionType_} a.feedbackTimeEnd <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.feedbackTimeEndStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
        </if>
        <if test="conditionParamRef.containsKey('feedbackTimeEndEnd') and conditionParamRef.feedbackTimeEndEnd != null and conditionParamRef.feedbackTimeEndEnd!=''">
            ${_conditionType_} a.feedbackTimeEnd <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.feedbackTimeEndEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
        </if>
        <if test="conditionParamRef.containsKey('inviteNum')">
            <if test="conditionParamRef.inviteNum != null ">
                ${_conditionType_} a.inviteNum = #{${_conditionParam_}.inviteNum}
            </if>
            <if test="conditionParamRef.inviteNum == null">
                ${_conditionType_} a.inviteNum is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('inviteNumList') and conditionParamRef.inviteNumList.size() > 0">
            ${_conditionType_} a.inviteNum in
            <foreach collection="conditionParamRef.inviteNumList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('inviteNumNotList') and conditionParamRef.inviteNumNotList.size() > 0">
            ${_conditionType_} a.inviteNum not in
            <foreach collection="conditionParamRef.inviteNumNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('inviteNumStart') and conditionParamRef.inviteNumStart != null">
            ${_conditionType_} a.inviteNum <![CDATA[ >= ]]> #{${_conditionParam_}.inviteNumStart}
        </if>
        <if test="conditionParamRef.containsKey('inviteNumEnd') and conditionParamRef.inviteNumEnd != null">
            ${_conditionType_} a.inviteNum <![CDATA[ <= ]]> #{${_conditionParam_}.inviteNumEnd}
        </if>

        <if test="conditionParamRef.containsKey('feedbackNum')">
            <if test="conditionParamRef.feedbackNum != null ">
                ${_conditionType_} a.feedbackNum = #{${_conditionParam_}.feedbackNum}
            </if>
            <if test="conditionParamRef.feedbackNum == null">
                ${_conditionType_} a.feedbackNum is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('feedbackNumList') and conditionParamRef.feedbackNumList.size() > 0">
            ${_conditionType_} a.feedbackNum in
            <foreach collection="conditionParamRef.feedbackNumList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('feedbackNumNotList') and conditionParamRef.feedbackNumNotList.size() > 0">
            ${_conditionType_} a.feedbackNum not in
            <foreach collection="conditionParamRef.feedbackNumNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('feedbackNumStart') and conditionParamRef.feedbackNumStart != null">
            ${_conditionType_} a.feedbackNum <![CDATA[ >= ]]> #{${_conditionParam_}.feedbackNumStart}
        </if>
        <if test="conditionParamRef.containsKey('feedbackNumEnd') and conditionParamRef.feedbackNumEnd != null">
            ${_conditionType_} a.feedbackNum <![CDATA[ <= ]]> #{${_conditionParam_}.feedbackNumEnd}
        </if>

        <if test="conditionParamRef.containsKey('processStatus')">
            <if test="conditionParamRef.processStatus != null ">
                ${_conditionType_} a.processStatus = #{${_conditionParam_}.processStatus}
            </if>
            <if test="conditionParamRef.processStatus == null">
                ${_conditionType_} a.processStatus is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('processStatusList') and conditionParamRef.processStatusList.size() > 0">
            ${_conditionType_} a.processStatus in
            <foreach collection="conditionParamRef.processStatusList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('processStatusNotList') and conditionParamRef.processStatusNotList.size() > 0">
            ${_conditionType_} a.processStatus not in
            <foreach collection="conditionParamRef.processStatusNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('processStatusStart') and conditionParamRef.processStatusStart != null">
            ${_conditionType_} a.processStatus <![CDATA[ >= ]]> #{${_conditionParam_}.processStatusStart}
        </if>
        <if test="conditionParamRef.containsKey('processStatusEnd') and conditionParamRef.processStatusEnd != null">
            ${_conditionType_} a.processStatus <![CDATA[ <= ]]> #{${_conditionParam_}.processStatusEnd}
        </if>

        <if test="conditionParamRef.containsKey('weblink')">
            <if test="conditionParamRef.weblink != null ">
                ${_conditionType_} a.weblink = #{${_conditionParam_}.weblink}
            </if>
            <if test="conditionParamRef.weblink == null">
                ${_conditionType_} a.weblink is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('weblinkList') and conditionParamRef.weblinkList.size() > 0">
            ${_conditionType_} a.weblink in
            <foreach collection="conditionParamRef.weblinkList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('weblinkNotList') and conditionParamRef.weblinkNotList.size() > 0">
            ${_conditionType_} a.weblink not in
            <foreach collection="conditionParamRef.weblinkNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('weblinkStart') and conditionParamRef.weblinkStart != null">
            ${_conditionType_} a.weblink <![CDATA[ >= ]]> #{${_conditionParam_}.weblinkStart}
        </if>
        <if test="conditionParamRef.containsKey('weblinkEnd') and conditionParamRef.weblinkEnd != null">
            ${_conditionType_} a.weblink <![CDATA[ <= ]]> #{${_conditionParam_}.weblinkEnd}
        </if>


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

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


        <if test="conditionParamRef.containsKey('createTime')">
            <if test="conditionParamRef.createTime != null ">
                ${_conditionType_} a.createTime = #{${_conditionParam_}.createTime}
            </if>
            <if test="conditionParamRef.createTime == null">
                ${_conditionType_} a.createTime is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('createTimeStart') and conditionParamRef.createTimeStart != null and conditionParamRef.createTimeStart!=''">
            ${_conditionType_} a.createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
        </if>
        <if test="conditionParamRef.containsKey('createTimeEnd') and conditionParamRef.createTimeEnd != null and conditionParamRef.createTimeEnd!=''">
            ${_conditionType_} a.createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
        </if>
        <if test="conditionParamRef.containsKey('updateUserId')">
            <if test="conditionParamRef.updateUserId != null ">
                ${_conditionType_} a.updateUserId = #{${_conditionParam_}.updateUserId}
            </if>
            <if test="conditionParamRef.updateUserId == null">
                ${_conditionType_} a.updateUserId is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('updateUserIdList') and conditionParamRef.updateUserIdList.size() > 0">
            ${_conditionType_} a.updateUserId in
            <foreach collection="conditionParamRef.updateUserIdList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('updateUserIdNotList') and conditionParamRef.updateUserIdNotList.size() > 0">
            ${_conditionType_} a.updateUserId not in
            <foreach collection="conditionParamRef.updateUserIdNotList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('updateUserIdStart') and conditionParamRef.updateUserIdStart != null">
            ${_conditionType_} a.updateUserId <![CDATA[ >= ]]> #{${_conditionParam_}.updateUserIdStart}
        </if>
        <if test="conditionParamRef.containsKey('updateUserIdEnd') and conditionParamRef.updateUserIdEnd != null">
            ${_conditionType_} a.updateUserId <![CDATA[ <= ]]> #{${_conditionParam_}.updateUserIdEnd}
        </if>


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

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

        <if test="conditionParamRef.containsKey('ruleContent')">
            <if test="conditionParamRef.ruleContent != null and conditionParamRef.ruleContent != ''">
                ${_conditionType_} a.ruleContent like #{${_conditionParam_}.ruleContent}
            </if>
            <if test="conditionParamRef.ruleContent == null">
                ${_conditionType_} a.ruleContent is null
            </if>
        </if>
        <if test="conditionParamRef.containsKey('ruleContentList') and conditionParamRef.ruleContentList.size() > 0">
            ${_conditionType_} a.ruleContent in
            <foreach collection="conditionParamRef.ruleContentList" open="(" close=")" index="index" item="item" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="conditionParamRef.containsKey('ruleContentNotList') and conditionParamRef.ruleContentNotList.size() > 0">
            ${_conditionType_} a.ruleContent not in
            <foreach collection="conditionParamRef.ruleContentNotList" 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('title')">
                    a.title
                    <if test='orderCol.title != null and "DESC".equalsIgnoreCase(orderCol.title)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('feedbackTimeStart')">
                    a.feedbackTimeStart
                    <if test='orderCol.feedbackTimeStart != null and "DESC".equalsIgnoreCase(orderCol.feedbackTimeStart)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('feedbackTimeEnd')">
                    a.feedbackTimeEnd
                    <if test='orderCol.feedbackTimeEnd != null and "DESC".equalsIgnoreCase(orderCol.feedbackTimeEnd)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('inviteNum')">
                    a.inviteNum
                    <if test='orderCol.inviteNum != null and "DESC".equalsIgnoreCase(orderCol.inviteNum)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('feedbackNum')">
                    a.feedbackNum
                    <if test='orderCol.feedbackNum != null and "DESC".equalsIgnoreCase(orderCol.feedbackNum)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('processStatus')">
                    a.processStatus
                    <if test='orderCol.processStatus != null and "DESC".equalsIgnoreCase(orderCol.processStatus)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('weblink')">
                    a.weblink
                    <if test='orderCol.weblink != null and "DESC".equalsIgnoreCase(orderCol.weblink)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('webUrl')">
                    a.webUrl
                    <if test='orderCol.webUrl != null and "DESC".equalsIgnoreCase(orderCol.webUrl)'>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('createUserId')">
                    a.createUserId
                    <if test='orderCol.createUserId != null and "DESC".equalsIgnoreCase(orderCol.createUserId)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('createTime')">
                    a.createTime
                    <if test='orderCol.createTime != null and "DESC".equalsIgnoreCase(orderCol.createTime)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('updateUserId')">
                    a.updateUserId
                    <if test='orderCol.updateUserId != null and "DESC".equalsIgnoreCase(orderCol.updateUserId)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('updateTime')">
                    a.updateTime
                    <if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('formContent')">
                    a.formContent
                    <if test='orderCol.formContent != null and "DESC".equalsIgnoreCase(orderCol.formContent)'>DESC</if>
                    ,
                </if>
                <if test="orderCol.containsKey('ruleContent')">
                    a.ruleContent
                    <if test='orderCol.ruleContent != null and "DESC".equalsIgnoreCase(orderCol.ruleContent)'>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>