RuoYi
2020-12-29 6d0b4f5d1685cb251e4efe28a0fc1fc2be184c71
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml
@@ -9,20 +9,17 @@
      <result property="userName"      column="user_name"         />
      <result property="status"        column="status"            />
      <result property="ipaddr"        column="ipaddr"            />
      <result property="loginLocation" column="login_location"    />
      <result property="browser"       column="browser"           />
      <result property="os"            column="os"                />
      <result property="msg"           column="msg"               />
      <result property="loginTime"     column="login_time"        />
      <result property="accessTime"    column="access_time"       />
   </resultMap>
   <insert id="insertLogininfor" parameterType="SysLogininfor">
      insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time)
      values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate())
      insert into sys_logininfor (user_name, status, ipaddr, msg, access_time)
      values (#{userName}, #{status}, #{ipaddr}, #{msg}, sysdate())
   </insert>
   
   <select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
      select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from sys_logininfor
      select info_id, user_name, ipaddr, status, msg, access_time from sys_logininfor
      <where>
         <if test="ipaddr != null and ipaddr != ''">
            AND ipaddr like concat('%', #{ipaddr}, '%')
@@ -33,11 +30,11 @@
         <if test="userName != null and userName != ''">
            AND user_name like concat('%', #{userName}, '%')
         </if>
         <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
            and date_format(login_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
         <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
            and date_format(access_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
         </if>
         <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
            and date_format(login_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
         <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
            and date_format(access_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
         </if>
      </where>
      order by info_id desc