Commit b8027e66 authored by zhengjuzi's avatar zhengjuzi

管材统计

parent 676f0378
......@@ -3,6 +3,9 @@ package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.yeejoin.amos.boot.module.ugp.api.entity.Material;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
/**
* 材料信息表 Mapper 接口
*
......@@ -11,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface MaterialMapper extends BaseMapper<Material> {
List<Map<String, Long>> pipeManufacturerStatistics();
}
......@@ -2,4 +2,8 @@
<!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">
<select id="pipeManufacturerStatistics" resultType="java.util.Map">
SELECT manufacture_addr as name ,COUNT(1) as value FROM tz_ugp_material GROUP BY manufacture_addr
</select>
</mapper>
......@@ -17,6 +17,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -232,4 +233,14 @@ public class MaterialController extends BaseController {
}
/**
* 管材厂家统计
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/pipeManufacturer")
@ApiOperation(httpMethod = "GET",value = "管材厂家统计", notes = "管材厂家统计")
public ResponseModel<List<Map<String,Long>>> pipeManufacturerStatistics() {
return ResponseHelper.buildResponse(materialServiceImpl.pipeManufacturerStatistics());
}
}
......@@ -24,6 +24,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 材料信息表服务实现类
......@@ -176,4 +177,8 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate
Material material = materialMapper.selectOne(wrapper);
return material;
}
public List<Map<String, Long>> pipeManufacturerStatistics() {
return materialMapper.pipeManufacturerStatistics();
}
}
\ 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