Commit 7873c0aa by wqc

调整app数据接口

parent 024c8fae
...@@ -35,6 +35,12 @@ public interface PortalFeign { ...@@ -35,6 +35,12 @@ public interface PortalFeign {
@PostMapping("/stats/getAreaShjzStats") @PostMapping("/stats/getAreaShjzStats")
ResultVo getAreaShjzStats(@RequestBody Map<String, Object> paramsMap); ResultVo getAreaShjzStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAppShjzData")
ResultVo getAppShjzData(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAppEnjoyData")
ResultVo getAppEnjoyData(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getFivesYearShjzAchieveStats") @PostMapping("/stats/getFivesYearShjzAchieveStats")
ResultVo getFivesYearShjzAchieveStats(@RequestBody Map<String, Object> paramsMap); ResultVo getFivesYearShjzAchieveStats(@RequestBody Map<String, Object> paramsMap);
......
...@@ -53,6 +53,12 @@ public interface IApiLogic extends IApiCommon { ...@@ -53,6 +53,12 @@ public interface IApiLogic extends IApiCommon {
@ApiMethod(name = "获取区域统计列表", service = "PORTAL-SERVER") @ApiMethod(name = "获取区域统计列表", service = "PORTAL-SERVER")
ApiResp getAreaShjzStats(ApiForm form); ApiResp getAreaShjzStats(ApiForm form);
@ApiMethod(name = "获取app统计列表", service = "PORTAL-SERVER")
ApiResp getAppShjzData(ApiForm form);
@ApiMethod(name = "区域在享发放统计", service = "PORTAL-SERVER")
ApiResp getAppEnjoyData(ApiForm form);
@ApiMethod(name = "获取区域社会救助统计列表", service = "PORTAL-SERVER") @ApiMethod(name = "获取区域社会救助统计列表", service = "PORTAL-SERVER")
ApiResp getAreaUnderNumStats(ApiForm form); ApiResp getAreaUnderNumStats(ApiForm form);
......
...@@ -106,6 +106,16 @@ public class ApiV100Logic extends BaseApiLogic implements IApiLogic { ...@@ -106,6 +106,16 @@ public class ApiV100Logic extends BaseApiLogic implements IApiLogic {
} }
@Override @Override
public ApiResp getAppShjzData(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAppShjzData(form.getParamsMap()));
}
@Override
public ApiResp getAppEnjoyData(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAppEnjoyData(form.getParamsMap()));
}
@Override
public ApiResp getAreaUnderNumStats(ApiForm form) { public ApiResp getAreaUnderNumStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAreaUnderNumStats(form.getParamsMap())); return ApiUtils.toApiResp(form, portalFeign.getAreaUnderNumStats(form.getParamsMap()));
} }
......
...@@ -47,4 +47,10 @@ public class CjStatsController { ...@@ -47,4 +47,10 @@ public class CjStatsController {
return ResultVo.success(cjStatsService.getEnjoySubsidyStats(vo)); return ResultVo.success(cjStatsService.getEnjoySubsidyStats(vo));
} }
@ApiOperation("区域在享发放统计")
@PostMapping(value = "/getAppEnjoyData")
public ResultVo getAppEnjoyData(@RequestBody StatsReqVo vo) {
return ResultVo.success(cjStatsService.getAppEnjoyData(vo));
}
} }
...@@ -65,8 +65,13 @@ public class ShjzStatsController { ...@@ -65,8 +65,13 @@ public class ShjzStatsController {
@ApiOperation("获取区域统计列表") @ApiOperation("获取区域统计列表")
@PostMapping(value = "/getAreaShjzStats") @PostMapping(value = "/getAreaShjzStats")
public ResultVo getAreaShjzStats(@RequestBody StatsReqVo vo) { public ResultVo getAreaShjzStats(@RequestBody StatsReqVo vo) {
// AssertUtils.notNull(vo.getYear(), "年份不能为空");
return ResultVo.success(shjzStatsService.getCacheAreaShjzStats(vo)); return ResultVo.success(shjzStatsService.getCacheAreaShjzStats(vo));
} }
@ApiOperation("获取app统计列表")
@PostMapping(value = "/getAppShjzData")
public ResultVo getAppShjzData(@RequestBody StatsReqVo vo) {
return ResultVo.success(shjzStatsService.getAppShjzData(vo));
}
} }
...@@ -73,4 +73,8 @@ public interface CjStatsDao { ...@@ -73,4 +73,8 @@ public interface CjStatsDao {
List<StatsVo> getAreaSubsidyStats(StatsReqVo vo); List<StatsVo> getAreaSubsidyStats(StatsReqVo vo);
StatsVo getEnjoySumStats(StatsReqVo vo); StatsVo getEnjoySumStats(StatsReqVo vo);
List<StatsVo> getAppEnjoyData(StatsReqVo vo);
List<StatsVo> getAppEnjoyTotal(StatsReqVo vo);
} }
...@@ -2,6 +2,7 @@ package com.zq.portal.dao; ...@@ -2,6 +2,7 @@ package com.zq.portal.dao;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.zq.common.constant.DBName; import com.zq.common.constant.DBName;
import com.zq.portal.entity.AppData;
import com.zq.portal.vo.SearchReqVo; import com.zq.portal.vo.SearchReqVo;
import com.zq.portal.vo.StatsReqVo; import com.zq.portal.vo.StatsReqVo;
import com.zq.portal.vo.StatsVo; import com.zq.portal.vo.StatsVo;
...@@ -79,4 +80,8 @@ public interface ShjzStatsDao { ...@@ -79,4 +80,8 @@ public interface ShjzStatsDao {
List<StatsVo> getMonyNumStats(StatsReqVo vo); List<StatsVo> getMonyNumStats(StatsReqVo vo);
List<StatsVo> getAreaTotalNumStats(StatsReqVo vo); List<StatsVo> getAreaTotalNumStats(StatsReqVo vo);
List<StatsVo> getAppShjzData(StatsReqVo vo);
AppData getAppData();
} }
package com.zq.portal.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "app_data")
public class AppData {
/**
* id
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
*
*/
@ApiModelProperty("临时救助人数(来源救助系统查询)")
private String temporaryHelp;
/**
*
*/
@ApiModelProperty("支出型困难(来源救助系统查询)")
private String expensesHu;
}
...@@ -180,7 +180,7 @@ public class CjStatsService { ...@@ -180,7 +180,7 @@ public class CjStatsService {
issueStatsList.sort(Comparator.comparing(StatsVo::getYear)); issueStatsList.sort(Comparator.comparing(StatsVo::getYear));
for (StatsVo difficultStats : issueStatsList) { for (StatsVo difficultStats : issueStatsList) {
numList.add(String.valueOf(difficultStats.getNum())); numList.add(String.valueOf(difficultStats.getNum()));
amountList.add(difficultStats.getAmount()); amountList.add(difficultStats.getAmount().toString());
} }
} }
...@@ -229,7 +229,7 @@ public class CjStatsService { ...@@ -229,7 +229,7 @@ public class CjStatsService {
} }
areaList.add(area.getName()); areaList.add(area.getName());
severeIssueNumList.add(String.valueOf(severeAreaIssueStat.getNum())); severeIssueNumList.add(String.valueOf(severeAreaIssueStat.getNum()));
severeIssueAmountList.add(severeAreaIssueStat.getAmount()); severeIssueAmountList.add(severeAreaIssueStat.getAmount().toString());
vo.setSubAreaCode(severeAreaIssueStat.getCode()); vo.setSubAreaCode(severeAreaIssueStat.getCode());
Map<String, Object> data = new HashMap<>(); Map<String, Object> data = new HashMap<>();
...@@ -250,7 +250,7 @@ public class CjStatsService { ...@@ -250,7 +250,7 @@ public class CjStatsService {
Optional<Map<String, Object>> oData = areaPeopleNumList.stream().filter(m -> m.get("areaCode").toString().equals(statsVo.getCode())).findFirst(); Optional<Map<String, Object>> oData = areaPeopleNumList.stream().filter(m -> m.get("areaCode").toString().equals(statsVo.getCode())).findFirst();
oData.ifPresent(data -> { oData.ifPresent(data -> {
difficultIssueNumList.add(String.valueOf(statsVo.getNum())); difficultIssueNumList.add(String.valueOf(statsVo.getNum()));
difficultIssueAmountList.add(statsVo.getAmount()); difficultIssueAmountList.add(statsVo.getAmount().toString());
BigDecimal issueNum = new BigDecimal(data.get("issueNum").toString()).add(BigDecimal.valueOf(statsVo.getNum())); BigDecimal issueNum = new BigDecimal(data.get("issueNum").toString()).add(BigDecimal.valueOf(statsVo.getNum()));
BigDecimal issueAmount = new BigDecimal(data.get("issueAmount").toString()).add(new BigDecimal(statsVo.getAmount())); BigDecimal issueAmount = new BigDecimal(data.get("issueAmount").toString()).add(new BigDecimal(statsVo.getAmount()));
data.put("issueNum", issueNum); data.put("issueNum", issueNum);
...@@ -328,4 +328,51 @@ public class CjStatsService { ...@@ -328,4 +328,51 @@ public class CjStatsService {
return returnData; return returnData;
} }
public Object getAppEnjoyData(StatsReqVo vo) {
if (StringUtils.isBlank(vo.getAreaCode())) {
vo.setAreaCode("450000000000");
}
SystemArea systemArea = areaDao.selectById(vo.getAreaCode());
vo.setSubAreaCode(systemArea.subAreaCode());
vo.setSize(SystemArea.getNextLevelLength(systemArea.getType()));
List<StatsVo> peopleNumStats=cjStatsDao.getAppEnjoyData(vo);
List<StatsVo> stats= cjStatsDao.getAppEnjoyTotal(vo);
Map<String, Object> totalData = new HashMap<>();
for (StatsVo totalStat : stats) {
if ("1".equals(totalStat.getType())) {
totalData.put("severeTotal",BigDecimal.valueOf(totalStat.getNum()).divide(BigDecimal.valueOf(10000),2,RoundingMode.HALF_UP));
}else{
totalData.put("difficultTotal",BigDecimal.valueOf(totalStat.getNum()).divide(BigDecimal.valueOf(10000),2,RoundingMode.HALF_UP));
}
}
Map<String, Map<String, Object>> map = new HashMap<>();
// 添加重度残疾人护理补贴人数
List<StatsVo> severeCjNumStats = peopleNumStats.stream().filter(statsVo -> "1".equals(statsVo.getType())).collect(Collectors.toList());
severeCjNumStats.forEach(statsVo -> {
Map<String, Object> data = map.computeIfAbsent(statsVo.getCode(), k -> new HashMap<>());
data.put("severeCjNum", BigDecimal.valueOf(statsVo.getNum()).divide(BigDecimal.valueOf(10000),2,RoundingMode.HALF_UP));
});
// 添加困难残疾人生活补贴人数
List<StatsVo> difficultCjNumStats = peopleNumStats.stream().filter(statsVo -> "2".equals(statsVo.getType())).collect(Collectors.toList());
difficultCjNumStats.forEach(statsVo -> {
Map<String, Object> data = map.computeIfAbsent(statsVo.getCode(), k -> new HashMap<>());
data.put("difficultCjNum", BigDecimal.valueOf(statsVo.getNum()).divide(BigDecimal.valueOf(10000),2,RoundingMode.HALF_UP));
});
List<Map<String, Object>> dataList = new ArrayList<>();
// map数据转成list,提示添加key为区域码
map.forEach((k, v) -> {
SystemArea area = areaDao.selectById(SystemArea.patchZero(k));
v.put("areaCode", k);
v.put("city", area!=null?area.getName():"");
dataList.add(v);
});
List<Map<String,Object>> mapData = dataList.stream().sorted(Comparator.comparing(m -> m.get("areaCode").toString())).collect(Collectors.toList());
Map<String, Object> returnData = new HashMap<>();
returnData.put("map",mapData);
returnData.put("total",totalData);
return mapData;
}
} }
...@@ -358,10 +358,10 @@ public class ShjzStatsService { ...@@ -358,10 +358,10 @@ public class ShjzStatsService {
Map<String, Object> totalData = new HashMap<>(); Map<String, Object> totalData = new HashMap<>();
for (StatsVo totalStat : stats) { for (StatsVo totalStat : stats) {
if ("0".equals(totalStat.getType())) { if ("农村低保".equals(totalStat.getType())) {
totalData.put("villageTotal",totalStat.getNum());//农村低保 totalData.put("villageTotal",BigDecimal.valueOf(totalStat.getNum()).divide(BigDecimal.valueOf(10000),2,RoundingMode.HALF_UP));//农村低保
} else { } else {
totalData.put("cityTotal",totalStat.getNum());//城市低保 totalData.put("cityTotal",BigDecimal.valueOf(totalStat.getNum()).divide(BigDecimal.valueOf(10000),2,RoundingMode.HALF_UP));//城市低保
} }
} }
...@@ -370,25 +370,25 @@ public class ShjzStatsService { ...@@ -370,25 +370,25 @@ public class ShjzStatsService {
List<StatsVo> cityPeopleNumStats = peopleNumStats.stream().filter(statsVo -> "城市低保".equals(statsVo.getType())).collect(Collectors.toList()); List<StatsVo> cityPeopleNumStats = peopleNumStats.stream().filter(statsVo -> "城市低保".equals(statsVo.getType())).collect(Collectors.toList());
cityPeopleNumStats.forEach(statsVo -> { cityPeopleNumStats.forEach(statsVo -> {
Map<String, Object> data = map.computeIfAbsent(statsVo.getCode(), k -> new HashMap<>()); Map<String, Object> data = map.computeIfAbsent(statsVo.getCode(), k -> new HashMap<>());
data.put("cityPeopleNum", statsVo.getNum()); data.put("cityPeopleNum", BigDecimal.valueOf(statsVo.getNum()).divide(BigDecimal.valueOf(10000),2,RoundingMode.HALF_UP));
}); });
// 添加农村低保人数 // 添加农村低保人数
List<StatsVo> villagePeopleNumStats = peopleNumStats.stream().filter(statsVo -> "农村低保".equals(statsVo.getType())).collect(Collectors.toList()); List<StatsVo> villagePeopleNumStats = peopleNumStats.stream().filter(statsVo -> "农村低保".equals(statsVo.getType())).collect(Collectors.toList());
villagePeopleNumStats.forEach(statsVo -> { villagePeopleNumStats.forEach(statsVo -> {
Map<String, Object> data = map.computeIfAbsent(statsVo.getCode(), k -> new HashMap<>()); Map<String, Object> data = map.computeIfAbsent(statsVo.getCode(), k -> new HashMap<>());
data.put("villagePeopleNum", statsVo.getNum()); data.put("villagePeopleNum", BigDecimal.valueOf(statsVo.getNum()).divide(BigDecimal.valueOf(10000),2,RoundingMode.HALF_UP));
}); });
// 添加城市发放金额 // 添加城市发放金额
List<StatsVo> cityMonyStats = monyStats.stream().filter(statsVo -> "1".equals(statsVo.getType())).collect(Collectors.toList()); List<StatsVo> cityMonyStats = monyStats.stream().filter(statsVo -> "1".equals(statsVo.getType())).collect(Collectors.toList());
cityMonyStats.forEach(statsVo -> { cityMonyStats.forEach(statsVo -> {
Map<String, Object> data = map.computeIfAbsent(statsVo.getCode(), k -> new HashMap<>()); Map<String, Object> data = map.computeIfAbsent(statsVo.getCode(), k -> new HashMap<>());
data.put("cityMoney", statsVo.getAmount()); data.put("cityMoney", BigDecimal.valueOf(statsVo.getAmount()).divide(BigDecimal.valueOf(10000),2,RoundingMode.HALF_UP));
}); });
// 添加农村发放金额 // 添加农村发放金额
List<StatsVo> villageMonyStats = monyStats.stream().filter(statsVo -> "0".equals(statsVo.getType())).collect(Collectors.toList()); List<StatsVo> villageMonyStats = monyStats.stream().filter(statsVo -> "0".equals(statsVo.getType())).collect(Collectors.toList());
villageMonyStats.forEach(statsVo -> { villageMonyStats.forEach(statsVo -> {
Map<String, Object> data = map.computeIfAbsent(statsVo.getCode(), k -> new HashMap<>()); Map<String, Object> data = map.computeIfAbsent(statsVo.getCode(), k -> new HashMap<>());
data.put("villageMoney", statsVo.getAmount()); data.put("villageMoney", BigDecimal.valueOf(statsVo.getAmount()).divide(BigDecimal.valueOf(10000),2,RoundingMode.HALF_UP));
}); });
List<Map<String, Object>> dataList = new ArrayList<>(); List<Map<String, Object>> dataList = new ArrayList<>();
...@@ -741,4 +741,37 @@ public class ShjzStatsService { ...@@ -741,4 +741,37 @@ public class ShjzStatsService {
return returnData; return returnData;
} }
public Object getAppShjzData(StatsReqVo vo) {
// 人数
List<StatsVo> totalStat = shjzStatsDao.getAppShjzData(vo);
Map<String, Object> totalData = new HashMap<>();
BigDecimal country =null;
BigDecimal city =null;
BigDecimal nong=null;
BigDecimal cheng=null;
for (StatsVo stats : totalStat) {
if ("农村低保".equals(stats.getType())) {
totalData.put("villageTotal",BigDecimal.valueOf(stats.getNum()).divide(BigDecimal.valueOf(10000),2,RoundingMode.HALF_UP));//农村低保
} else if("城市低保".equals(stats.getType())){
totalData.put("cityTotal",BigDecimal.valueOf(stats.getNum()).divide(BigDecimal.valueOf(10000),2,RoundingMode.HALF_UP));//城市低保
}else if("农村低收入".equals(stats.getType())){
country = BigDecimal.valueOf(stats.getNum()).divide(BigDecimal.valueOf(10000), 2, RoundingMode.HALF_UP);
}else if("城市低收入".equals(stats.getType())){
city = BigDecimal.valueOf(stats.getNum()).divide(BigDecimal.valueOf(10000), 2, RoundingMode.HALF_UP);
}else if("农村特困".equals(stats.getType())){
nong= BigDecimal.valueOf(stats.getNum()).divide(BigDecimal.valueOf(10000), 2, RoundingMode.HALF_UP);
}
else if("城市特困".equals(stats.getType())){
cheng= BigDecimal.valueOf(stats.getNum()).divide(BigDecimal.valueOf(10000), 2, RoundingMode.HALF_UP);
}
totalData.put("lowTotal",country.add(city));
totalData.put("destiTotal",nong.add(cheng));
}
Map<String, Object> returnData = new HashMap<>();
returnData.put("totalData",totalData);
returnData.put("temporaryHelp",shjzStatsDao.getAppData().getTemporaryHelp());
returnData.put("expensesHu",shjzStatsDao.getAppData().getExpensesHu());
return returnData;
}
} }
...@@ -156,4 +156,33 @@ ...@@ -156,4 +156,33 @@
ORDER BY CREATE_DATE DESC ORDER BY CREATE_DATE DESC
</select> </select>
<select id="getAppEnjoyData" resultType="com.zq.portal.vo.StatsVo">
SELECT
LEFT ( a.UNIT_ID, #{size} ) 'code',
a.APPLY_TYPE 'type',
SUM(a.NUM) 'num'
FROM stat_day_enjoy a
WHERE
CHAR_LENGTH (LEFT ( a.UNIT_ID, #{size} )) = #{size}
<if test="subAreaCode != null and subAreaCode != ''">
AND a.UNIT_ID LIKE CONCAT(#{subAreaCode}, '%')
</if>
<if test="type != null and type != ''">
AND a.APPLY_TYPE = #{type}
</if>
GROUP BY
LEFT ( a.UNIT_ID, #{size} ),
a.APPLY_TYPE
</select>
<select id="getAppEnjoyTotal" resultType="com.zq.portal.vo.StatsVo">
SELECT
h.APPLY_TYPE 'type',
SUM( h.NUM ) 'num'
FROM
stat_day_enjoy h
GROUP BY
type
</select>
</mapper> </mapper>
...@@ -107,65 +107,74 @@ ...@@ -107,65 +107,74 @@
</choose> </choose>
</select> </select>
<!-- <select id="getAreaUnderNumStats" resultType="com.zq.portal.vo.StatsVo">-->
<!-- SELECT-->
<!-- LEFT(h.UNIT_ID, #{size}) 'code',-->
<!-- h.ISCITY 'type',-->
<!-- SUM( h.SURE_POPULATION ) 'num'-->
<!-- FROM-->
<!-- ENBUZ_APPLY_HOME h-->
<!-- WHERE h.VP_STATE = 4-->
<!-- AND LEFT(h.UNIT_ID, #{size}) IS NOT NULL-->
<!-- <if test="subAreaCode != null and subAreaCode != ''">-->
<!-- AND h.UNIT_ID LIKE CONCAT(#{subAreaCode}, '%')-->
<!-- </if>-->
<!-- <if test="type != null and type != ''">-->
<!-- AND h.ISCITY = #{type}-->
<!-- </if>-->
<!-- AND DATE_FORMAT( h.PERMIT_DATE, "%Y-%m-%d" ) &lt;= '2021-12-01'-->
<!-- AND DATE_FORMAT( h.STOP_DATE, "%Y-%m-%d" ) >= '2021-12-01'-->
<!-- GROUP BY-->
<!-- LEFT(h.UNIT_ID, #{size}),-->
<!-- type-->
<!-- </select>-->
<select id="getAreaUnderNumStats" resultType="com.zq.portal.vo.StatsVo"> <select id="getAreaUnderNumStats" resultType="com.zq.portal.vo.StatsVo">
SELECT SELECT
LEFT(h.UNIT_ID, #{size}) 'code', LEFT(h.area_code, #{size}) 'code',
h.ISCITY 'type', h.type,
SUM( h.SURE_POPULATION ) 'num' SUM(h.people_num) 'people_num',
SUM(h.family_num) 'family_num'
FROM FROM
ENBUZ_APPLY_HOME h city_coutry h
WHERE h.VP_STATE = 4 WHERE
AND LEFT(h.UNIT_ID, #{size}) IS NOT NULL 1=1
AND LEFT(h.area_code, #{size}) IS NOT NULL
<if test="subAreaCode != null and subAreaCode != ''"> <if test="subAreaCode != null and subAreaCode != ''">
AND h.UNIT_ID LIKE CONCAT(#{subAreaCode}, '%') AND h.area_code LIKE CONCAT(#{subAreaCode}, '%')
</if> </if>
<if test="type != null and type != ''">
AND h.ISCITY = #{type}
</if>
AND DATE_FORMAT( h.PERMIT_DATE, "%Y-%m-%d" ) &lt;= '2021-12-01'
AND DATE_FORMAT( h.STOP_DATE, "%Y-%m-%d" ) >= '2021-12-01'
GROUP BY GROUP BY
LEFT(h.UNIT_ID, #{size}), LEFT(h.area_code, #{size}),
type h.type
</select> </select>
<!-- <select id="getAreaTotalNumStats" resultType="com.zq.portal.vo.StatsVo">-->
<!-- SELECT-->
<!-- h.ISCITY 'type',-->
<!-- SUM( h.SURE_POPULATION ) 'num'-->
<!-- FROM-->
<!-- ENBUZ_APPLY_HOME h-->
<!-- WHERE h.VP_STATE = 4-->
<!-- AND DATE_FORMAT( h.PERMIT_DATE, "%Y-%m-%d" ) &lt;= '2021-12-01'-->
<!-- AND DATE_FORMAT( h.STOP_DATE, "%Y-%m-%d" ) >= '2021-12-01'-->
<!-- AND h.ISCITY IN(0,1)-->
<!-- GROUP BY-->
<!-- type-->
<!-- </select>-->
<select id="getAreaTotalNumStats" resultType="com.zq.portal.vo.StatsVo"> <select id="getAreaTotalNumStats" resultType="com.zq.portal.vo.StatsVo">
SELECT SELECT
h.ISCITY 'type', h.type 'type',
SUM( h.SURE_POPULATION ) 'num' SUM(h.people_num) 'num'
FROM FROM
ENBUZ_APPLY_HOME h city_coutry h
WHERE h.VP_STATE = 4 WHERE
AND DATE_FORMAT( h.PERMIT_DATE, "%Y-%m-%d" ) &lt;= '2021-12-01' h.type IN('城市低保','农村低保')
AND DATE_FORMAT( h.STOP_DATE, "%Y-%m-%d" ) >= '2021-12-01'
AND h.ISCITY IN(0,1)
GROUP BY GROUP BY
type type
</select> </select>
<!--
SELECT DATE_FORMAT(h.PERMIT_DATE, "%Y-%m") 'date',
( CASE h.ISCITY
WHEN 0 THEN '农村低保'
WHEN 1 THEN '城市低保'
WHEN 6 THEN '特困供养'
WHEN 10 THEN '农村低收入'
WHEN 11 THEN '城市低收入'
WHEN 21 THEN '住房救助'
WHEN 31 THEN '城市特困'
ELSE '其他' END ) 'type',
SUM( h.SURE_POPULATION ) 'num'
FROM ENBUZ_APPLY_HOME h
WHERE h.VP_STATE = 4
AND h.ISCITY IN(0, 1)
AND DATE_FORMAT( h.PERMIT_DATE, "%Y" ) > DATE_FORMAT(NOW(), "%Y" ) - 5
AND DATE_FORMAT( h.PERMIT_DATE, "%Y" ) &lt;= DATE_FORMAT(NOW(), "%Y" )
AND DATE_FORMAT( h.PERMIT_DATE, "%Y-%m" ) &lt;= DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 MONTH), "%Y-%m")
AND h.UNIT_ID LIKE CONCAT('45', '%')
GROUP BY
DATE_FORMAT( h.PERMIT_DATE, "%Y-%m" ),
ISCITY
-->
<select id="getFivesYearEnjoyStats" resultType="com.zq.portal.vo.StatsVo"> <select id="getFivesYearEnjoyStats" resultType="com.zq.portal.vo.StatsVo">
SELECT LEFT(date, 4) 'year', type, SUM(num) 'num' FROM ( SELECT DATE_FORMAT(h.PERMIT_DATE, "%Y-%m") 'date', SELECT LEFT(date, 4) 'year', type, SUM(num) 'num' FROM ( SELECT DATE_FORMAT(h.PERMIT_DATE, "%Y-%m") 'date',
( CASE h.ISCITY ( CASE h.ISCITY
...@@ -225,8 +234,8 @@ ...@@ -225,8 +234,8 @@
WHERE WHERE
p.pay_state = 2 p.pay_state = 2
AND p.vp_state = 4 AND p.vp_state = 4
AND DATE_FORMAT( p.pmonth, "%Y-%m-%d" ) >= '2021-12-01' AND DATE_FORMAT( p.pmonth, "%Y-%m-%d" ) >= date_sub(date_sub(date_format(now(),'%y-%m-%d'),interval extract(day from now())-1 day),interval 1 month)
AND DATE_FORMAT( p.pmonth, "%Y-%m-%d" ) &lt;= '2021-12-01' AND DATE_FORMAT( p.pmonth, "%Y-%m-%d" ) &lt;= date_sub(date_sub(date_format(now(),'%y-%m-%d'),interval extract(day from now())-1 day),interval 1 month)
AND CHAR_LENGTH (LEFT ( p.unit_id, #{size} )) = #{size} AND CHAR_LENGTH (LEFT ( p.unit_id, #{size} )) = #{size}
<if test="subAreaCode != null and subAreaCode != ''"> <if test="subAreaCode != null and subAreaCode != ''">
AND p.unit_id LIKE CONCAT(#{subAreaCode}, '%') AND p.unit_id LIKE CONCAT(#{subAreaCode}, '%')
...@@ -239,4 +248,18 @@ ...@@ -239,4 +248,18 @@
p.iscity p.iscity
</select> </select>
<select id="getPeopleNumStats" resultType="com.zq.portal.vo.StatsVo">
SELECT
h.type 'type',
SUM(h.people_num) 'num'
FROM
city_coutry h
GROUP BY
type
</select>
<select id="getAppData" resultType="com.zq.portal.entity.AppData">
SELECT * FROM app_data
</select>
</mapper> </mapper>
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