综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SysLogininforMapper.xml 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.system.mapper.SysLogininforMapper">
  6. <resultMap type="SysLogininfor" id="SysLogininforResult">
  7. <id property="infoId" column="info_id" />
  8. <result property="userName" column="user_name" />
  9. <result property="nickName" column="nick_name" />
  10. <result property="status" column="status" />
  11. <result property="ipaddr" column="ipaddr" />
  12. <result property="loginLocation" column="login_location" />
  13. <result property="browser" column="browser" />
  14. <result property="os" column="os" />
  15. <result property="msg" column="msg" />
  16. <result property="loginTime" column="login_time" />
  17. </resultMap>
  18. <insert id="insertLogininfor" parameterType="SysLogininfor">
  19. insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time)
  20. values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate())
  21. </insert>
  22. <select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
  23. select l.info_id, l.user_name, l.ipaddr, l.login_location, l.browser, l.os, l.status, l.msg, l.login_time, u.nick_name from sys_logininfor as l
  24. left join sys_user as u on u.user_name = l.user_name
  25. <where>
  26. <if test="ipaddr != null and ipaddr != ''">
  27. AND l.ipaddr like concat('%', #{ipaddr}, '%')
  28. </if>
  29. <if test="status != null and status != ''">
  30. AND l.status = #{status}
  31. </if>
  32. <if test="userName != null and userName != ''">
  33. AND l.user_name like concat('%', #{userName}, '%')
  34. </if>
  35. <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
  36. AND l.login_time &gt;= #{params.beginTime}
  37. </if>
  38. <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
  39. AND l.login_time &lt;= #{params.endTime}
  40. </if>
  41. </where>
  42. order by l.info_id desc
  43. </select>
  44. <delete id="deleteLogininforByIds" parameterType="Long">
  45. delete from sys_logininfor where info_id in
  46. <foreach collection="array" item="infoId" open="(" separator="," close=")">
  47. #{infoId}
  48. </foreach>
  49. </delete>
  50. <update id="cleanLogininfor">
  51. truncate table sys_logininfor
  52. </update>
  53. </mapper>