<?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.mcwl.communityCenter.mapper.CommunityAdviceMapper">


    <select id="getCommunityAdviceList" resultType="com.mcwl.communityCenter.domain.vo.CommunityAdviceVo">
        select a.*,
        u.nick_name as send_user_name,
        u.avatar as send_user_avatar
        from cc_advice a left join sys_user u on
        a.tenant_id = u.user_id
        where a.del_flag = '0'
        <if test="communityAdvicePageRes.adviceType != null">
            and a.advice_type = #{communityAdvicePageRes.adviceType}
        </if>
        order by a.create_time desc
    </select>
</mapper>