| | |
| | | <!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.DownlogMapper"> |
| | | <select id="selectCount" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_downlog |
| | | select count(*) from lf.sys_downlog a inner join lf.sys_user b on a.create_user = b.id |
| | | inner join lf.sys_download c on a.downid = c.id |
| | | <where> |
| | | <if test="name != null"> |
| | | name like #{name} |
| | | 1 = 1 |
| | | <if test="uname != null"> |
| | | and upper(b.uname) like #{uname} |
| | | </if> |
| | | <if test="type != null"> |
| | | and c.type = #{type} |
| | | </if> |
| | | <if test="start != null"> |
| | | and a.create_time >= #{start} |
| | | </if> |
| | | <if test="end != null"> |
| | | and a.create_time <= #{end} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectByPage" resultType="com.lf.server.entity.sys.DownlogEntity"> |
| | | select * from lf.sys_downlog |
| | | select a.*,b.uname,c.name,c.type,c.sizes from lf.sys_downlog a inner join lf.sys_user b on a.create_user = b.id |
| | | inner join lf.sys_download c on a.downid = c.id |
| | | <where> |
| | | <if test="name != null"> |
| | | name like #{name} |
| | | 1 = 1 |
| | | <if test="uname != null"> |
| | | and upper(b.uname) like #{uname} |
| | | </if> |
| | | <if test="type != null"> |
| | | and c.type = #{type} |
| | | </if> |
| | | <if test="start != null"> |
| | | and a.create_time >= #{start} |
| | | </if> |
| | | <if test="end != null"> |
| | | and a.create_time <= #{end} |
| | | </if> |
| | | </where> |
| | | order by id |
| | | order by id desc |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectAll" resultType="com.lf.server.entity.sys.DownlogEntity"> |
| | | select * from lf.sys_downlog order by id; |
| | | select * from lf.sys_downlog order by id desc |
| | | </select> |
| | | |
| | | <select id="selectById" resultType="com.lf.server.entity.sys.DownlogEntity"> |
| | |
| | | |
| | | <insert id="insert" parameterType="com.lf.server.entity.sys.DownlogEntity"> |
| | | insert into lf.sys_downlog |
| | | (downid,name,type,sizes,ip,create_user,create_time) |
| | | (downid,ip,create_user,create_time) |
| | | values |
| | | (#{downid},#{name},#{type},#{sizes},#{ip},#{createUser},now()) |
| | | (#{downid},#{ip},#{createUser},now()) |
| | | </insert> |
| | | |
| | | <insert id="inserts"> |
| | | insert into lf.sys_downlog |
| | | (downid,name,type,sizes,ip,create_user,create_time) |
| | | (downid,ip,create_user,create_time) |
| | | values |
| | | <foreach collection="list" item="item" index="index" separator=","> |
| | | (#{item.downid},#{item.name},#{item.type},#{item.sizes},#{item.ip},#{item.createUser},now()) |
| | | (#{item.downid},#{item.ip},#{item.createUser},now()) |
| | | </foreach> |
| | | </insert> |
| | | |
| | |
| | | |
| | | <update id="update"> |
| | | update lf.sys_downlog |
| | | set downid=#{downid},name=#{name},type=#{type},sizes=#{sizes},ip=#{ip},update_user=#{updateUser},update_time=now() |
| | | set downid=#{downid},ip=#{ip},update_user=#{updateUser},update_time=now() |
| | | where id=#{id} |
| | | </update> |
| | | |
| | |
| | | <foreach collection="list" item="item" index="index" separator=";"> |
| | | update lf.sys_downlog |
| | | <set> |
| | | downid=#{item.downid},name=#{item.name},type=#{item.type},sizes=#{item.sizes},ip=#{item.ip},update_user=#{item.updateUser},update_time=now() |
| | | downid=#{item.downid},ip=#{item.ip},update_user=#{item.updateUser},update_time=now() |
| | | </set> |
| | | where id = #{item.id} |
| | | </foreach> |