ソースを参照

增加树查询

shiyue 1 年間 前
コミット
3a9d32466d

+ 4 - 6
energy-manage-service/src/main/java/com/energy/manage/service/controller/company/WindCompanyController.java

@@ -3,10 +3,7 @@ package com.energy.manage.service.controller.company;
 
 import com.energy.manage.common.reponse.ResultResp;
 import com.energy.manage.service.config.annotations.UserLoginToken;
-import com.energy.manage.service.domain.dto.company.WindCompanyDelDto;
-import com.energy.manage.service.domain.dto.company.WindCompanyDto;
-import com.energy.manage.service.domain.dto.company.WindCompanyStateDto;
-import com.energy.manage.service.domain.dto.company.WindCompanyUpdateDto;
+import com.energy.manage.service.domain.dto.company.*;
 import com.energy.manage.service.domain.vo.company.WindCompanyPageVo;
 import com.energy.manage.service.service.company.WindCompanyService;
 import io.swagger.annotations.Api;
@@ -67,8 +64,9 @@ public class WindCompanyController {
     @UserLoginToken
     @PostMapping(value = "/getAllWindCompany")
     @ApiOperation(value = "查询企业树")
-    public ResultResp<List<Map<String, Object>>> getAllWindCompany() {
-        List<Map<String, Object>> list = windCompanyService.getAllWindCompany();
+    public ResultResp<List<Map<String, Object>>> getAllWindCompany(@RequestBody WindCompanyPageDto windCompanyPageDto) {
+
+        List<Map<String, Object>> list = windCompanyService.getAllWindCompany(windCompanyPageDto.getState(),windCompanyPageDto.getCompanyName());
         return ResultResp.SUCCESS(list);
     }
 

+ 31 - 0
energy-manage-service/src/main/java/com/energy/manage/service/domain/dto/company/WindCompanyPageDto.java

@@ -0,0 +1,31 @@
+package com.energy.manage.service.domain.dto.company;
+
+import com.energy.manage.common.po.company.WindCompanyPO;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 企业信息树树展示
+ */
+@Getter
+@Setter
+public class WindCompanyPageDto  {
+
+
+    /**
+     * 企业名称
+     */
+    @ApiModelProperty("企业名称")
+    private String companyName;
+
+    /**
+     * 状态
+     */
+    @ApiModelProperty("状态")
+    private Integer state;
+}

+ 1 - 1
energy-manage-service/src/main/java/com/energy/manage/service/mappers/windrelation/WindRelationMapper.java

@@ -20,7 +20,7 @@ public interface WindRelationMapper extends MyMapper<WindRelationPO> {
      * 查询全部项目公司
      * @return
      */
-    List<WindCompanyPageVo> selectWindRelationCompanyByType(@Param("type") String type);
+    List<WindCompanyPageVo> selectWindRelationCompanyByType(@Param("type") String type,@Param("state")Integer state,@Param("companyName")String companyName);
 
 
 }

+ 1 - 1
energy-manage-service/src/main/java/com/energy/manage/service/service/company/WindCompanyService.java

@@ -54,7 +54,7 @@ public interface WindCompanyService extends BaseService<WindCompanyPO> {
      * 查询企业树关系
      * @return
      */
-    List<Map<String, Object>> getAllWindCompany();
+    List<Map<String, Object>> getAllWindCompany(Integer state,String companyName);
 
 
     /**

+ 2 - 2
energy-manage-service/src/main/java/com/energy/manage/service/service/company/impl/WindCompanyServiceImpl.java

@@ -143,8 +143,8 @@ public class WindCompanyServiceImpl extends BaseServiceImpl<WindCompanyPO> imple
     }
 
     @Override
-    public List<Map<String, Object>> getAllWindCompany() {
-        return windRelationService.getWindRelationCompany();
+    public List<Map<String, Object>> getAllWindCompany(Integer state,String companyName) {
+        return windRelationService.getWindRelationCompany(state,companyName);
     }
 
 

+ 1 - 1
energy-manage-service/src/main/java/com/energy/manage/service/service/windrelation/WindRelationService.java

@@ -50,7 +50,7 @@ public interface WindRelationService {
      *
      * @return
      */
-    List<Map<String, Object>> getWindRelationCompany();
+    List<Map<String, Object>> getWindRelationCompany(Integer state,String companyName);
 
 
     /**

+ 3 - 2
energy-manage-service/src/main/java/com/energy/manage/service/service/windrelation/impl/WindRelationServiceImpl.java

@@ -16,6 +16,7 @@ import com.energy.manage.service.util.BeanMapUtils;
 import com.energy.manage.service.util.TreeUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.compress.utils.Lists;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
@@ -86,9 +87,9 @@ public class WindRelationServiceImpl extends BaseServiceImpl<WindRelationPO> imp
 
 
     @Override
-    public  List<Map<String, Object>> getWindRelationCompany() {
+    public  List<Map<String, Object>> getWindRelationCompany(Integer state,String companyName) {
 
-        List<WindCompanyPageVo> windCompanyPageVos = windRelationMapper.selectWindRelationCompanyByType(TypeRelationEnum.COMPANY_NUMBER.getCode());
+        List<WindCompanyPageVo> windCompanyPageVos = windRelationMapper.selectWindRelationCompanyByType(TypeRelationEnum.COMPANY_NUMBER.getCode(),state,companyName);
         // 转化为Map集合
         List<Map<String, Object>> mapList = BeanMapUtils.listBeanToListMap(windCompanyPageVos);
         // 获取树形结构

+ 6 - 0
energy-manage-service/src/main/resources/mybatis/windrelation/WindRelationMapper.xml

@@ -48,6 +48,12 @@
 	    wf.company_code) wf on wc.company_code=wf.company_code
         where 1=1
         and wr.type = #{type}
+        <if test="state!=null">
+        and wc.state = #{state}
+        </if>
+        <if test="companyName!=null">
+        and wc.company_name like CONCAT("%", #{companyName} ,"%")
+        </if>
     </select>