<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.unis.interactiveCommunication.modular.icPublicOpinionCollect.mapper.IcPublicOpinionCollectMapper">


    <select id="selectMyPage"
            resultType="com.unis.interactiveCommunication.modular.icPublicOpinionCollect.vo.IcPublicOpinionCollectVO">

        SELECT t1.*,t3.department_name, count( t2.public_opinion_collect_id ) viewsNumber FROM biz_ic_public_opinion_collect t1 LEFT JOIN
        biz_ic_public_opinion_collect_message t2 ON t1.id = t2.public_opinion_collect_id
              left join biz_io_department_function t3 on t1.io_department_function_id=t3.id
        <where>

            <if test="collectionTitle!=null and collectionTitle!=''">
                and t1.collection_title like concat("%",#{collectionTitle},"%")
            </if>
            <if test="progressStatus!=null ">
                and t1.progress_status=#{progressStatus}
            </if>
        </where>
        group by t1.id
        order by t1.create_time desc

    </select>
</mapper>