<?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.moon.server.mapper.sys.OperateMapper">
|
<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>
|
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.moon.server.entity.sys.OperateEntity">
|
select a.*,b.uname from lf.sys_operate a inner join lf.sys_user b on a.userid = b.id
|
<where>
|
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 a.id desc
|
limit #{limit} offset #{offset}
|
</select>
|
|
<select id="selectOperateAll" resultType="com.moon.server.entity.sys.OperateEntity">
|
select * from lf.sys_operate order by id desc
|
</select>
|
|
<select id="selectOperate" resultType="com.moon.server.entity.sys.OperateEntity">
|
select * from lf.sys_operate where id = #{id}
|
</select>
|
|
<insert id="insertOperate" parameterType="com.moon.server.entity.sys.OperateEntity">
|
insert into lf.sys_operate
|
(modular1,modular2,url,ip,exec,clazz,type,userid,optime,bak)
|
values
|
(#{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
|
<foreach collection="list" item="item" index="index" separator="," >
|
(#{modular1},#{modular2},#{url},#{ip},#{exec},#{clazz},#{type},#{userid},now(),#{bak})
|
</foreach>
|
</insert>
|
|
<delete id="deleteOperate">
|
delete from lf.sys_operate where id = #{id}
|
</delete>
|
|
<delete id="deleteOperates">
|
delete from lf.sys_operate where id in
|
<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>
|
|
<select id="operateCount" resultType="com.moon.server.entity.sys.OperateEntity">
|
select modular2,count(*) from lf.sys_operate group by modular2
|
</select>
|
</mapper>
|