pv终端台账

This commit is contained in:
2022-07-25 11:49:01 +08:00
parent 07ed3f0c3a
commit 072be96034
13 changed files with 77 additions and 17 deletions

View File

@@ -11,6 +11,7 @@ import com.njcn.common.utils.HttpResultUtil;
import com.njcn.device.pojo.param.pv.PvSubstationParam;
import com.njcn.device.pojo.param.pv.SubstationQueryParam;
import com.njcn.device.pojo.po.pv.PvSubstation;
import com.njcn.device.pojo.vo.pv.PvSubstationVO;
import com.njcn.pvdevice.service.IPvSubstationService;
import com.njcn.web.pojo.param.BaseParam;
import io.swagger.annotations.Api;
@@ -88,9 +89,9 @@ public class PvSubstationController extends BaseController {
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@ApiOperation("分页查询变电站")
@ApiImplicitParam(name = "substationQueryParam",value = "变电站实体",required = true)
public HttpResult<Page<PvSubstation>> getPvSubstationList(@RequestBody SubstationQueryParam substationQueryParam){
public HttpResult<Page<PvSubstationVO>> getPvSubstationList(@RequestBody SubstationQueryParam substationQueryParam){
String methodDescribe = getMethodDescribe("getPvSubstationList");
Page<PvSubstation> page = iPvSubstationService.getPvSubstationList(substationQueryParam);
Page<PvSubstationVO> page = iPvSubstationService.getPvSubstationList(substationQueryParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
}

View File

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.device.pojo.param.pv.SubstationQueryParam;
import com.njcn.device.pojo.po.pv.PvSubstation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.device.pojo.vo.pv.PvSubstationVO;
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
import org.apache.ibatis.annotations.Param;
@@ -19,7 +20,7 @@ import java.util.List;
*/
public interface PvSubstationMapper extends BaseMapper<PvSubstation> {
Page<PvSubstation> getPvSubstationList(Page<PvSubstation> page,@Param("substationQueryParam") SubstationQueryParam substationQueryParam);
Page<PvSubstationVO> getPvSubstationList(Page<PvSubstation> page, @Param("substationQueryParam") SubstationQueryParam substationQueryParam);
/**
* 终端树结构的变电站

View File

@@ -2,10 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.pvdevice.mapper.PvSubstationMapper">
<select id="getPvSubstationList" resultType="PvSubstation">
<select id="getPvSubstationList" resultType="PvSubstationVO">
SELECT
sub.id,
unit.NAME unitId,
dept.NAME unitId,
dic.NAME scale,
sub.NAME,
sub.Total_Capacity,
@@ -14,6 +14,7 @@
pv_substation sub
LEFT JOIN pv_unit unit ON sub.unit_id = unit.id
LEFT JOIN sys_dict_data dic ON sub.scale = dic.id
LEFT JOIN sys_dept dept ON sub.unit_id = dept.id
<where>
<if test="substationQueryParam.searchValue!=null and substationQueryParam.searchValue!=''">
and sub.name like CONCAT('%',#{substationQueryParam.searchValue},'%')

View File

@@ -6,6 +6,7 @@ import com.njcn.device.pojo.param.pv.SubstationQueryParam;
import com.njcn.device.pojo.po.pv.PvSubstation;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.device.pojo.po.pv.PvSubstation;
import com.njcn.device.pojo.vo.pv.PvSubstationVO;
import com.njcn.web.pojo.param.BaseParam;
import java.util.List;
@@ -46,7 +47,7 @@ public interface IPvSubstationService extends IService<PvSubstation> {
* @date 2022/7/5
* @return Page<PvSubstation>
*/
Page<PvSubstation> getPvSubstationList(SubstationQueryParam substationQueryParam);
Page<PvSubstationVO> getPvSubstationList(SubstationQueryParam substationQueryParam);
List<PvSubstation> getAllPvSubstationList();

View File

@@ -92,7 +92,7 @@ public class PvDeviceServiceImpl extends ServiceImpl<PvDeviceMapper, PvDevice> i
if (isUpdate) {
//更新操作
if (pvDeviceParam instanceof PvDeviceParam.UpdatePvDeviceParam) {
lambdaQueryWrapper.eq(PvDevice::getId, ((PvDeviceParam.UpdatePvDeviceParam) pvDeviceParam).getId());
lambdaQueryWrapper.ne(PvDevice::getId, ((PvDeviceParam.UpdatePvDeviceParam) pvDeviceParam).getId());
}
}
int count = this.count(lambdaQueryWrapper);

View File

@@ -97,7 +97,7 @@ public class PvDistributedServiceImpl extends ServiceImpl<PvDistributedMapper, P
if (isUpdate) {
//更新操作
if (pvDistributedParam instanceof PvDistributedParam.UpdatePvDistributedParam) {
lambdaQueryWrapper.eq(PvDistributed::getId, ((PvDistributedParam.UpdatePvDistributedParam) pvDistributedParam).getId());
lambdaQueryWrapper.ne(PvDistributed::getId, ((PvDistributedParam.UpdatePvDistributedParam) pvDistributedParam).getId());
}
}
int count = this.count(lambdaQueryWrapper);
@@ -110,7 +110,7 @@ public class PvDistributedServiceImpl extends ServiceImpl<PvDistributedMapper, P
if (isUpdate) {
//更新操作
if (pvDistributedParam instanceof PvDistributedParam.UpdatePvDistributedParam) {
lambdaQueryWrapper.eq(PvDistributed::getId, ((PvDistributedParam.UpdatePvDistributedParam) pvDistributedParam).getId());
lambdaQueryWrapper.ne(PvDistributed::getId, ((PvDistributedParam.UpdatePvDistributedParam) pvDistributedParam).getId());
}
}
int countUserCode = this.count(lambdaQueryWrapper);

View File

@@ -97,12 +97,12 @@ public class PvLvUserServiceImpl extends ServiceImpl<PvLvUserMapper, PvLvUser> i
if (isUpdate) {
//更新操作
if (pvLvUserParam instanceof PvLvUserParam.UpdatePvLvUserParam) {
lambdaQueryWrapper.eq(PvLvUser::getId, ((PvLvUserParam.UpdatePvLvUserParam) pvLvUserParam).getId());
lambdaQueryWrapper.ne(PvLvUser::getId, ((PvLvUserParam.UpdatePvLvUserParam) pvLvUserParam).getId());
}
}
int count = this.count(lambdaQueryWrapper);
if (count > 0) {
throw new BusinessException(PvDeviceResponseEnum.SUB_AREA_REPEAT);
throw new BusinessException(PvDeviceResponseEnum.LV_USER_REPEAT);
}
@@ -111,7 +111,7 @@ public class PvLvUserServiceImpl extends ServiceImpl<PvLvUserMapper, PvLvUser> i
if (isUpdate) {
//更新操作
if (pvLvUserParam instanceof PvLvUserParam.UpdatePvLvUserParam) {
lambdaQueryWrapper.eq(PvLvUser::getId, ((PvLvUserParam.UpdatePvLvUserParam) pvLvUserParam).getId());
lambdaQueryWrapper.ne(PvLvUser::getId, ((PvLvUserParam.UpdatePvLvUserParam) pvLvUserParam).getId());
}
}
int countUserCode = this.count(lambdaQueryWrapper);

View File

@@ -104,7 +104,7 @@ public class PvSubAreaServiceImpl extends ServiceImpl<PvSubAreaMapper, PvSubArea
if (isUpdate) {
//更新操作
if (pvSubAreaParam instanceof PvSubAreaParam.UpdatePvSubAreaParam) {
lambdaQueryWrapper.eq(PvSubArea::getId, ((PvSubAreaParam.UpdatePvSubAreaParam) pvSubAreaParam).getId());
lambdaQueryWrapper.ne(PvSubArea::getId, ((PvSubAreaParam.UpdatePvSubAreaParam) pvSubAreaParam).getId());
}
}
int count = this.count(lambdaQueryWrapper);

View File

@@ -14,6 +14,7 @@ import com.njcn.device.pojo.param.pv.SubstationQueryParam;
import com.njcn.device.pojo.po.Node;
import com.njcn.device.pojo.po.pv.PvSubstation;
import com.njcn.device.pojo.po.pv.PvSubstation;
import com.njcn.device.pojo.vo.pv.PvSubstationVO;
import com.njcn.pvdevice.mapper.PvSubstationMapper;
import com.njcn.pvdevice.service.IPvSubstationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -68,7 +69,7 @@ public class PvSubstationServiceImpl extends ServiceImpl<PvSubstationMapper, PvS
}
@Override
public Page<PvSubstation> getPvSubstationList(SubstationQueryParam substationQueryParam) {
public Page<PvSubstationVO> getPvSubstationList(SubstationQueryParam substationQueryParam) {
Page<PvSubstation> page = new Page<>(PageFactory.getPageNum(substationQueryParam),PageFactory.getPageSize(substationQueryParam));
return this.baseMapper.getPvSubstationList(page,substationQueryParam);
}
@@ -102,7 +103,7 @@ public class PvSubstationServiceImpl extends ServiceImpl<PvSubstationMapper, PvS
if (isUpdate) {
//更新操作
if (pvSubstationParam instanceof PvSubstationParam.UpdatePvSubstationParam) {
lambdaQueryWrapper.eq(PvSubstation::getId, ((PvSubstationParam.UpdatePvSubstationParam) pvSubstationParam).getId());
lambdaQueryWrapper.ne(PvSubstation::getId, ((PvSubstationParam.UpdatePvSubstationParam) pvSubstationParam).getId());
}
}
int count = this.count(lambdaQueryWrapper);

View File

@@ -101,7 +101,7 @@ public class PvTenVoltageServiceImpl extends ServiceImpl<PvTenVoltageMapper, PvT
if (isUpdate) {
//更新操作
if (pvTenVoltageParam instanceof PvTenVoltageParam.UpdatePvTenVoltageParam) {
lambdaQueryWrapper.eq(PvTenVoltage::getId, ((PvTenVoltageParam.UpdatePvTenVoltageParam) pvTenVoltageParam).getId());
lambdaQueryWrapper.ne(PvTenVoltage::getId, ((PvTenVoltageParam.UpdatePvTenVoltageParam) pvTenVoltageParam).getId());
}
}
int count = this.count(lambdaQueryWrapper);

View File

@@ -99,7 +99,7 @@ public class PvVoltageServiceImpl extends ServiceImpl<PvVoltageMapper, PvVoltage
if (isUpdate) {
//更新操作
if (pvVoltageParam instanceof PvVoltageParam.UpdatePvVoltageParam) {
lambdaQueryWrapper.eq(PvVoltage::getId, ((PvVoltageParam.UpdatePvVoltageParam) pvVoltageParam).getId());
lambdaQueryWrapper.ne(PvVoltage::getId, ((PvVoltageParam.UpdatePvVoltageParam) pvVoltageParam).getId());
}
}
int count = this.count(lambdaQueryWrapper);