Commit 2afdc84f authored by lisong's avatar lisong

修改户用光伏导出、下载模板

parent f2a97230
package com.yeejoin.amos.boot.module.jxiop.api.dto;
import lombok.Data;
@Data
public class EquipMessageExport {
private Integer numSort;
private String name;
private String idNumber;
private String type;
private String equipName;
private String brand;
private String snCode;
private String description;
}
package com.yeejoin.amos.boot.module.jxiop.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jxiop.api.dto.EquipMessageExport;
import com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvDeviceDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvExport;
......@@ -21,6 +22,8 @@ public interface HouseholdPvMapper extends BaseMapper<HouseholdPv> {
List<HouseholdPvExport> selectExportList(@Param("dto")HouseholdPvDto dto, @Param("ids") List<Long> ids);
List<EquipMessageExport> selectExportEquipMessage(@Param("dto")HouseholdPvDto dto, @Param("ids") List<Long> ids);
List<HouseholdPvDeviceDto> selectEquipList(@Param("id")Long id );
......
......@@ -5,10 +5,7 @@ import java.util.List;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.module.jxiop.api.dto.CompanyTreeDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvExport;
import com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvImport;
import com.yeejoin.amos.boot.module.jxiop.api.dto.*;
import com.yeejoin.amos.boot.module.jxiop.api.entity.HouseholdPv;
import com.yeejoin.amos.boot.module.jxiop.api.util.CommonResponse;
import com.yeejoin.amos.feign.privilege.model.UserOrgTreeModel;
......@@ -34,4 +31,14 @@ public interface IHouseholdPvService extends IService<HouseholdPv>{
HouseholdPvDto getBySeq(Long id);
Integer countRepeat(HouseholdPvDto householdPvDto, String type);
/**
* 导出-户用光伏运维表-设备信息
* @param dto
* @param ids
* @return
*/
List<EquipMessageExport> selectExportEquipMessage(HouseholdPvDto dto, List<Long> ids);
}
......@@ -97,5 +97,42 @@
WHERE
sequence_nbr = #{id}
</select>
<select id="selectExportEquipMessage"
resultType="com.yeejoin.amos.boot.module.jxiop.api.dto.EquipMessageExport">
SELECT
(@i:= @i+1) as numSort,
hp.`name`,
hp.ID_number AS idNumber,
hpd.type,
hpd.name as equipName,
hpd.brand,
hpd.SN_code as snCode,
hpd.SN_code as description
FROM
(SELECT @i:=0) as i,
household_pv hp
left join household_pv_device hpd on hp.sequence_nbr = hpd.household_pv_id
<where>
<if test="dto.name != null and dto.name != ''">
and hp.name like concat('%',#{dto.name},'%')
</if>
<if test="dto.bizOrgCode != null and dto.bizOrgCode != ''">
and hp.biz_org_code like concat('%',#{dto.bizOrgCode},'%')
</if>
<if test="dto.level != null and dto.level != ''">
and hp.level = #{dto.level}
</if>
<if test="dto.number != null and dto.number != ''">
and hp.number like concat('%',#{dto.number},'%')
</if>
<if test="ids != null and ids.size > 0">
and hp.sequence_nbr in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>
......@@ -522,4 +522,18 @@ public class HouseholdPvServiceImpl extends BaseService<HouseholdPvDto, Househol
return householdPvDto;
}
@Override
public List<EquipMessageExport> selectExportEquipMessage(HouseholdPvDto dto, List<Long> ids) {
String bizOrgCode = null;
if (!ObjectUtils.isEmpty(dto.getPlatformCompanyId())) {
bizOrgCode = getOrgCode(dto.getPlatformCompanyId());
if (!ObjectUtils.isEmpty(bizOrgCode)) {
dto.setBizOrgCode(bizOrgCode);
}
}
return householdPvMapper.selectExportEquipMessage(dto, ids);
}
}
\ No newline at end of file
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