Commit 6712e6b8 authored by 麻笑宇's avatar 麻笑宇

大屏统计方法提交

1. 企业统计(完成) 2. 人员统计(完成) 3. 检验检测机构统计(完成) 5. 行业主管部门分布(完成)
parent ee41c37f
......@@ -18,4 +18,10 @@ public interface ScreenMapper {
List<Map<String, Object>> getCompanyInfo(@Param("screenDto") ScreenDto screenDto);
List<Map<String, Object>> testOrg(@Param("screenDto") ScreenDto screenDto);
List<Map<String, String>> userCount(@Param("screenDto") ScreenDto screenDto);
List<Map<String, Object>> supervisorCount(@Param("screenDto") ScreenDto screenDto);
}
......@@ -21,4 +21,11 @@ import java.util.Map;
public interface IScreenService {
List<Map<String,Object>> companyInfo(ScreenDto screenDto);
List<Map<String,Object>> testOrg(ScreenDto screenDto);
Map<String,Object> userCount(ScreenDto screenDto);
Map<String,Object> supervisorCount(ScreenDto screenDto);
Map<String,Object> equipmentInformCount(ScreenDto screenDto);
}
......@@ -13,6 +13,42 @@
JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT(subquery.org_code, '%')
where bi.equip_category is not null and bi.equip_category != '[]' and bi.unit_type is not null;
</select>
<select id="testOrg" resultType="java.util.Map">
SELECT COUNT(1),
bul.agency_type as agencyType
FROM
( SELECT org_code FROM privilege_company WHERE company_code = #{screenDto.cityCode} ) AS subquery
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( subquery.org_code, '%' )
INNER JOIN tz_base_unit_licence bul ON bul.unit_code = bi.use_unit_code
WHERE
bi.unit_type LIKE concat ( '%', '检验检测机构', '%' )
AND bul.agency_type IS NOT NULL
GROUP BY
bul.agency_type
</select>
<select id="userCount" resultType="java.util.Map">
SELECT
bi.unit_type as unitType
FROM
( SELECT org_code FROM privilege_company WHERE company_code = #{screenDto.cityCode} ) AS subquery
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( subquery.org_code, '%' )
INNER JOIN tzs_user_info tui ON bi.use_unit_code = tui.unit_code
WHERE
tui.post LIKE concat ( '%', '6552', '%' )
AND bi.unit_type IS NOT NULL;
</select>
<select id="supervisorCount" resultType="java.util.Map">
SELECT
COUNT(1),
bi.industry_supervisor as industrySupervisor
FROM
( SELECT org_code FROM privilege_company WHERE company_code = #{screenDto.cityCode} ) AS subquery
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( subquery.org_code, '%' )
WHERE
bi.industry_supervisor IS NOT NULL
GROUP BY
bi.industry_supervisor
</select>
</mapper>
......
......@@ -24,7 +24,7 @@ import java.util.Map;
* @date 2024-07-09
*/
@RestController
@Api(tags = "警情接警填报记录Api")
@Api(tags = "大屏企业统计")
@RequestMapping(value = "/statistics")
public class ScreenController {
@Resource
......@@ -36,4 +36,31 @@ public class ScreenController {
return ResponseHelper.buildResponse(screenService.companyInfo(screenDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/testOrg")
@ApiOperation(httpMethod = "POST", value = "大屏检测机构统计", notes = "大屏检测机构统计")
public ResponseModel<List<Map<String,Object>>> testOrg(@RequestBody ScreenDto screenDto){
return ResponseHelper.buildResponse(screenService.testOrg(screenDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/userCount")
@ApiOperation(httpMethod = "POST", value = "大屏人员统计", notes = "大屏人员统计")
public ResponseModel<Map<String,Object>> userCount(@RequestBody ScreenDto screenDto){
return ResponseHelper.buildResponse(screenService.userCount(screenDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/supervisorCount")
@ApiOperation(httpMethod = "POST", value = "大屏行业主管部门统计", notes = "大屏行业主管部门统计")
public ResponseModel<Map<String,Object>> supervisorCount(@RequestBody ScreenDto screenDto){
return ResponseHelper.buildResponse(screenService.supervisorCount(screenDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/equipmentInformCount")
@ApiOperation(httpMethod = "POST", value = "大屏设备使用场所统计", notes = "大屏设备使用场所统计")
public ResponseModel<Map<String,Object>> equipmentInformCount(@RequestBody ScreenDto screenDto){
return ResponseHelper.buildResponse(screenService.equipmentInformCount(screenDto));
}
}
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