cloudroam
2024-12-04 2432594a4d11b47a503795349defa31872f85789
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
<?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.mzl.flower.mapper.log.OperationRecordMapper">
 
    <select id="queryPage" resultType="com.mzl.flower.dto.response.log.OperationRecordVO">
        select t.* , u.nick_name createName from t_operation_record t
        LEFT JOIN t_user u ON t.create_by = u.id
        where t.deleted= 0
        <if test="dto.createName != null and dto.createName != ''">
            and u.nick_name like concat('%', #{dto.createName}, '%')
        </if>
        <if test="dto.module != null and dto.module != ''">
            and t.module = #{dto.module}
        </if>
        <if test="dto.function != null and dto.function != ''">
            and t.function like concat('%', #{dto.function}, '%')
        </if>
        <if test="dto.content != null and dto.content != ''">
            and t.content like concat('%', #{dto.content}, '%')
        </if>
        <if test="dto.createDateBeginStr!=null ">
            AND DATE_FORMAT(t.create_time, '%Y-%m-%d') &gt;= #{dto.createDateBeginStr}
        </if>
        <if test="dto.createDateEndStr!=null ">
            AND DATE_FORMAT(t.create_time, '%Y-%m-%d') &lt;= #{dto.createDateEndStr}
        </if>
        order by t.create_time desc
    </select>
</mapper>