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