若依sqlserver mapper.xml
2022/4/13 19:12:46
本文主要是介绍若依sqlserver mapper.xml,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
<?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.ruoyi.project.monitor.mapper.SysLogininforMapper"> <resultMap type="SysLogininfor" id="SysLogininforResult"> <id property="infoId" column="info_id" /> <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" /> </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}, GETDATE()) </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 <where> <if test="ipaddr != null and ipaddr != ''"> AND ipaddr like '%' + #{ipaddr} + '%' </if> <if test="status != null and status != ''"> AND status = #{status} </if> <if test="userName != null and userName != ''"> AND user_name like '%' + #{userName} + '%' </if> <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 --> and date_format(login_time,'%y%m%d') >= date_format(#{beginTime},'%y%m%d') </if> <if test="endTime != null and endTime != ''"><!-- 结束时间检索 --> and date_format(login_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d') </if> </where> order by info_id desc </select> <delete id="deleteLogininforByIds" parameterType="Long"> delete from sys_logininfor where info_id in <foreach collection="array" item="infoId" open="(" separator="," close=")"> #{infoId} </foreach> </delete> <update id="cleanLogininfor"> truncate table sys_logininfor </update> </mapper>
这篇关于若依sqlserver mapper.xml的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-01-08Docker下的SqlServer发布订阅启用
- 2023-06-05Docker安装MS SQL Server并使用Navicat远程连接
- 2023-05-25深入浅出 SQL Server CDC 数据同步
- 2023-05-12通过空间占用和执行计划了解SQL Server的行存储索引
- 2023-04-24以SQLserver为例的Dapper详细讲解
- 2022-11-30SQL server高级函数查询
- 2022-11-26SQL SERVER数据库服务器CPU不能全部利用原因分析
- 2022-11-21SQL Server 时间算差值/常用函数
- 2022-11-20调试Archery连接SQL Server提示驱动错误
- 2022-10-22SQL Server 完整、差异备份+完整、差异还原(详细讲解,规避错误)