从"Blog"仓库中分离出来
This commit is contained in:
50
src/main/resources/mapper/WebUpdateInfoMapper.xml
Normal file
50
src/main/resources/mapper/WebUpdateInfoMapper.xml
Normal file
@@ -0,0 +1,50 @@
|
||||
<?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="cn.celess.blog.mapper.WebUpdateInfoMapper">
|
||||
<resultMap id="webUpdateResultMap" type="cn.celess.blog.entity.WebUpdate">
|
||||
<id column="update_id" property="id"/>
|
||||
<result column="update_info" property="updateInfo"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
<insert id="insert" parameterType="cn.celess.blog.entity.WebUpdate">
|
||||
insert into web_update(update_info, update_time)
|
||||
values (#{updateInfo}, #{updateTime})
|
||||
<selectKey resultType="java.lang.Long" keyProperty="id">
|
||||
SELECT LAST_INSERT_ID() AS id
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
update web_update
|
||||
set update_info=#{info}
|
||||
where update_id = #{id};
|
||||
|
||||
</update>
|
||||
|
||||
<delete id="delete">
|
||||
delete
|
||||
from web_update
|
||||
where update_id = #{id}
|
||||
</delete>
|
||||
<select id="existsById" resultType="java.lang.Boolean">
|
||||
select EXISTS(select * from web_update where update_id = #{id})
|
||||
</select>
|
||||
<select id="findById" resultMap="webUpdateResultMap">
|
||||
select *
|
||||
from web_update
|
||||
where update_id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="findAll" resultMap="webUpdateResultMap">
|
||||
select *
|
||||
from web_update
|
||||
</select>
|
||||
<select id="getLastestOne" resultType="date">
|
||||
select update_time
|
||||
from web_update
|
||||
order by update_id desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user