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.
reagent_manage/java/src/main/resources/mapper/RecLoginHistory.xml

26 lines
1.3 KiB

<?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.toesbieya.my.mapper.RecLoginHistoryMapper">
<sql id="searchCondition">
<if test="uid!=null">and uid=#{uid}</if>
<if test="uname!=null and uname!=''">and uname like "%"#{uname}"%"</if>
<if test="type!=null">and type=#{type}</if>
<if test="ip!=null and ip!=''">and ip =#{ip}</if>
<if test="address!=null and address!=''">and address like "%"#{address}"%"</if>
<if test="startTime!=null">and time <![CDATA[ >= ]]> #{startTime}</if>
<if test="endTime!=null">and time <![CDATA[ <= ]]> #{endTime}</if>
</sql>
<select id="search" resultType="com.toesbieya.my.model.entity.RecLoginHistory"
parameterType="com.toesbieya.my.model.vo.search.LoginHistorySearch">
select *
from rec_login_history
where 1
<include refid="searchCondition"/>
order by time desc
</select>
<insert id="insert" parameterType="com.toesbieya.my.model.entity.RecLoginHistory">
insert into rec_login_history (uid, uname, ip, address, type, time)
VALUES (#{uid}, #{uname}, #{ip}, #{address}, #{type}, #{time})
</insert>
</mapper>