mirror of
https://github.com/Hello-hao/Tbed.git
synced 2024-04-21 12:32:10 +00:00
6-23更新 多条件删选
This commit is contained in:
@@ -111,20 +111,35 @@ public class AdminController {
|
||||
|
||||
@RequestMapping(value = "/selecttable")
|
||||
@ResponseBody
|
||||
public PageResultBean<Images> selectByFy(HttpSession session, Integer pageNum, Integer pageSize, Integer selecttype) {
|
||||
public PageResultBean<Images> selectByFy(HttpSession session, Integer pageNum, Integer pageSize, Integer selecttype,
|
||||
Integer storageType,String starttime,String stoptime) {
|
||||
User u = (User) session.getAttribute("user");
|
||||
Images img = new Images();
|
||||
if(storageType!=null){
|
||||
if(storageType!=0){
|
||||
img.setSource(storageType);
|
||||
}
|
||||
}
|
||||
if(starttime!=null && stoptime!=null){
|
||||
if(!starttime.equals("") && !stoptime.equals("")){
|
||||
img.setStarttime(starttime);
|
||||
img.setStoptime(stoptime);
|
||||
}
|
||||
}
|
||||
// 使用Pagehelper传入当前页数和页面显示条数会自动为我们的select语句加上limit查询
|
||||
// 从他的下一条sql开始分页
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<Images> images = null;
|
||||
if (u.getLevel() > 1) { //根据用户等级查询管理员查询所有的信息
|
||||
if (selecttype == 1) {
|
||||
images = imgService.selectimg(null);// 这是我们的sql
|
||||
images = imgService.selectimg(img);// 这是我们的sql
|
||||
} else {
|
||||
images = imgService.selectimg(u.getId());// 这是我们的sql
|
||||
img.setUserid(u.getId());
|
||||
images = imgService.selectimg(img);// 这是我们的sql
|
||||
}
|
||||
} else {
|
||||
images = imgService.selectimg(u.getId());// 这是我们的sql
|
||||
img.setUserid(u.getId());
|
||||
images = imgService.selectimg(img);// 这是我们的sql
|
||||
}
|
||||
// 使用pageInfo包装查询
|
||||
PageInfo<Images> rolePageInfo = new PageInfo<>(images);//
|
||||
|
||||
@@ -10,7 +10,7 @@ import cn.hellohao.pojo.Images;
|
||||
@Mapper
|
||||
public interface ImgMapper {
|
||||
|
||||
List<Images> selectimg(@Param("userid") Integer userid);
|
||||
List<Images> selectimg(Images images);
|
||||
|
||||
Integer countimg(@Param("userid") Integer userid);
|
||||
|
||||
|
||||
@@ -17,13 +17,15 @@ public class Images {
|
||||
private String updatetime;
|
||||
private String username;
|
||||
private Integer storageType;
|
||||
private String starttime;
|
||||
private String stoptime;
|
||||
|
||||
|
||||
public Images() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Images(Integer id, String imgname, String imgurl, Integer userid, Integer sizes, Integer abnormal, Integer source, String updatetime, String username, Integer storageType) {
|
||||
public Images(Integer id, String imgname, String imgurl, Integer userid, Integer sizes, Integer abnormal, Integer source, String updatetime, String username, Integer storageType, String starttime, String stoptime) {
|
||||
this.id = id;
|
||||
this.imgname = imgname;
|
||||
this.imgurl = imgurl;
|
||||
@@ -34,6 +36,8 @@ public class Images {
|
||||
this.updatetime = updatetime;
|
||||
this.username = username;
|
||||
this.storageType = storageType;
|
||||
this.starttime = starttime;
|
||||
this.stoptime = stoptime;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
@@ -116,11 +120,26 @@ public class Images {
|
||||
this.storageType = storageType;
|
||||
}
|
||||
|
||||
@Mapper
|
||||
public static interface ConfigMapper {
|
||||
Config getSourceype();
|
||||
Integer setSourceype(@Param("sourcekey") Integer sourcekey);
|
||||
public String getStarttime() {
|
||||
return starttime;
|
||||
}
|
||||
|
||||
public void setStarttime(String starttime) {
|
||||
this.starttime = starttime;
|
||||
}
|
||||
|
||||
public String getStoptime() {
|
||||
return stoptime;
|
||||
}
|
||||
|
||||
public void setStoptime(String stoptime) {
|
||||
this.stoptime = stoptime;
|
||||
}
|
||||
// @Mapper
|
||||
// public static interface ConfigMapper {
|
||||
// Config getSourceype();
|
||||
// Integer setSourceype(@Param("sourcekey") Integer sourcekey);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
import cn.hellohao.pojo.Images;
|
||||
|
||||
public interface ImgService {
|
||||
List<Images> selectimg(Integer id);
|
||||
List<Images> selectimg(Images images);
|
||||
|
||||
Integer deleimg(Integer id);
|
||||
|
||||
|
||||
@@ -31,9 +31,9 @@ public class ImgServiceImpl implements ImgService {
|
||||
private ImgMapper imgMapper;
|
||||
|
||||
@Override
|
||||
public List<Images> selectimg(Integer userid) {
|
||||
public List<Images> selectimg(Images images) {
|
||||
// TODO Auto-generated method stub
|
||||
return imgMapper.selectimg(userid);
|
||||
return imgMapper.selectimg(images);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user