44323
2024-05-21 781b5fea46cd55220b5ffca17aa6bb1b83551410
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?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.management.mapper.TFeedbackMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.management.domain.TFeedback">
        <id column="id" property="id" />
        <result column="userId" property="userId" />
        <result column="img" property="img" />
        <result column="content" property="content" />
        <result column="state" property="state" />
        <result column="insertTime" property="insertTime" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, userId, img, content, state, insertTime
    </sql>
    <select id="listAll" resultType="com.ruoyi.management.vo.FeedbackVO">
        select t1.*,t2.name as name ,t2.phone as phone
        from t_feedback t1
        left join t_user t2 on t1.userId = t2.id
        where 1=1
        <if test="null != req.userName and '' != req.userName">
            and t2.name like CONCAT('%', #{req.userName}, '%')
        </if>
        <if test="null != req.phone and '' != req.phone">
            and t2.phone like CONCAT('%', #{req.phone}, '%')
        </if>
        <if test="null != req.state">
            and t1.state = #{req.state}
        </if>
        <if test="null != req.startTime">
            and t1.insertTime between #{req.startTime} and #{req.endTime}
        </if>
        order by t1.state,t1.insertTime desc
    </select>
 
 
</mapper>