| | |
| | | <?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.OperateMapper"> |
| | | |
| | | <!-- 统计行数 --> |
| | | <select id="selectCount" resultType="java.lang.Integer" parameterType="java.lang.String"> |
| | | select count(*) from lf.sys_operate |
| | | <select id="selectCount" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_operate a inner join lf.sys_user b on a.userid = b.id |
| | | <where> |
| | | <if test="userid != null"> |
| | | userid = #{userid} |
| | | 1 = 1 |
| | | <if test="uname != null"> |
| | | and upper(b.uname) like #{uname} |
| | | </if> |
| | | <if test="type != null"> |
| | | and a.type = #{type} |
| | | </if> |
| | | <if test="start != null"> |
| | | and a.optime >= #{start} |
| | | </if> |
| | | <if test="end != null"> |
| | | and a.optime <= #{end} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!-- 分页查询 --> |
| | | <select id="selectByPage" resultType="com.lf.server.entity.sys.OperateEntity"> |
| | | select * from lf.sys_operate |
| | | select a.*,b.uname from lf.sys_operate a inner join lf.sys_user b on a.userid = b.id |
| | | <where> |
| | | <if test="userid != null"> |
| | | userid = #{userid} |
| | | 1 = 1 |
| | | <if test="uname != null"> |
| | | and upper(b.uname) like #{uname} |
| | | </if> |
| | | <if test="type != null"> |
| | | and a.type = #{type} |
| | | </if> |
| | | <if test="start != null"> |
| | | and a.optime >= #{start} |
| | | </if> |
| | | <if test="end != null"> |
| | | and a.optime <= #{end} |
| | | </if> |
| | | </where> |
| | | order by id |
| | | order by a.id desc |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectOperateAll" resultType="com.lf.server.entity.sys.OperateEntity"> |
| | | select * from lf.sys_operate order by id; |
| | | select * from lf.sys_operate order by id desc |
| | | </select> |
| | | |
| | | <select id="selectOperate" resultType="com.lf.server.entity.sys.OperateEntity"> |
| | | select * from lf.sys_operate where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertOperate" parameterType="com.lf.server.entity.sys.OperateEntity"> |
| | | <insert id="insertOperate" parameterType="com.lf.server.entity.sys.OperateEntity"> |
| | | insert into lf.sys_operate |
| | | (modular,url,ip,exec,clazz,type,userid,optime,bak) |
| | | (modular1,modular2,url,ip,exec,clazz,type,userid,optime,bak) |
| | | values |
| | | (#{modular},#{url},#{ip},#{exec},#{clazz},#{type},#{userid},now(),#{bak}); |
| | | (#{modular1},#{modular2},#{url},#{ip},#{exec},#{clazz},#{type},#{userid},now(),#{bak}); |
| | | </insert> |
| | | |
| | | <insert id="insertOperates" > |
| | | insert into lf.sys_operate |
| | | (modular1,modular2,url,ip,exec,clazz,type,userid,optime,bak) |
| | | values |
| | | <insert id="insertOperates"> |
| | | insert into lf.sys_operate (modular1,modular2,url,ip,exec,clazz,type,userid,optime,bak) values |
| | | <foreach collection="list" item="item" index="index" separator="," > |
| | | (#{modular1},#{modular2},#{url},#{ip},#{exec},#{clazz},#{type},#{userid},now(),#{bak}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <delete id="deleteOperate" > |
| | | <delete id="deleteOperate"> |
| | | delete from lf.sys_operate where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteOperates" > |
| | | <delete id="deleteOperates"> |
| | | delete from lf.sys_operate where id in |
| | | <foreach item="ids" collection="list" index="index" open="(" separator="," close=")"> |
| | | #{ids} |
| | | <foreach item="id" collection="ids" index="index" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <update id="updateOperate"> |
| | | update lf.sys_operate set modular1=#{modular1},modular2=#{modular2},url=#{url},ip=#{ip},exec=#{exec},clazz=#{clazz},type=#{type},userid=#{userid},optime=now(),bak=#{bak} where id=#{id} |
| | | update lf.sys_operate set modular1=#{modular1},modular2=#{modular2},url=#{url},ip=#{ip},exec=#{exec},clazz=#{clazz},type=#{type},userid=#{userid},optime=now(),bak=#{bak} where id=#{id} |
| | | </update> |
| | | |
| | | <select id="operateCount" resultType="com.lf.server.entity.sys.OperateEntity"> |
| | | select modular2,count(*) from lf.sys_operate group by modular2 |
| | | </select> |
| | | </mapper> |