TAppuserLoginLogMapper.xml 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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.bussiness.mapper.TAppuserLoginLogMapper">
  6. <resultMap type="TAppuserLoginLog" id="TAppuserLoginLogResult">
  7. <result property="id" column="id" />
  8. <result property="userId" column="user_id" />
  9. <result property="username" column="username" />
  10. <result property="ipaddr" column="ipaddr" />
  11. <result property="loginLocation" column="login_location" />
  12. <result property="browser" column="browser" />
  13. <result property="os" column="os" />
  14. <result property="status" column="status" />
  15. <result property="msg" column="msg" />
  16. <result property="loginTime" column="login_time" />
  17. </resultMap>
  18. <sql id="selectTAppuserLoginLogVo">
  19. select id, user_id, username, ipaddr, login_location, browser, os, status, msg, login_time from t_appuser_login_log
  20. </sql>
  21. <select id="selectTAppuserLoginLogList" parameterType="TAppuserLoginLog" resultMap="TAppuserLoginLogResult">
  22. <include refid="selectTAppuserLoginLogVo"/>
  23. <where>
  24. <if test="userId != null "> and user_id = #{userId}</if>
  25. <if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
  26. <if test="ipaddr != null and ipaddr != ''"> and ipaddr = #{ipaddr}</if>
  27. <if test="loginLocation != null and loginLocation != ''"> and login_location = #{loginLocation}</if>
  28. <if test="browser != null and browser != ''"> and browser = #{browser}</if>
  29. <if test="os != null and os != ''"> and os = #{os}</if>
  30. <if test="status != null and status != ''"> and status = #{status}</if>
  31. <if test="msg != null and msg != ''"> and msg = #{msg}</if>
  32. <if test="loginTime != null "> and login_time = #{loginTime}</if>
  33. </where>
  34. order by login_time desc
  35. </select>
  36. <select id="selectTAppuserLoginLogById" parameterType="Long" resultMap="TAppuserLoginLogResult">
  37. <include refid="selectTAppuserLoginLogVo"/>
  38. where id = #{id}
  39. </select>
  40. <insert id="insertTAppuserLoginLog" parameterType="TAppuserLoginLog" useGeneratedKeys="true" keyProperty="id">
  41. insert into t_appuser_login_log
  42. <trim prefix="(" suffix=")" suffixOverrides=",">
  43. <if test="userId != null">user_id,</if>
  44. <if test="username != null">username,</if>
  45. <if test="ipaddr != null">ipaddr,</if>
  46. <if test="loginLocation != null">login_location,</if>
  47. <if test="browser != null">browser,</if>
  48. <if test="os != null">os,</if>
  49. <if test="status != null">status,</if>
  50. <if test="msg != null">msg,</if>
  51. <if test="loginTime != null">login_time,</if>
  52. </trim>
  53. <trim prefix="values (" suffix=")" suffixOverrides=",">
  54. <if test="userId != null">#{userId},</if>
  55. <if test="username != null">#{username},</if>
  56. <if test="ipaddr != null">#{ipaddr},</if>
  57. <if test="loginLocation != null">#{loginLocation},</if>
  58. <if test="browser != null">#{browser},</if>
  59. <if test="os != null">#{os},</if>
  60. <if test="status != null">#{status},</if>
  61. <if test="msg != null">#{msg},</if>
  62. <if test="loginTime != null">#{loginTime},</if>
  63. </trim>
  64. </insert>
  65. <update id="updateTAppuserLoginLog" parameterType="TAppuserLoginLog">
  66. update t_appuser_login_log
  67. <trim prefix="SET" suffixOverrides=",">
  68. <if test="userId != null">user_id = #{userId},</if>
  69. <if test="username != null">username = #{username},</if>
  70. <if test="ipaddr != null">ipaddr = #{ipaddr},</if>
  71. <if test="loginLocation != null">login_location = #{loginLocation},</if>
  72. <if test="browser != null">browser = #{browser},</if>
  73. <if test="os != null">os = #{os},</if>
  74. <if test="status != null">status = #{status},</if>
  75. <if test="msg != null">msg = #{msg},</if>
  76. <if test="loginTime != null">login_time = #{loginTime},</if>
  77. </trim>
  78. where id = #{id}
  79. </update>
  80. <delete id="deleteTAppuserLoginLogById" parameterType="Long">
  81. delete from t_appuser_login_log where id = #{id}
  82. </delete>
  83. <delete id="deleteTAppuserLoginLogByIds" parameterType="String">
  84. delete from t_appuser_login_log where id in
  85. <foreach item="id" collection="array" open="(" separator="," close=")">
  86. #{id}
  87. </foreach>
  88. </delete>
  89. </mapper>