페이징 없앰

This commit is contained in:
khj0414 2025-01-13 13:14:47 +09:00
parent 36f2559232
commit d5f9e7242f
4 changed files with 47 additions and 24 deletions

View File

@ -14,7 +14,9 @@
*************************************************************/
package io.company.localhost.controller.api;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.GetMapping;
@ -54,10 +56,17 @@ public class worddictController {
@Member
@ParameterCheck
@GetMapping("getWordList")
public ApiResponse<PageInfo<MapDto>> getWordList(@ReqMap MapDto map) {
PageInfo<MapDto> WordList = worddictyservice.getWordList(map);
return ApiResponse.ok(WordList);
}
public ApiResponse<MapDto> getWordList(@ReqMap MapDto map) {
int total = worddictyservice.getTotal(map);
List<MapDto> wordList = worddictyservice.getWordList(map);
MapDto OutData = new MapDto();
OutData.put("total", total);
OutData.put("data", wordList);
return ApiResponse.ok(OutData);
}
/**
* 용어집 카테고리 목록
* @param
@ -105,6 +114,7 @@ public class worddictController {
//userId
Long userId = AuthUtil.getUser().getId();
String content = map.getString("content"); // content 추출
//map.put("userId", userId);
/////////로그인 미개발 ->임시
map.put("userId", 1);
@ -131,6 +141,4 @@ public class worddictController {
return ApiResponse.ok(result);
}
}

View File

@ -31,6 +31,8 @@ public interface worddictyMapper {
MapDto getWordDetail(MapDto map);
int getTotal(MapDto map);

View File

@ -15,6 +15,8 @@
package io.company.localhost.service;
import java.util.List;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
@ -31,10 +33,9 @@ public class worddictyService {
private final worddictyMapper worddictymapper;
public PageInfo<MapDto> getWordList(MapDto map) {
int page = map.getString("page") != null ? Integer.parseInt(map.getString("page")) : 1;
PageHelper.startPage(page, 10);
return PageUtil.redefineNavigation(new PageInfo<>(worddictymapper.getWordList(map),10));
public List<MapDto> getWordList(MapDto map) {
return (worddictymapper.getWordList(map));
}
public Long insertWord(MapDto map) {
@ -49,6 +50,10 @@ public class worddictyService {
return worddictymapper.getWordDetail(map);
}
public int getTotal(MapDto map) {
return worddictymapper.getTotal(map);
}

View File

@ -1,22 +1,11 @@
<?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="io.company.localhost.mapper.worddictyMapper">
<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
<!-- 검색어 조건 -->
<sql id="searchConditions">
<!-- 검색어 조건 -->
<if test="searchKeyword != null and searchKeyword != ''">
and (w.WRDDICTTL like CONCAT('%', #{searchKeyword}, '%')
or w.WRDDICCON like CONCAT('%', #{searchKeyword}, '%'))
or w.WRDDICCON like CONCAT('%', #{searchKeyword}, '%'))
</if>
<!-- 색인표 조건 -->
<if test="indexKeyword != null and indexKeyword != ''">
@ -149,8 +138,27 @@
<if test="category != null and category != ''">
and w.WRDDICCAT = #{category}
</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
</select>
<select id="getTotal" parameterType="map" >
select count(*) from worddicty w
where 1=1
<include refid="searchConditions"/>
</select>
<insert id="insertWord" parameterType="map">
insert into worddicty
(