Commit 5f979703 authored by caotao's avatar caotao

户用光伏-运维工单分页接口调整。

parent ad906a17
package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.hygf.api.dto.HYGFMaintenanceTicketsDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.HYGFMaintenanceTickets;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
......@@ -9,4 +11,6 @@ import java.util.List;
public interface HYGFMaintenanceTicketsMapper extends BaseMapper<HYGFMaintenanceTickets> {
@Select("SELECT sn_code FROM hygf_jp_inverter WHERE third_station_id = #{stationId}")
List<String> queryInverterSncodesByStationId(String stationId);
List<HYGFMaintenanceTicketsDto> qureyListByQueryparams(@Param("dto") HYGFMaintenanceTicketsDto dto );
}
......@@ -2,4 +2,20 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.HYGFMaintenanceTicketsMapper">
<select id="qureyListByQueryparams"
resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HYGFMaintenanceTicketsDto">
select * from
hygf_maintenance_tickets
<where>
is_delete = 0
<if test="dto.handlerStatus != null and dto.handlerStatus !=''">
And handler_status = #{dto.handlerStatus}
</if>
<if test="dto.stationName != null and dto.stationName !=''">
And station_name LIKE CONCAT('%', #{dto.stationName}, '%')
</if>
</where>
order by sequence_nbr desc
</select>
</mapper>
......@@ -90,15 +90,13 @@ public class HYGFMaintenanceTicketsController extends BaseController {
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "运维工单分页查询", notes = "运维工单分页查询")
public ResponseModel<Page<HYGFMaintenanceTicketsDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<HYGFMaintenanceTicketsDto> page = new Page<HYGFMaintenanceTicketsDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(hygfMaintenanceTicketsServiceimpl.queryForHYGFMaintenanceTicketsDtoPage(page));
(value = "size") int size, HYGFMaintenanceTicketsDto hygfMaintenanceTicketsDto) {
return ResponseHelper.buildResponse(hygfMaintenanceTicketsServiceimpl.queryForHYGFMaintenanceTicketsDtoPage(current,size,hygfMaintenanceTicketsDto));
}
/**
......
......@@ -4,7 +4,10 @@ import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yeejoin.amos.boot.module.hygf.api.dto.*;
import com.yeejoin.amos.boot.module.hygf.api.entity.HYGFMaintenanceTickets;
import com.yeejoin.amos.boot.module.hygf.api.mapper.HYGFMaintenanceTicketsMapper;
......@@ -29,8 +32,16 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
/**
* 分页查询
*/
public Page<HYGFMaintenanceTicketsDto> queryForHYGFMaintenanceTicketsDtoPage(Page<HYGFMaintenanceTicketsDto> page) {
return this.queryForPage(page, null, false);
public Page<HYGFMaintenanceTicketsDto> queryForHYGFMaintenanceTicketsDtoPage(int current,int size ,HYGFMaintenanceTicketsDto hygfMaintenanceTicketsDto) {
PageHelper.startPage(current,size);
List<HYGFMaintenanceTicketsDto> hygfMaintenanceTicketsDtos = this.getBaseMapper().qureyListByQueryparams(hygfMaintenanceTicketsDto);
PageInfo<HYGFMaintenanceTicketsDto> page =new PageInfo<>(hygfMaintenanceTicketsDtos);
Page<HYGFMaintenanceTicketsDto> pageNew = new Page<>();
pageNew.setCurrent(current);
pageNew.setTotal(page.getTotal());
pageNew.setSize(size);
pageNew.setRecords(page.getList());
return pageNew;
}
public List<String> queryInverterSncodesByStationId(String stationId){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment