SysLogMapper.xml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.simuwang.base.mapper.system.SysLogMapper">
  4. <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.LoggingDO">
  5. <id column="id" property="id"/>
  6. <result column="title" property="title"/>
  7. <result column="type" property="type"/>
  8. <result column="request_uri" property="requestUri"/>
  9. <result column="method" property="method"/>
  10. <result column="remote_addr" property="remoteAddr"/>
  11. <result column="execute_time" property="executeTime"/>
  12. <result column="params" property="params"/>
  13. <result column="user_name" property="userName"/>
  14. <result column="createtime" property="createTime"/>
  15. </resultMap>
  16. <update id="deleteLog">
  17. update PPW_EMAIL.sys_log set isvalid=0,sysdate=sysdate() where isvalid=1 and id in
  18. <foreach item="id" collection="idList" open="(" separator="," close=")">
  19. #{id}
  20. </foreach>
  21. </update>
  22. <select id="searchLogList" resultMap="BaseResultMap">
  23. select distinct log.id,log.title,log.type,log.request_uri,log.method,log.remote_addr,log.execute_time,log.params,log.params,log.createtime,u.user_name
  24. from PPW_EMAIL.sys_log log
  25. left join PPW_EMAIL.sys_user u
  26. on log.creatorid=u.user_id and u.isvalid=1
  27. <where>
  28. <if test="title != null and title !=''">
  29. and log.title like concat ('%',#{title},'%')
  30. </if>
  31. <if test="userName != null and userName !=''">
  32. and u.user_name like concat ('%',#{userName},'%')
  33. </if>
  34. </where>
  35. order by log.createtime desc
  36. limit #{offset},#{pageSize}
  37. </select>
  38. <select id="countLogList" resultType="java.lang.Long">
  39. select count(distinct log.id)
  40. from PPW_EMAIL.sys_log log
  41. left join PPW_EMAIL.sys_user u
  42. on log.creatorid=u.user_id and u.isvalid=1
  43. <where>
  44. <if test="title != null and title !=''">
  45. and log.title like concat ('%',#{title},'%')
  46. </if>
  47. <if test="userName != null and userName !=''">
  48. and u.user_name like concat ('%',#{userName},'%')
  49. </if>
  50. </where>
  51. </select>
  52. </mapper>