34 lines
1.4 KiB
XML
34 lines
1.4 KiB
XML
<?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="sgis.board.mapper.NoticeMapper">
|
|
|
|
<select id="getNotiLists" resultType="sgis.board.entity.Notice">
|
|
select idx, user_id, title, notice_content, writer, TO_CHAR(indate,'YYYY-MM-DD') AS indate, count from apptb_notice01 order by idx desc
|
|
</select>
|
|
|
|
<insert id="noticeInsert" parameterType="sgis.board.entity.Notice">
|
|
<selectKey keyProperty="idx" resultType="int" order="BEFORE">
|
|
SELECT COALESCE(MAX(IDX) + 1, 1) FROM APPTB_NOTICE01
|
|
</selectKey>
|
|
insert into apptb_notice01(idx, user_id, title, notice_content, writer, indate)
|
|
values(#{idx}, #{userId},#{title},#{noticeContent},#{writer}, NOW())
|
|
</insert>
|
|
|
|
<select id="noticeContent" resultType="sgis.board.entity.Notice">
|
|
select * from apptb_notice01 where idx=#{idx}
|
|
</select>
|
|
|
|
<delete id="noticeDelete" parameterType="int">
|
|
delete from apptb_notice01 where idx=#{idx}
|
|
</delete>
|
|
|
|
<update id="noticeUpdate" parameterType="sgis.board.entity.Notice">
|
|
update apptb_notice01 set title=#{title}, notice_content=#{noticeContent}
|
|
where idx=#{idx}
|
|
</update>
|
|
|
|
<select id="getMainNotiLists" resultType="sgis.board.entity.Notice">
|
|
select idx, title, writer, TO_CHAR(indate,'YYYY-MM-DD') AS indate from apptb_notice01 order by idx desc limit 3
|
|
</select>
|
|
|
|
</mapper> |