diff --git a/src/main/java/org/energy/modules/inspection/controller/InspectionObjectController.java b/src/main/java/org/energy/modules/inspection/controller/InspectionObjectController.java index f97c086..6e22fb6 100644 --- a/src/main/java/org/energy/modules/inspection/controller/InspectionObjectController.java +++ b/src/main/java/org/energy/modules/inspection/controller/InspectionObjectController.java @@ -38,6 +38,9 @@ import org.apache.commons.codec.Charsets; import org.energy.modules.inspection.entity.InspectionRoute; import org.energy.modules.inspection.excel.InspectionObjectExcel; import org.energy.modules.inspection.excel.InspectionRouteExcel; +import org.energy.modules.leger.excel.EquipmentLedgerExcel; +import org.energy.modules.leger.vo.EquipmentLedgerVO; +import org.energy.modules.system.util.DataUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestParam; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -90,8 +93,8 @@ public class InspectionObjectController extends DafController { if (StringUtil.isNotEmpty(inspectionObject.getObjectNo())) { qw.lambda().like(InspectionObject::getObjectNo, inspectionObject.getObjectNo()); } - if (null != inspectionObject.getObjectName()) { - qw.lambda().eq(InspectionObject::getObjectName, inspectionObject.getObjectName()); + if (StringUtil.isNotEmpty(inspectionObject.getObjectName())) { + qw.lambda().like(InspectionObject::getObjectName, inspectionObject.getObjectName()); } if (null != inspectionObject.getStation()) { qw.lambda().eq(InspectionObject::getStation, inspectionObject.getStation()); @@ -214,20 +217,8 @@ public class InspectionObjectController extends DafController { @ApiOperation(value = "导出", notes = "传入") @ApiLog public void exportInspectionObject(@ApiIgnore @RequestParam Map entity, HttpServletResponse response) { - if (entity.containsKey("station_equal")) { - entity.put("station_equal", Integer.parseInt((String) entity.get("station_equal"))); - } - if (entity.containsKey("istatus_equal")) { - entity.put("istatus_equal", Integer.parseInt((String) entity.get("istatus_equal"))); - } - if (entity.containsKey("objectName_equal")) { - entity.put("objectName_equal", Integer.parseInt((String) entity.get("objectName_equal"))); - } - QueryWrapper queryWrapper = Condition.getQueryWrapper(entity, InspectionObject.class); - queryWrapper.lambda().eq(InspectionObject::getIsDeleted, DafConstant.DB_NOT_DELETED); - queryWrapper.orderByAsc("object_No"); - - List list = inspectionObjectService.export(queryWrapper); + InspectionObjectVO vo = DataUtils.mapToEntity(entity, InspectionObjectVO::new); + List list = inspectionObjectService.export(vo); response.setContentType("application/vnd.ms-excel"); response.setCharacterEncoding(Charsets.UTF_8.name()); String fileName = URLEncoder.encode("巡检对象数据导出", Charsets.UTF_8.name()); diff --git a/src/main/java/org/energy/modules/inspection/excel/InspectionObjectExcel.java b/src/main/java/org/energy/modules/inspection/excel/InspectionObjectExcel.java index b4f2129..3340325 100644 --- a/src/main/java/org/energy/modules/inspection/excel/InspectionObjectExcel.java +++ b/src/main/java/org/energy/modules/inspection/excel/InspectionObjectExcel.java @@ -21,11 +21,11 @@ public class InspectionObjectExcel implements Serializable { @ColumnWidth(15) @ExcelProperty(value = "对象名称") - private String objectNameExt; + private String objectName; @ColumnWidth(15) @ExcelProperty(value = "场站") - private String stationsName; + private String station; @ColumnWidth(15) @ExcelProperty(value = "对象类型") @@ -37,7 +37,7 @@ public class InspectionObjectExcel implements Serializable { @ColumnWidth(15) @ExcelProperty(value = "对象状态") - private String istatusName; + private String istatus; @ColumnWidth(15) @ExcelProperty(value = "KKS编号") diff --git a/src/main/java/org/energy/modules/inspection/mapper/InspectionObjectMapper.java b/src/main/java/org/energy/modules/inspection/mapper/InspectionObjectMapper.java index b2788b1..2cfe86d 100644 --- a/src/main/java/org/energy/modules/inspection/mapper/InspectionObjectMapper.java +++ b/src/main/java/org/energy/modules/inspection/mapper/InspectionObjectMapper.java @@ -28,7 +28,7 @@ public interface InspectionObjectMapper extends BaseMapper { */ List selectInspectionObjectPage(IPage page, InspectionObjectVO inspectionObject); - List exportData(@Param("ew") Wrapper queryWrapper); + List exportData(@Param("vo") InspectionObjectVO inspectionObject); /** * 获取路线编号 diff --git a/src/main/java/org/energy/modules/inspection/mapper/InspectionObjectMapper.xml b/src/main/java/org/energy/modules/inspection/mapper/InspectionObjectMapper.xml index f14bfa2..50df11f 100644 --- a/src/main/java/org/energy/modules/inspection/mapper/InspectionObjectMapper.xml +++ b/src/main/java/org/energy/modules/inspection/mapper/InspectionObjectMapper.xml @@ -34,33 +34,27 @@ , kks_no , object_type , cancel_reason - , CASE - WHEN station = '1' - THEN '景和光伏' - WHEN station = '2' - THEN '北沙一光伏' - WHEN station = '3' - THEN '北沙二光伏' - WHEN station = '4' - THEN '达坂城风电一场' - ELSE '' - END AS stations_name - , CASE - WHEN istatus = '1' - THEN '已生效' - WHEN istatus = '0' - THEN '未生效' - ELSE '' - END AS istatus_name - , CASE - WHEN object_name = '1' - THEN '巡检对象01' - WHEN object_name = '2' - THEN '巡检对象02' - ELSE '' - END AS object_name_ext + ,station + ,istatus + ,object_name , tools_code_id - FROM i_inspection_object ${ew.customSqlSegment} + FROM i_inspection_object a + where a.is_deleted = 0 + + and a.object_no LIKE CONCAT('%', #{vo.objectNo}, '%') + + + AND a.object_name LIKE CONCAT('%', #{vo.objectName}, '%') + + + AND a.object_area LIKE CONCAT('%', #{vo.objectArea}, '%') + + + and a.istatus = #{vo.istatus} + + + and a.station = #{vo.station} + SELECT eq_ledger_code,device_description,kks_encoding,eq_type,asset_code,manufacturer, manufacturer_country,manufacturer_part_no,manufacture_date,manufacturing_serial_no, - model,size_and_size,object_weight, - CASE - WHEN check_status = '1' THEN '审核中' - WHEN check_status = '2' THEN '已审核' - WHEN check_status = '3' THEN '未通过' - ELSE '' - END AS check_status_ext - FROM l_equipment_ledger ${ew.customSqlSegment} + model,size_and_size,object_weight,check_status + FROM l_equipment_ledger a + where a.is_deleted = 0 + + and a.major LIKE CONCAT('%', #{vo.major}, '%') + + + and a.installation_location LIKE CONCAT('%', #{vo.installationLocation}, '%') + + + and a.eq_ledger_code LIKE CONCAT('%', #{vo.eqLedgerCode}, '%') + + + and a.device_description LIKE CONCAT('%', #{vo.deviceDescription}, '%') + + + and a.eq_type LIKE CONCAT('%', #{vo.eqType}, '%') + + + and a.maintenance_team LIKE CONCAT('%', #{vo.maintenanceTeam}, '%') + + + and a.manufacturing_serial_no LIKE CONCAT('%', #{vo.manufacturingSerialNo}, '%') + + + and a.user_status = #{vo.userStatus} + + + and a.station = #{vo.station} +