1
zj
2024-06-13 8eea5be3b36875bd4ffe70e6c3a5bb07b1d829bf
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
<?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.yami.trading.dao.log.LogMapper">
 
  <select id="listPage" resultType="com.yami.trading.bean.log.dto.LogDto">
      SELECT l.*,u.user_name,u.user_code,u.role_name FROM t_log  l
      LEFT JOIN  tz_user  u ON  l.user_id=u.user_id
           where 1=1
        <if test="rolename!=null and rolename!=''">
             and u.role_name=#{rolename}
        </if>
      <if test="log!=null and log!=''">
          and l.log  like  CONCAT('%', #{log}, '%')
      </if>
      <if test="category!=null and category!=''">
          and l.category=#{category}
      </if>
 
      <if test="userName!=null and userName!=''">
          and u.user_name=#{userName} or u.user_code=#{userName}
      </if>
 
      <if test="operator!=null and operator!=''">
          and l.operator=#{operator}
      </if>
      <if test="userIds !=null and userIds.size > 0">
          and l.user_id  in
          <foreach collection="userIds" item="item" index="index" open="(" close=")" separator=",">
              #{item}
          </foreach>
      </if>
      <if test="isRoot">
          and l.operator!="root"
      </if>
      order by l.create_time desc
  </select>
</mapper>