plainin list와 read기본

This commit is contained in:
Suh
2024-01-17 17:42:17 +09:00
parent feab8f173c
commit 2a63f0dfc8
6 changed files with 51 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
@@ -49,5 +50,18 @@ public class PlanInController {
mav.setViewName("planin/list");
return mav;
}
@PostMapping("/read")
public ModelAndView read(ModelAndView mav, PlanInDto dto){
System.out.println(dto);
List<PlanInDto> list = planinservice.selectById(dto);
System.out.println(list.get(0).toString());
mav.addObject("list", list);
mav.setViewName("planin/read");
return mav;
}
}

View File

@@ -13,4 +13,6 @@ public interface PlanInMapper {
List<PlanInDto> selectAll(Map<String, Object> m);
int count(Map<String, Object> m);
List<PlanInDto> selectById(PlanInDto dto);
}

View File

@@ -32,4 +32,8 @@ public class PlanInService {
m.put("perPage", perPage);
return mapper.count(m);
}
List<PlanInDto> selectById(PlanInDto dto){
return mapper.selectById(dto);
}
}