ky 5 years ago
parent a063e4ac01
commit ffcc8d9373

@ -1,5 +1,6 @@
package com.gszc.controller; package com.gszc.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page; import com.baomidou.mybatisplus.plugins.Page;
import com.gszc.build.Result; import com.gszc.build.Result;
@ -66,7 +67,7 @@ public class BannerController {
}) })
@ResponseBody @ResponseBody
public Result queryBanner(Integer pageNum,Integer pageSize) { public Result queryBanner(Integer pageNum,Integer pageSize) {
List<Banner> banners = bannerService.queryBanner(pageNum, pageSize); JSONObject result = bannerService.queryBanner(pageNum, pageSize);
return ResultBuilder.withPayload(banners).build(); return ResultBuilder.withPayload(result).build();
} }
} }

@ -1,5 +1,6 @@
package com.gszc.controller; package com.gszc.controller;
import com.alibaba.fastjson.JSONObject;
import com.gszc.build.Result; import com.gszc.build.Result;
import com.gszc.build.ResultBuilder; import com.gszc.build.ResultBuilder;
import com.gszc.entity.InvoiceCategory; import com.gszc.entity.InvoiceCategory;
@ -62,7 +63,7 @@ public class InvoiceCategoryController {
}) })
@ResponseBody @ResponseBody
public Result queryInvoiceCategory(Integer pageNum,Integer pageSize) { public Result queryInvoiceCategory(Integer pageNum,Integer pageSize) {
List<InvoiceCategory> invoiceCategorys = invoiceCategoryService.queryInvoiceCategory(pageNum, pageSize); JSONObject result = invoiceCategoryService.queryInvoiceCategory(pageNum, pageSize);
return ResultBuilder.withPayload(invoiceCategorys).build(); return ResultBuilder.withPayload(result).build();
} }
} }

@ -1,6 +1,7 @@
package com.gszc.controller; package com.gszc.controller;
import com.alibaba.fastjson.JSONObject;
import com.gszc.build.Result; import com.gszc.build.Result;
import com.gszc.build.ResultBuilder; import com.gszc.build.ResultBuilder;
import com.gszc.entity.InvoiceCategory; import com.gszc.entity.InvoiceCategory;
@ -67,8 +68,8 @@ public class PcIndustryController {
}) })
@ResponseBody @ResponseBody
public Result queryIndustry(Integer pageNum,Integer pageSize) { public Result queryIndustry(Integer pageNum,Integer pageSize) {
List<Industry> industrys = industryService.queryIndustry(pageNum, pageSize); JSONObject result = industryService.queryIndustry(pageNum, pageSize);
return ResultBuilder.withPayload(industrys).build(); return ResultBuilder.withPayload(result).build();
} }
} }

@ -1,5 +1,6 @@
package com.gszc.controller; package com.gszc.controller;
import com.alibaba.fastjson.JSONObject;
import com.gszc.build.Result; import com.gszc.build.Result;
import com.gszc.build.ResultBuilder; import com.gszc.build.ResultBuilder;
import com.gszc.entity.Banner; import com.gszc.entity.Banner;
@ -64,7 +65,7 @@ public class QuestionController {
}) })
@ResponseBody @ResponseBody
public Result queryQuestion(Integer pageNum,Integer pageSize) { public Result queryQuestion(Integer pageNum,Integer pageSize) {
List<Question> questions = questionService.queryQuestion(pageNum, pageSize); JSONObject result = questionService.queryQuestion(pageNum, pageSize);
return ResultBuilder.withPayload(questions).build(); return ResultBuilder.withPayload(result).build();
} }
} }

@ -1,8 +1,10 @@
package com.gszc.service.impl; package com.gszc.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page; import com.baomidou.mybatisplus.plugins.Page;
import com.gszc.entity.Banner; import com.gszc.entity.Banner;
import com.gszc.entity.Banner;
import com.gszc.mapper.BannerMapper; import com.gszc.mapper.BannerMapper;
import com.gszc.service.IBannerService; import com.gszc.service.IBannerService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.baomidou.mybatisplus.service.impl.ServiceImpl;
@ -46,10 +48,14 @@ public class BannerServiceImpl extends ServiceImpl<BannerMapper, Banner> impleme
bannerMapper.updateById(banner); bannerMapper.updateById(banner);
} }
public List<Banner> queryBanner(Integer pageNum,Integer pageSize){ public JSONObject queryBanner(Integer pageNum, Integer pageSize){
Integer count = bannerMapper.selectCount(new EntityWrapper<Banner>());
List<Banner> result = bannerMapper.selectPage(new Page<>((pageNum - 1) * pageSize, pageSize), new EntityWrapper<Banner>().eq("1", "1").orderBy("ix", true)); List<Banner> result = bannerMapper.selectPage(new Page<>((pageNum - 1) * pageSize, pageSize), new EntityWrapper<Banner>().eq("1", "1").orderBy("ix", true));
return result; JSONObject jsonObject = new JSONObject();
jsonObject.put("count",count);
jsonObject.put("data",result);
return jsonObject;
} }
} }

