페이징 없앰
This commit is contained in:
parent
36f2559232
commit
d5f9e7242f
@ -14,7 +14,9 @@
|
|||||||
*************************************************************/
|
*************************************************************/
|
||||||
package io.company.localhost.controller.api;
|
package io.company.localhost.controller.api;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@ -54,10 +56,17 @@ public class worddictController {
|
|||||||
@Member
|
@Member
|
||||||
@ParameterCheck
|
@ParameterCheck
|
||||||
@GetMapping("getWordList")
|
@GetMapping("getWordList")
|
||||||
public ApiResponse<PageInfo<MapDto>> getWordList(@ReqMap MapDto map) {
|
public ApiResponse<MapDto> getWordList(@ReqMap MapDto map) {
|
||||||
PageInfo<MapDto> WordList = worddictyservice.getWordList(map);
|
int total = worddictyservice.getTotal(map);
|
||||||
return ApiResponse.ok(WordList);
|
List<MapDto> wordList = worddictyservice.getWordList(map);
|
||||||
}
|
|
||||||
|
MapDto OutData = new MapDto();
|
||||||
|
OutData.put("total", total);
|
||||||
|
OutData.put("data", wordList);
|
||||||
|
|
||||||
|
return ApiResponse.ok(OutData);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 용어집 카테고리 목록
|
* 용어집 카테고리 목록
|
||||||
* @param
|
* @param
|
||||||
@ -105,6 +114,7 @@ public class worddictController {
|
|||||||
|
|
||||||
//userId
|
//userId
|
||||||
Long userId = AuthUtil.getUser().getId();
|
Long userId = AuthUtil.getUser().getId();
|
||||||
|
String content = map.getString("content"); // content 추출
|
||||||
//map.put("userId", userId);
|
//map.put("userId", userId);
|
||||||
/////////로그인 미개발 ->임시
|
/////////로그인 미개발 ->임시
|
||||||
map.put("userId", 1);
|
map.put("userId", 1);
|
||||||
@ -131,6 +141,4 @@ public class worddictController {
|
|||||||
|
|
||||||
return ApiResponse.ok(result);
|
return ApiResponse.ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,6 +31,8 @@ public interface worddictyMapper {
|
|||||||
|
|
||||||
MapDto getWordDetail(MapDto map);
|
MapDto getWordDetail(MapDto map);
|
||||||
|
|
||||||
|
int getTotal(MapDto map);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,8 @@
|
|||||||
package io.company.localhost.service;
|
package io.company.localhost.service;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
@ -31,10 +33,9 @@ public class worddictyService {
|
|||||||
|
|
||||||
private final worddictyMapper worddictymapper;
|
private final worddictyMapper worddictymapper;
|
||||||
|
|
||||||
public PageInfo<MapDto> getWordList(MapDto map) {
|
public List<MapDto> getWordList(MapDto map) {
|
||||||
int page = map.getString("page") != null ? Integer.parseInt(map.getString("page")) : 1;
|
|
||||||
PageHelper.startPage(page, 10);
|
return (worddictymapper.getWordList(map));
|
||||||
return PageUtil.redefineNavigation(new PageInfo<>(worddictymapper.getWordList(map),10));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long insertWord(MapDto map) {
|
public Long insertWord(MapDto map) {
|
||||||
@ -49,6 +50,10 @@ public class worddictyService {
|
|||||||
return worddictymapper.getWordDetail(map);
|
return worddictymapper.getWordDetail(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getTotal(MapDto map) {
|
||||||
|
return worddictymapper.getTotal(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,22 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="io.company.localhost.mapper.worddictyMapper">
|
<mapper namespace="io.company.localhost.mapper.worddictyMapper">
|
||||||
<select id="getWordList" parameterType="map" resultType="Map">
|
<sql id="searchConditions">
|
||||||
select
|
<!-- 검색어 조건 -->
|
||||||
w.*
|
|
||||||
,c.CMNCODNAM category
|
|
||||||
from
|
|
||||||
worddicty w
|
|
||||||
left join
|
|
||||||
commoncod c
|
|
||||||
on
|
|
||||||
w.WRDDICCAT = c.CMNCODVAL
|
|
||||||
where
|
|
||||||
1=1
|
|
||||||
<!-- 검색어 조건 -->
|
|
||||||
<if test="searchKeyword != null and searchKeyword != ''">
|
<if test="searchKeyword != null and searchKeyword != ''">
|
||||||
and (w.WRDDICTTL like CONCAT('%', #{searchKeyword}, '%')
|
and (w.WRDDICTTL like CONCAT('%', #{searchKeyword}, '%')
|
||||||
or w.WRDDICCON like CONCAT('%', #{searchKeyword}, '%'))
|
or w.WRDDICCON like CONCAT('%', #{searchKeyword}, '%'))
|
||||||
</if>
|
</if>
|
||||||
<!-- 색인표 조건 -->
|
<!-- 색인표 조건 -->
|
||||||
<if test="indexKeyword != null and indexKeyword != ''">
|
<if test="indexKeyword != null and indexKeyword != ''">
|
||||||
@ -149,8 +138,27 @@
|
|||||||
<if test="category != null and category != ''">
|
<if test="category != null and category != ''">
|
||||||
and w.WRDDICCAT = #{category}
|
and w.WRDDICCAT = #{category}
|
||||||
</if>
|
</if>
|
||||||
|
</sql>
|
||||||
|
<select id="getWordList" parameterType="map" resultType="Map">
|
||||||
|
select
|
||||||
|
w.*
|
||||||
|
,c.CMNCODNAM category
|
||||||
|
from
|
||||||
|
worddicty w
|
||||||
|
left join
|
||||||
|
commoncod c
|
||||||
|
on
|
||||||
|
w.WRDDICCAT = c.CMNCODVAL
|
||||||
|
where
|
||||||
|
1=1
|
||||||
|
<include refid="searchConditions"/>
|
||||||
order by w.WRDDICRDT desc
|
order by w.WRDDICRDT desc
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getTotal" parameterType="map" >
|
||||||
|
select count(*) from worddicty w
|
||||||
|
where 1=1
|
||||||
|
<include refid="searchConditions"/>
|
||||||
|
</select>
|
||||||
<insert id="insertWord" parameterType="map">
|
<insert id="insertWord" parameterType="map">
|
||||||
insert into worddicty
|
insert into worddicty
|
||||||
(
|
(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user