@@ -48,8 +48,9 @@ public class AircraftTypeController {
@ApiOperation("按名称查询")
@GetMapping("getByName")
- public Result<List<AircraftTypeEntity>> findByName(@RequestParam("name") String name){
- return AircraftTypeService.findByName(name);
+ public Result<PageInfo<AircraftTypeEntity>> findByName(@RequestParam("name") String name,Integer page, Integer size){
+ PageHelper.startPage(page, size, "id desc");
+ return Result.success(new PageInfo<>(AircraftTypeService.findByName(name)));
}
@ApiOperation("ID查找")
@@ -109,8 +109,9 @@ public class CardController {
- public Result<List<CardEntity>> findByName(@RequestParam("name") String name){
- return cardService.findByName(name);
+ public Result<PageInfo<CardEntity>> findByName(@RequestParam("name") String name,Integer page, Integer size){
+ return Result.success(new PageInfo<>(cardService.findByName(name)));
@ApiOperation("增添")
@@ -109,10 +109,12 @@ public class FaultController {
- public Result<List<FaultEntity>> findByName(@RequestParam("name") String name){
- return faultService.findByName(name);
+ public Result<PageInfo<FaultEntity>> findByName(@RequestParam("name") String name,Integer page, Integer size){
+ return Result.success(new PageInfo<>(faultService.findByName(name)));
+
@ApiResponses({
@ApiResponse(code = 0, message = "成功")
@@ -12,6 +12,7 @@ import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import com.zglc.fm.base.Result;
import com.zglc.fm.entity.LogEntity;
+import com.zglc.fm.entity.LogFind;
import com.zglc.fm.service.LogService;
@@ -80,8 +81,9 @@ public class LogController {
})
@PostMapping("findByLog")
- public Result<List<LogEntity>> findByLog(@RequestBody LogEntity log){
- return logService.findByLog(log);
+ public Result<PageInfo<LogEntity>> findByLog(@RequestBody LogFind log,Integer page, Integer size){
+ return Result.success(new PageInfo<>(logService.findByLog(log)));
@@ -49,8 +49,9 @@ public class MajorController {
- public Result<List<MajorEntity>> findByName(@RequestParam("name") String name){
- return majorService.findByName(name);
+ public Result<PageInfo<MajorEntity>> findByName(@RequestParam("name") String name,Integer page, Integer size){
+ return Result.success(new PageInfo<>(majorService.findByName(name)));
@@ -110,10 +110,12 @@ public class ManuelController {
- public Result<List<ManuelEntity>> findByName(@RequestParam("name") String name){
- return manuelService.findByName(name);
+ public Result<PageInfo<ManuelEntity>> findByName(@RequestParam("name") String name,Integer page, Integer size){
+ return Result.success(new PageInfo<>(manuelService.findByName(name)));
@@ -110,8 +110,9 @@ public class OutlineController {
- public Result<List<OutlineEntity>> findByName(@RequestParam("name") String name){
- return outlineService.findByName(name);
+ public Result<PageInfo<OutlineEntity>> findByName(@RequestParam("name") String name,Integer page, Integer size){
+ return Result.success(new PageInfo<>(outlineService.findByName(name)));
@@ -1,6 +1,7 @@
package com.zglc.fm.dao.master;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;
@@ -18,6 +19,6 @@ import java.util.List;
@Repository
public interface LogDao extends Mapper<LogEntity> {
- List<LogEntity> findByLog(LogEntity log);
+ List<LogEntity> findByLog(LogFind log);
@@ -0,0 +1,17 @@
+package com.zglc.fm.entity;
+import lombok.Getter;
+import lombok.Setter;
+import java.util.Date;
+@Getter
+@Setter
+public class LogFind {
+ private String realName;
+ private String beginTime;
+ private String finishTime;
+}
@@ -97,12 +97,12 @@ public class AircraftTypeService {
return Result.result(flag, msg, msg);
- public Result<List<AircraftTypeEntity>> findByName(String name){
- if (name==null || "".equals(name)){
- return Result.result(false, "名称不能为空", null);
- }
+ public List<AircraftTypeEntity> findByName(String name){
+// if (name==null || "".equals(name)){
+// return Result.result(false, "名称不能为空", null);
+// }
List<AircraftTypeEntity> list = aircraftTypeDao.findByName("%" + name + "%");
- return Result.success(list);
+ return list;
public AircraftTypeEntity getAircraftType(Integer id) {
@@ -96,12 +96,12 @@ public class CardService {
- public Result<List<CardEntity>> findByName(String name){
- if (name == null ||"".equals(name)){
- return Result.result(false, "名称不能为空" ,null);
+ public List<CardEntity> findByName(String name){
List<CardEntity> list = cardDao.findByName("%" + name + "%");
public List<CardEntity> findByName1(String name){
@@ -92,12 +92,12 @@ public class FaultService {
- public Result<List<FaultEntity>> findByName(String name){
+ public List<FaultEntity> findByName(String name){
List<FaultEntity> list = faultDao.findByName("%" + name + "%");
public FaultEntity getOutline(Integer id) {
@@ -2,6 +2,7 @@ package com.zglc.fm.service;
import com.zglc.fm.dao.master.LogDao;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
@@ -102,9 +103,10 @@ public class LogService{
- public Result<List<LogEntity>> findByLog(LogEntity log){
- List<LogEntity> list = logDao.findByLog(log);
+ public List<LogEntity> findByLog(LogFind log){
+ return logDao.findByLog(log);
@@ -99,12 +99,12 @@ public class MajorService {
- public Result<List<MajorEntity>> findByName(String name){
+ public List<MajorEntity> findByName(String name){
List<MajorEntity> list = majorDao.findByName("%" + name + "%");
public MajorEntity getMajor(Integer id) {
@@ -89,12 +89,12 @@ public class ManuelService {
- public Result<List<ManuelEntity>> findByName(String name){
+ public List<ManuelEntity> findByName(String name){
List<ManuelEntity> list = manuelDao.findByName("%" + name + "%");
public ManuelEntity getOutline(Integer id) {
@@ -88,12 +88,12 @@ public class OutlineService {
- public Result<List<OutlineEntity>> findByName(String name){
+ public List<OutlineEntity> findByName(String name){
List<OutlineEntity> list = outlineDao.findByName("%" + name + "%");
public OutlineEntity getOutline(Integer id) {
@@ -17,7 +17,7 @@
<result property="execStatus" column="exec_status"/>
</resultMap>
- <select id="findByLog" parameterType="com.zglc.fm.entity.LogEntity" resultMap="logMap">
+ <select id="findByLog" parameterType="com.zglc.fm.entity.LogFind" resultMap="logMap">
select id,user_id,real_name,begin_time,finish_time,user_ip,request_url,request_description,arguments,exec_status
from t_log where 1=1
<if test="realName !=null">