@ -1,9 +1,11 @@
package com.gszc.service.impl; package com.gszc.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page; import com.baomidou.mybatisplus.plugins.Page;
import com.gszc.entity.Industry; import com.gszc.entity.Industry;
import com.gszc.entity.Industry; import com.gszc.entity.Industry;
import com.gszc.entity.Industry;
import com.gszc.mapper.IndustryMapper; import com.gszc.mapper.IndustryMapper;
import com.gszc.mapper.IndustryMapper; import com.gszc.mapper.IndustryMapper;
import com.gszc.service.IIndustryService; import com.gszc.service.IIndustryService;
@ -44,9 +46,13 @@ public class IndustryServiceImpl extends ServiceImpl<IndustryMapper, Industry> i
industryMapper.updateById(industry); industryMapper.updateById(industry);
} }
public List<Industry> queryIndustry(Integer pageNum, Integer pageSize){ public JSONObject queryIndustry(Integer pageNum, Integer pageSize){
Integer count = industryMapper.selectCount(new EntityWrapper<Industry>());
List<Industry> result = industryMapper.selectPage(new Page<>((pageNum - 1) * pageSize, pageSize), new EntityWrapper<Industry>().eq("1", "1").orderBy("create_date", false)); List<Industry> result = industryMapper.selectPage(new Page<>((pageNum - 1) * pageSize, pageSize), new EntityWrapper<Industry>().eq("1", "1").orderBy("create_date", false));
return result; JSONObject jsonObject = new JSONObject();
jsonObject.put("count",count);
jsonObject.put("data",result);
return jsonObject;
} }
} }

@ -1,13 +1,16 @@
package com.gszc.service.impl; package com.gszc.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page; import com.baomidou.mybatisplus.plugins.Page;
import com.gszc.entity.Invoice;
import com.gszc.entity.InvoiceCategory; import com.gszc.entity.InvoiceCategory;
import com.gszc.entity.InvoiceCategory; import com.gszc.entity.InvoiceCategory;
import com.gszc.mapper.InvoiceCategoryMapper; import com.gszc.mapper.InvoiceCategoryMapper;
import com.gszc.mapper.InvoiceCategoryMapper; import com.gszc.mapper.InvoiceCategoryMapper;
import com.gszc.service.IInvoiceCategoryService; import com.gszc.service.IInvoiceCategoryService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -43,9 +46,13 @@ public class InvoiceCategoryServiceImpl extends ServiceImpl<InvoiceCategoryMappe
invoiceCategoryMapper.updateById(invoiceCategory); invoiceCategoryMapper.updateById(invoiceCategory);
} }
public List<InvoiceCategory> queryInvoiceCategory(Integer pageNum, Integer pageSize){ public JSONObject queryInvoiceCategory(Integer pageNum, Integer pageSize){
Integer count = invoiceCategoryMapper.selectCount(new EntityWrapper<InvoiceCategory>());
List<InvoiceCategory> result = invoiceCategoryMapper.selectPage(new Page<>((pageNum - 1) * pageSize, pageSize), new EntityWrapper<InvoiceCategory>().eq("1", "1").orderBy("id", true)); List<InvoiceCategory> result = invoiceCategoryMapper.selectPage(new Page<>((pageNum - 1) * pageSize, pageSize), new EntityWrapper<InvoiceCategory>().eq("1", "1").orderBy("id", true));
return result; JSONObject jsonObject = new JSONObject();
jsonObject.put("count",count);
jsonObject.put("data",result);
return jsonObject;
} }
} }

@ -1,9 +1,11 @@
package com.gszc.service.impl; package com.gszc.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page; import com.baomidou.mybatisplus.plugins.Page;
import com.gszc.entity.Question; import com.gszc.entity.Question;
import com.gszc.entity.Question; import com.gszc.entity.Question;
import com.gszc.entity.Question;
import com.gszc.mapper.QuestionMapper; import com.gszc.mapper.QuestionMapper;
import com.gszc.service.IQuestionService; import com.gszc.service.IQuestionService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.baomidou.mybatisplus.service.impl.ServiceImpl;
@ -46,9 +48,13 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
questionMapper.updateById(question); questionMapper.updateById(question);
} }
public List<Question> queryQuestion(Integer pageNum, Integer pageSize){ public JSONObject queryQuestion(Integer pageNum, Integer pageSize){
Integer count = questionMapper.selectCount(new EntityWrapper<Question>());
List<Question> result = questionMapper.selectPage(new Page<>((pageNum - 1) * pageSize, pageSize), new EntityWrapper<Question>().eq("1", "1").orderBy("ix", true)); List<Question> result = questionMapper.selectPage(new Page<>((pageNum - 1) * pageSize, pageSize), new EntityWrapper<Question>().eq("1", "1").orderBy("ix", true));
return result; JSONObject jsonObject = new JSONObject();
jsonObject.put("count",count);
jsonObject.put("data",result);
return jsonObject;
} }
} }

Loading…
Cancel
Save