更新notice
This commit is contained in:
parent
4ee3765cf4
commit
0804aa5e0f
@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class NoticeController {
|
||||
@ -29,8 +30,8 @@ public class NoticeController {
|
||||
}
|
||||
// 查
|
||||
@RequestMapping(method = RequestMethod.GET,value = "/notice/select")
|
||||
public String select(int id){
|
||||
return noticeService.select(id);
|
||||
public String select(){
|
||||
return noticeService.select();
|
||||
}
|
||||
// 改
|
||||
@RequestMapping(method = RequestMethod.GET,value = "/notice/update")
|
||||
|
@ -4,6 +4,8 @@ import com.lovenav.entity.Notice;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface NoticeDao {
|
||||
@ -18,4 +20,6 @@ public interface NoticeDao {
|
||||
int updateByPrimaryKeySelective(Notice record);
|
||||
|
||||
int updateByPrimaryKey(Notice record);
|
||||
|
||||
List<Notice> selectAll();
|
||||
}
|
@ -2,10 +2,13 @@ package com.lovenav.service;
|
||||
|
||||
import com.lovenav.entity.Notice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface NoticeService {
|
||||
String add(Notice notice);
|
||||
String delete(int id);
|
||||
String update(Notice notice);
|
||||
String select(int id);
|
||||
String select();
|
||||
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class NoticeServiceImpl implements NoticeService {
|
||||
@ -42,9 +43,9 @@ public class NoticeServiceImpl implements NoticeService {
|
||||
return JSON.toJSONString(hashMap);
|
||||
}
|
||||
}
|
||||
public String select(int id){
|
||||
public String select(){
|
||||
HashMap<String,Object> hashMap = new HashMap<>();
|
||||
Notice result = noticeDao.selectByPrimaryKey(id);
|
||||
List<Notice> result = noticeDao.selectAll();
|
||||
if(result != null){
|
||||
return JSON.toJSONString(result);
|
||||
}else{
|
||||
|
@ -95,4 +95,10 @@
|
||||
createtime = #{createtime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<select id="selectAll">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from ln_notice
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user