-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMngNotMapper.xml
More file actions
53 lines (49 loc) · 2.27 KB
/
MngNotMapper.xml
File metadata and controls
53 lines (49 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?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="kr.happyjob.study.mngNot.dao.MngNotDao">
<!-- 공지사항 목록 조회 -->
<select id="noticelist" resultType="kr.happyjob.study.mngNot.model.NoticeModel">
select nt.notice_del_yn ,nt.loginID ,nt.notice_no ,nt.notice_title ,nt.notice_date ,nt.notice_cont ,nt.file_no ,fi.file_name ,fi.logic_path ,fi.physic_path ,fi.file_size ,fi.exten ,ui.name from tb_notice nt inner join tb_userinfo ui on ui.loginID = nt.loginID left outer join tb_file fi on fi.file_no = nt.file_no
<where>
<if test="(delyn != null) and (!delyn.equals(''))">
and nt.notice_del_yn = #{delyn}
</if>
<if test="(sname != null) and (!sname.equals(''))">
<choose>
<when test="searchKey eq 'writer'.toString()">
and ui.name Like CONCAT('%', #{sname}, '%')
</when>
<when test="searchKey eq 'title'.toString()">
and nt.notice_title LIKE CONCAT('%', #{sname}, '%')
</when>
<otherwise>
and ( ui.name Like CONCAT('%', #{sname}, '%') or nt.notice_title LIKE CONCAT('%', #{sname}, '%') )
</otherwise>
</choose>
</if>
</where>
ORDER BY nt.notice_date DESC LIMIT #{pageindex}, #{pageSize}
</select>
<!-- 공지사항 목록 총 갯수 조회 -->
<select id="countnoticelist" resultType="int">
select count(*) from tb_notice nt inner join tb_userinfo ui on ui.loginID = nt.loginID left outer join tb_file fi on fi.file_no = nt.file_no
<where>
<if test="(delyn != null) and (!delyn.equals(''))">
and nt.notice_del_yn = #{delyn}
</if>
<if test="(sname != null) and (!sname.equals(''))">
<choose>
<when test="searchKey eq 'writer'.toString()">
and ui.name Like CONCAT('%', #{sname}, '%')
</when>
<when test="searchKey eq 'title'.toString()">
and nt.notice_title LIKE CONCAT('%', #{sname}, '%')
</when>
<otherwise>
and ( ui.name Like CONCAT('%', #{sname}, '%') or nt.notice_title LIKE CONCAT('%', #{sname}, '%') )
</otherwise>
</choose>
</if>
</where>
</select>
</mapper>