<?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.AttachMapper">
|
<select id="selectCount" resultType="java.lang.Integer" parameterType="java.lang.String">
|
select count(*) from lf.sys_attach
|
<where>
|
<if test="name != null">
|
name like #{name}
|
</if>
|
</where>
|
</select>
|
|
<select id="selectByPage" resultType="com.lf.server.entity.sys.AttachEntity">
|
select * from lf.sys_attach
|
<where>
|
<if test="name != null">
|
name like #{name}
|
</if>
|
</where>
|
order by id
|
limit #{limit} offset #{offset}
|
</select>
|
|
<select id="selectAll" resultType="com.lf.server.entity.sys.AttachEntity">
|
select * from lf.sys_attach order by id;
|
</select>
|
|
<select id="selectById" resultType="com.lf.server.entity.sys.AttachEntity">
|
select * from lf.sys_attach where id = #{id}
|
</select>
|
|
<select id="selectByGuid" resultType="com.lf.server.entity.sys.AttachEntity">
|
select * from lf.sys_attach where guid = #{guid}
|
</select>
|
|
<insert id="insert" parameterType="com.lf.server.entity.sys.AttachEntity">
|
insert into lf.sys_attach
|
(name,tab,tab_guid,guid,path,create_user,create_time)
|
values
|
(#{name},#{tab},#{tabGuid},#{guid},#{path},#{createUser},now())
|
</insert>
|
|
<insert id="inserts">
|
insert into lf.sys_attach
|
(name,tab,tab_guid,guid,path,create_user,create_time)
|
values
|
<foreach collection="list" item="item" index="index" separator=",">
|
(#{item.name},#{item.tab},#{item.tabGuid},#{item.guid},#{item.path},#{item.createUser},now())
|
</foreach>
|
</insert>
|
|
<delete id="delete">
|
delete from lf.sys_attach where id = #{id}
|
</delete>
|
|
<delete id="deletes">
|
delete from lf.sys_attach where id in
|
<foreach item="id" collection="ids" index="index" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
<update id="update">
|
update lf.sys_attach
|
set name=#{name},tab=#{tab},tab_guid=#{tabGuid},guid=#{guid},path=#{path},update_user=#{updateUser},update_time=now()
|
where id=#{id}
|
</update>
|
|
<update id="updates">
|
<foreach collection="list" item="item" index="index" separator=";">
|
update lf.sys_attach
|
<set>
|
name=#{item.name},tab=#{item.tab},tab_guid=#{item.tabGuid},guid=#{item.guid},path=#{item.path},update_user=#{item.updateUser},update_time=now()
|
</set>
|
where id = #{item.id}
|
</foreach>
|
</update>
|
</mapper>
|