| | |
| | | <?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.lf.server.mapper.sys.LoginMapper"> |
| | | <select id="selectCount" resultType="java.lang.Integer" parameterType="java.lang.String"> |
| | | <select id="selectCount" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_login a inner join lf.sys_user b on a.userid = b.id |
| | | <where> |
| | | 1 = 1 |
| | | <if test="uname != null"> |
| | | and b.uname like #{uname} |
| | | and upper(b.uname) like #{uname} |
| | | </if> |
| | | <if test="type != null"> |
| | | and a.type = #{type} |
| | |
| | | <where> |
| | | 1 = 1 |
| | | <if test="uname != null"> |
| | | and b.uname like #{uname} |
| | | and upper(b.uname) like #{uname} |
| | | </if> |
| | | <if test="type != null"> |
| | | and a.type = #{type} |
| | |
| | | and a.optime <= #{end} |
| | | </if> |
| | | </where> |
| | | order by a.id |
| | | order by a.id desc |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectLoginAll" resultType="com.lf.server.entity.sys.LoginEntity"> |
| | | select * from lf.sys_login order by id; |
| | | select * from lf.sys_login order by id desc |
| | | </select> |
| | | |
| | | <select id="selectLogin" resultType="com.lf.server.entity.sys.LoginEntity"> |
| | |
| | | <update id="updateLogin"> |
| | | update lf.sys_login set appid=#{appid},ip=#{ip},type=#{type},status=#{status},descr=#{descr},userid=#{userid},optime=now() where id=#{id} |
| | | </update> |
| | | |
| | | <select id="selectLoginCounts" resultType="com.lf.server.entity.sys.LoginEntity"> |
| | | select to_char(optime,'yyyy-mm-dd') as optime,count(*) from lf.sys_login where optime between (select optime - interval '30 day') |
| | | and optime group by to_char(optime, 'yyyy-mm-dd') order by to_char(optime, 'yyyy-mm-dd') asc |
| | | </select> |
| | | </mapper> |