<?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.ruoyi.busi.mapper.BusiFeedbackMapper">


    <select id="queryListPage" resultType="com.ruoyi.busi.vo.BusiFeedbackVo">
        select main.id, main.user_id, main.user_type, main.content, main.images, main.back_content,
               main.back_images, main.back_time, main.back_user_id, main.creator, main.create_time, main.updater, main.update_time, main.del_flag
        , su1.nick_name as userNickName, su2.nick_name as backUserNickName
        from dl_busi_feedback main
        inner join sys_user su1 on main.user_id = su1.user_id and su1.del_flag = '0'
        left join sys_user su2 on main.back_user_id = su2.user_id
        <where>
                main.del_flag = '0'
            <if test="entity.userId != null and entity.userId != '' ">
                and main.user_id = #{entity.userId}
            </if>
            <if test="entity.userNickName != null and entity.userNickName != '' ">
                and su1.nick_name like concat('%', #{entity.userNickName}, '%')
            </if>
            <if test="entity.backUserNickName != null  and entity.backUserNickName != ''">
                and su2.nick_name like concat('%', #{entity.backUserNickName}, '%')
            </if>
        </where>
        order by main.create_time asc
    </select>

</mapper>
