Commit cc92e3b3 authored by zhengjuzi's avatar zhengjuzi

管材统计修改

parent f55256b0
...@@ -14,5 +14,8 @@ import java.util.Map; ...@@ -14,5 +14,8 @@ import java.util.Map;
*/ */
public interface MaterialMapper extends BaseMapper<Material> { public interface MaterialMapper extends BaseMapper<Material> {
List<Map<String, Long>> pipeManufacturerStatistics(); List<String> pipeManufacturerStatisticsToaXisData();
List<String> pipeManufacturerStatisticsToaSeriesData();
} }
...@@ -2,8 +2,12 @@ ...@@ -2,8 +2,12 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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.ugp.api.mapper.MaterialMapper"> <mapper namespace="com.yeejoin.amos.boot.module.ugp.api.mapper.MaterialMapper">
<select id="pipeManufacturerStatistics" resultType="java.util.Map"> <select id="pipeManufacturerStatisticsToaXisData" resultType="java.lang.String">
SELECT manufacture_addr as axisData ,COUNT(1) as seriesData FROM tz_ugp_material GROUP BY manufacture_addr SELECT manufacture_addr as axisData FROM tz_ugp_material GROUP BY manufacture_addr
</select>
<select id="pipeManufacturerStatisticsToaSeriesData" resultType="java.lang.String">
SELECT COUNT(1) as seriesData FROM tz_ugp_material GROUP BY manufacture_addr
</select> </select>
</mapper> </mapper>
...@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -239,7 +240,7 @@ public class MaterialController extends BaseController { ...@@ -239,7 +240,7 @@ public class MaterialController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/pipeManufacturer") @GetMapping(value = "/pipeManufacturer")
@ApiOperation(httpMethod = "GET",value = "管材厂家统计", notes = "管材厂家统计") @ApiOperation(httpMethod = "GET",value = "管材厂家统计", notes = "管材厂家统计")
public ResponseModel<List<Map<String,Long>>> pipeManufacturerStatistics() { public ResponseModel<Map<String,List<String>>> pipeManufacturerStatistics() {
return ResponseHelper.buildResponse(materialServiceImpl.pipeManufacturerStatistics()); return ResponseHelper.buildResponse(materialServiceImpl.pipeManufacturerStatistics());
} }
......
...@@ -21,10 +21,7 @@ import org.springframework.stereotype.Service; ...@@ -21,10 +21,7 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
* 材料信息表服务实现类 * 材料信息表服务实现类
...@@ -178,7 +175,12 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate ...@@ -178,7 +175,12 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate
return material; return material;
} }
public List<Map<String, Long>> pipeManufacturerStatistics() { public Map<String,List<String>> pipeManufacturerStatistics() {
return materialMapper.pipeManufacturerStatistics(); List<String> list1 = materialMapper.pipeManufacturerStatisticsToaXisData();
List<String> list2 = materialMapper.pipeManufacturerStatisticsToaSeriesData();
Map<String,List<String>> map = new HashMap<>();
map.put("axisData",list1);
map.put("seriesData",list2);
return map;
} }
} }
\ 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