17 Star 127 Fork 65

xiangzepro/demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
AreaDao.xml 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
<?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.imooc.demo.dao.AreaDao">
<select id="queryArea" resultType="com.imooc.demo.entity.Area">
SELECT area_id, area_name,
priority, create_time, last_edit_time
FROM tb_area
ORDER BY priority
DESC
</select>
<select id="queryAreaById" resultType="com.imooc.demo.entity.Area">
SELECT area_id, area_name,
priority, create_time, last_edit_time
FROM tb_area
WHERE
area_id=#{areaId}
</select>
<insert id="insertArea" useGeneratedKeys="true" keyProperty="areaId"
keyColumn="area_id" parameterType="com.imooc.demo.entity.Area">
INSERT INTO
tb_area(area_name,priority,
create_time,last_edit_time)
VALUES
(#{areaName},#{priority},
#{createTime},#{lastEditTime})
</insert>
<update id="updateArea" parameterType="com.imooc.demo.entity.Area">
update tb_area
<set>
<if test="areaName != null">area_name=#{areaName},</if>
<if test="priority != null">priority=#{priority},</if>
<if test="lastEditTime != null">last_edit_time=#{lastEditTime}</if>
</set>
where area_id=#{areaId}
</update>
<delete id="deleteArea">
DELETE FROM
tb_area
WHERE
area_id =
#{areaId}
</delete>
</mapper>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/xiangze/demo.git
git@gitee.com:xiangze/demo.git
xiangze
demo
demo
master

搜索帮助