Commit 7873c0aa by wqc

调整app数据接口

parent 024c8fae
package com.zq.api.feign;
import com.zq.api.config.FeignConfig;
import com.zq.common.vo.ResultVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@FeignClient(name = "PORTAL-SERVER", configuration = FeignConfig.class) //指定调用哪个微服务
@RequestMapping("/portal/app")
public interface PortalFeign {
@GetMapping("/area/getChildAreaList")
ResultVo getChildAreaList(@RequestParam String areaCode);
@PostMapping("/stats/getMarriageStats")
ResultVo getMarriageStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getYearMarriedCouple")
ResultVo getYearMarriedCouple(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAreaUnderMarriageStatsList")
ResultVo getAreaUnderMarriageStatsList(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getFivesYearMarriageLine")
ResultVo getFivesYearMarriageLine(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAreaDisabledIssueStats")
ResultVo getAreaDisabledIssueStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getYearDisabledIssueStats")
ResultVo getYearDisabledIssueStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAreaShjzStats")
ResultVo getAreaShjzStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getFivesYearShjzAchieveStats")
ResultVo getFivesYearShjzAchieveStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getFivesYearShjzProvideStats")
ResultVo getFivesYearShjzProvideStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getSoorganStats")
ResultVo getSoorganStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAreaUnderSoorganStatsList")
ResultVo getAreaUnderSoorganStatsList(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAppMapStats")
ResultVo getAppMapStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/gatherSearch")
ResultVo gatherSearch(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAgencyChildStats")
ResultVo getAgencyChildStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAgencyChildStatsList")
ResultVo getAgencyChildStatsList(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getCremationStats")
ResultVo getCremationStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getCremationStatsList")
ResultVo getCremationStatsList(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getCremationStatsById")
ResultVo getCremationStatsById(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAreaUnderNumStats")
ResultVo getAreaUnderNumStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getEnjoySubsidyStats")
ResultVo getEnjoySubsidyStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getEnjoySumStatsData")
ResultVo getEnjoySumStatsData(@RequestBody Map<String, Object> paramsMap);
}
package com.zq.api.feign;
import com.zq.api.config.FeignConfig;
import com.zq.common.vo.ResultVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@FeignClient(name = "PORTAL-SERVER", configuration = FeignConfig.class) //指定调用哪个微服务
@RequestMapping("/portal/app")
public interface PortalFeign {
@GetMapping("/area/getChildAreaList")
ResultVo getChildAreaList(@RequestParam String areaCode);
@PostMapping("/stats/getMarriageStats")
ResultVo getMarriageStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getYearMarriedCouple")
ResultVo getYearMarriedCouple(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAreaUnderMarriageStatsList")
ResultVo getAreaUnderMarriageStatsList(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getFivesYearMarriageLine")
ResultVo getFivesYearMarriageLine(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAreaDisabledIssueStats")
ResultVo getAreaDisabledIssueStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getYearDisabledIssueStats")
ResultVo getYearDisabledIssueStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAreaShjzStats")
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")
ResultVo getFivesYearShjzAchieveStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getFivesYearShjzProvideStats")
ResultVo getFivesYearShjzProvideStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getSoorganStats")
ResultVo getSoorganStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAreaUnderSoorganStatsList")
ResultVo getAreaUnderSoorganStatsList(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAppMapStats")
ResultVo getAppMapStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/gatherSearch")
ResultVo gatherSearch(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAgencyChildStats")
ResultVo getAgencyChildStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAgencyChildStatsList")
ResultVo getAgencyChildStatsList(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getCremationStats")
ResultVo getCremationStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getCremationStatsList")
ResultVo getCremationStatsList(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getCremationStatsById")
ResultVo getCremationStatsById(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getAreaUnderNumStats")
ResultVo getAreaUnderNumStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getEnjoySubsidyStats")
ResultVo getEnjoySubsidyStats(@RequestBody Map<String, Object> paramsMap);
@PostMapping("/stats/getEnjoySumStatsData")
ResultVo getEnjoySumStatsData(@RequestBody Map<String, Object> paramsMap);
}
package com.zq.api.service;
import com.zq.api.constant.ApiMethod;
import com.zq.api.form.ApiForm;
import com.zq.api.form.ApiResp;
/**
* api实现接口
* <p>
* 2016年9月29日 上午11:45:08
*/
public interface IApiLogic extends IApiCommon {
/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓SYS APP接口↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
@ApiMethod(name = "获取用户信息", service = "SYS-SERVER")
ApiResp getUserInfo(ApiForm form);
@ApiMethod(name = "发送验证码", service = "SYS-SERVER")
ApiResp sendCode(ApiForm form);
@ApiMethod(name = "重置密码", service = "SYS-SERVER")
ApiResp resetPassword(ApiForm form);
@ApiMethod(name = "用户手机号登录", service = "SYS-SERVER")
ApiResp phoneLogin(ApiForm form);
@ApiMethod(name = "密码登录", service = "SYS-SERVER")
ApiResp passwdLogin(ApiForm form);
/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓门户接口↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
@ApiMethod(name = "获取婚姻统计", service = "PORTAL-SERVER")
ApiResp getMarriageStats(ApiForm form);
@ApiMethod(name = "获取1年结婚离婚对数", service = "PORTAL-SERVER")
ApiResp getYearMarriedCouple(ApiForm form);
@ApiMethod(name = "获取区域下的婚姻统计列表", service = "PORTAL-SERVER")
ApiResp getAreaUnderMarriageStatsList(ApiForm form);
@ApiMethod(name = "获取近5年婚姻走势", service = "PORTAL-SERVER")
ApiResp getFivesYearMarriageLine(ApiForm form);
@ApiMethod(name = "获取区域残疾发放统计", service = "PORTAL-SERVER")
ApiResp getAreaDisabledIssueStats(ApiForm form);
@ApiMethod(name = "近五年发放人数和金额统计", service = "PORTAL-SERVER")
ApiResp getYearDisabledIssueStats(ApiForm form);
@ApiMethod(name = "获取在享补贴统计", service = "PORTAL-SERVER")
ApiResp getEnjoySubsidyStats(ApiForm form);
@ApiMethod(name = "获取区域统计列表", service = "PORTAL-SERVER")
ApiResp getAreaShjzStats(ApiForm form);
@ApiMethod(name = "获取区域社会救助统计列表", service = "PORTAL-SERVER")
ApiResp getAreaUnderNumStats(ApiForm form);
@ApiMethod(name = "获取近五年城市农村低保发放人数统计", service = "PORTAL-SERVER")
ApiResp getFivesYearShjzAchieveStats(ApiForm form);
@ApiMethod(name = "获取近五年城市农村低保发放金额统计", service = "PORTAL-SERVER")
ApiResp getFivesYearShjzProvideStats(ApiForm form);
@ApiMethod(name = "修改登录密码", service = "PORTAL-SERVER")
ApiResp modifyPasswd(ApiForm form);
@ApiMethod(name = "获取App最新版本", service = "PORTAL-SERVER")
ApiResp getAppVersion(ApiForm form);
@ApiMethod(name = "获取子区域列表", service = "PORTAL-SERVER")
ApiResp getChildAreaList(ApiForm form);
@ApiMethod(name = "获取社会机构统计", service = "PORTAL-SERVER")
ApiResp getSoorganStats(ApiForm form);
@ApiMethod(name = "获取地区下面社会机构统计列表", service = "PORTAL-SERVER")
ApiResp getAreaUnderSoorganStatsList(ApiForm form);
@ApiMethod(name = "获取App首页地图数据", service = "PORTAL-SERVER")
ApiResp getAppMapStats(ApiForm form);
@ApiMethod(name = "汇总搜索", service = "PORTAL-SERVER")
ApiResp gatherSearch(ApiForm form);
@ApiMethod(name = "指定区域下的儿童福利数据统计", service = "PORTAL-SERVER")
ApiResp getAgencyChildStats(ApiForm form);
@ApiMethod(name = "指定区域下级区域的儿童福利数据统计列表", service = "PORTAL-SERVER")
ApiResp getAgencyChildStatsList(ApiForm form);
@ApiMethod(name = "火化量统计", service = "PORTAL-SERVER")
ApiResp getCremationStats(ApiForm form);
@ApiMethod(name = "火化量统计列表", service = "PORTAL-SERVER")
ApiResp getCremationStatsList(ApiForm form);
@ApiMethod(name = "殡仪馆火化量统计列表", service = "PORTAL-SERVER")
ApiResp getCremationStatsById(ApiForm form);
/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓SYS单点登录接口↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
@ApiMethod(name = "获取单点登录用户信息", service = "SYS-SERVER")
ApiResp getSsoUserInfo(ApiForm form);
@ApiMethod(name = "单点登出", service = "SYS-SERVER")
ApiResp ssoLogout(ApiForm form);
/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓开放接口↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
@ApiMethod(name = "婚姻搜索接口", service = "OPEN-SERVER")
ApiResp marriageSearch(ApiForm form);
@ApiMethod(name = "自然人搜索接口", service = "OPEN-SERVER")
ApiResp naturalPersonSearch(ApiForm form);
@ApiMethod(name = "火化搜索接口", service = "OPEN-SERVER")
ApiResp cremationSearch(ApiForm form);
}
package com.zq.api.service;
import com.zq.api.constant.ApiMethod;
import com.zq.api.form.ApiForm;
import com.zq.api.form.ApiResp;
/**
* api实现接口
* <p>
* 2016年9月29日 上午11:45:08
*/
public interface IApiLogic extends IApiCommon {
/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓SYS APP接口↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
@ApiMethod(name = "获取用户信息", service = "SYS-SERVER")
ApiResp getUserInfo(ApiForm form);
@ApiMethod(name = "发送验证码", service = "SYS-SERVER")
ApiResp sendCode(ApiForm form);
@ApiMethod(name = "重置密码", service = "SYS-SERVER")
ApiResp resetPassword(ApiForm form);
@ApiMethod(name = "用户手机号登录", service = "SYS-SERVER")
ApiResp phoneLogin(ApiForm form);
@ApiMethod(name = "密码登录", service = "SYS-SERVER")
ApiResp passwdLogin(ApiForm form);
/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓门户接口↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
@ApiMethod(name = "获取婚姻统计", service = "PORTAL-SERVER")
ApiResp getMarriageStats(ApiForm form);
@ApiMethod(name = "获取1年结婚离婚对数", service = "PORTAL-SERVER")
ApiResp getYearMarriedCouple(ApiForm form);
@ApiMethod(name = "获取区域下的婚姻统计列表", service = "PORTAL-SERVER")
ApiResp getAreaUnderMarriageStatsList(ApiForm form);
@ApiMethod(name = "获取近5年婚姻走势", service = "PORTAL-SERVER")
ApiResp getFivesYearMarriageLine(ApiForm form);
@ApiMethod(name = "获取区域残疾发放统计", service = "PORTAL-SERVER")
ApiResp getAreaDisabledIssueStats(ApiForm form);
@ApiMethod(name = "近五年发放人数和金额统计", service = "PORTAL-SERVER")
ApiResp getYearDisabledIssueStats(ApiForm form);
@ApiMethod(name = "获取在享补贴统计", service = "PORTAL-SERVER")
ApiResp getEnjoySubsidyStats(ApiForm form);
@ApiMethod(name = "获取区域统计列表", service = "PORTAL-SERVER")
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")
ApiResp getAreaUnderNumStats(ApiForm form);
@ApiMethod(name = "获取近五年城市农村低保发放人数统计", service = "PORTAL-SERVER")
ApiResp getFivesYearShjzAchieveStats(ApiForm form);
@ApiMethod(name = "获取近五年城市农村低保发放金额统计", service = "PORTAL-SERVER")
ApiResp getFivesYearShjzProvideStats(ApiForm form);
@ApiMethod(name = "修改登录密码", service = "PORTAL-SERVER")
ApiResp modifyPasswd(ApiForm form);
@ApiMethod(name = "获取App最新版本", service = "PORTAL-SERVER")
ApiResp getAppVersion(ApiForm form);
@ApiMethod(name = "获取子区域列表", service = "PORTAL-SERVER")
ApiResp getChildAreaList(ApiForm form);
@ApiMethod(name = "获取社会机构统计", service = "PORTAL-SERVER")
ApiResp getSoorganStats(ApiForm form);
@ApiMethod(name = "获取地区下面社会机构统计列表", service = "PORTAL-SERVER")
ApiResp getAreaUnderSoorganStatsList(ApiForm form);
@ApiMethod(name = "获取App首页地图数据", service = "PORTAL-SERVER")
ApiResp getAppMapStats(ApiForm form);
@ApiMethod(name = "汇总搜索", service = "PORTAL-SERVER")
ApiResp gatherSearch(ApiForm form);
@ApiMethod(name = "指定区域下的儿童福利数据统计", service = "PORTAL-SERVER")
ApiResp getAgencyChildStats(ApiForm form);
@ApiMethod(name = "指定区域下级区域的儿童福利数据统计列表", service = "PORTAL-SERVER")
ApiResp getAgencyChildStatsList(ApiForm form);
@ApiMethod(name = "火化量统计", service = "PORTAL-SERVER")
ApiResp getCremationStats(ApiForm form);
@ApiMethod(name = "火化量统计列表", service = "PORTAL-SERVER")
ApiResp getCremationStatsList(ApiForm form);
@ApiMethod(name = "殡仪馆火化量统计列表", service = "PORTAL-SERVER")
ApiResp getCremationStatsById(ApiForm form);
/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓SYS单点登录接口↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
@ApiMethod(name = "获取单点登录用户信息", service = "SYS-SERVER")
ApiResp getSsoUserInfo(ApiForm form);
@ApiMethod(name = "单点登出", service = "SYS-SERVER")
ApiResp ssoLogout(ApiForm form);
/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓开放接口↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
@ApiMethod(name = "婚姻搜索接口", service = "OPEN-SERVER")
ApiResp marriageSearch(ApiForm form);
@ApiMethod(name = "自然人搜索接口", service = "OPEN-SERVER")
ApiResp naturalPersonSearch(ApiForm form);
@ApiMethod(name = "火化搜索接口", service = "OPEN-SERVER")
ApiResp cremationSearch(ApiForm form);
}
package com.zq.api.service.impl;
import com.zq.api.feign.OpenFeign;
import com.zq.api.feign.PortalFeign;
import com.zq.api.feign.SysFeign;
import com.zq.api.form.ApiForm;
import com.zq.api.form.ApiResp;
import com.zq.api.service.IApiLogic;
import com.zq.api.utils.ApiUtils;
import com.zq.common.config.security.ApiTokenUtils;
import com.zq.common.vo.ApiTokenVo;
import com.zq.common.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Map;
@Component
public class ApiV100Logic extends BaseApiLogic implements IApiLogic {
@Autowired
private SysFeign sysFeign;
@Autowired
private PortalFeign portalFeign;
@Autowired
private OpenFeign openFeign;
@Override
public ApiResp getUserInfo(ApiForm form) {
return ApiUtils.toApiResp(form, ResultVo.success(ApiTokenUtils.getAppTokenVo(form.getToken())));
}
@Override
public ApiResp sendCode(ApiForm form) {
return ApiUtils.toApiResp(form, sysFeign.sendCode(form.getString("phone")));
}
@Override
public ApiResp resetPassword(ApiForm form) {
return ApiUtils.toApiResp(form, sysFeign.resetPassword(form.getParamsMap()));
}
@Override
public ApiResp phoneLogin(ApiForm form) {
return ApiUtils.toApiResp(form, sysFeign.phoneLogin(form.getParamsMap()));
}
@Override
public ApiResp passwdLogin(ApiForm form) {
return ApiUtils.toApiResp(form, sysFeign.passwdLogin(form.getParamsMap()));
}
@Override
public ApiResp modifyPasswd(ApiForm form) {
return ApiUtils.toApiResp(form, sysFeign.modifyPasswd(form.getParamsMap()));
}
@Override
public ApiResp getAppVersion(ApiForm form) {
return ApiUtils.toApiResp(form, sysFeign.getAppVersion(form.getString("appName")));
}
@Override
public ApiResp getChildAreaList(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getChildAreaList(form.getString("areaCode")));
}
@Override
public ApiResp getMarriageStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getMarriageStats(form.getParamsMap()));
}
@Override
public ApiResp getYearMarriedCouple(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getYearMarriedCouple(form.getParamsMap()));
}
@Override
public ApiResp getAreaUnderMarriageStatsList(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAreaUnderMarriageStatsList(form.getParamsMap()));
}
@Override
public ApiResp getFivesYearMarriageLine(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getFivesYearMarriageLine(form.getParamsMap()));
}
@Override
public ApiResp getAreaDisabledIssueStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAreaDisabledIssueStats(form.getParamsMap()));
}
@Override
public ApiResp getYearDisabledIssueStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getYearDisabledIssueStats(form.getParamsMap()));
}
@Override
public ApiResp getEnjoySubsidyStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getEnjoySubsidyStats(form.getParamsMap()));
}
@Override
public ApiResp getAreaShjzStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAreaShjzStats(form.getParamsMap()));
}
@Override
public ApiResp getAreaUnderNumStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAreaUnderNumStats(form.getParamsMap()));
}
@Override
public ApiResp getFivesYearShjzAchieveStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getFivesYearShjzAchieveStats(form.getParamsMap()));
}
@Override
public ApiResp getFivesYearShjzProvideStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getFivesYearShjzProvideStats(form.getParamsMap()));
}
@Override
public ApiResp getSoorganStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getSoorganStats(form.getParamsMap()));
}
@Override
public ApiResp getAreaUnderSoorganStatsList(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAreaUnderSoorganStatsList(form.getParamsMap()));
}
@Override
public ApiResp getAppMapStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAppMapStats(form.getParamsMap()));
}
@Override
public ApiResp gatherSearch(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.gatherSearch(form.getParamsMap()));
}
@Override
public ApiResp getAgencyChildStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAgencyChildStats(form.getParamsMap()));
}
@Override
public ApiResp getAgencyChildStatsList(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAgencyChildStatsList(form.getParamsMap()));
}
@Override
public ApiResp getCremationStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getCremationStats(form.getParamsMap()));
}
@Override
public ApiResp getCremationStatsList(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getCremationStatsList(form.getParamsMap()));
}
@Override
public ApiResp getCremationStatsById(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getCremationStatsById(form.getParamsMap()));
}
@Override
public ApiResp getSsoUserInfo(ApiForm form) {
return ApiUtils.toApiResp(form, sysFeign.getSsoUserInfo(form.getAppId()));
}
@Override
public ApiResp ssoLogout(ApiForm form) {
return ApiUtils.toApiResp(form, sysFeign.ssoLogout());
}
@Override
public ApiResp marriageSearch(ApiForm form) {
Map<String, Object> paramsMap = form.getParamsMap();
ApiTokenVo apiTokenVo = form.getApiTokenVo();
if (apiTokenVo != null && apiTokenVo.getRoleLevel() == 1) {
paramsMap.put("queryType", 1);
}
return ApiUtils.toApiResp(form, openFeign.marriageSearch(paramsMap));
}
@Override
public ApiResp naturalPersonSearch(ApiForm form) {
return ApiUtils.toApiResp(form, openFeign.naturalPersonSearch(form.getParamsMap()));
}
@Override
public ApiResp cremationSearch(ApiForm form) {
return ApiUtils.toApiResp(form, openFeign.cremationSearch(form.getParamsMap()));
}
}
package com.zq.api.service.impl;
import com.zq.api.feign.OpenFeign;
import com.zq.api.feign.PortalFeign;
import com.zq.api.feign.SysFeign;
import com.zq.api.form.ApiForm;
import com.zq.api.form.ApiResp;
import com.zq.api.service.IApiLogic;
import com.zq.api.utils.ApiUtils;
import com.zq.common.config.security.ApiTokenUtils;
import com.zq.common.vo.ApiTokenVo;
import com.zq.common.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Map;
@Component
public class ApiV100Logic extends BaseApiLogic implements IApiLogic {
@Autowired
private SysFeign sysFeign;
@Autowired
private PortalFeign portalFeign;
@Autowired
private OpenFeign openFeign;
@Override
public ApiResp getUserInfo(ApiForm form) {
return ApiUtils.toApiResp(form, ResultVo.success(ApiTokenUtils.getAppTokenVo(form.getToken())));
}
@Override
public ApiResp sendCode(ApiForm form) {
return ApiUtils.toApiResp(form, sysFeign.sendCode(form.getString("phone")));
}
@Override
public ApiResp resetPassword(ApiForm form) {
return ApiUtils.toApiResp(form, sysFeign.resetPassword(form.getParamsMap()));
}
@Override
public ApiResp phoneLogin(ApiForm form) {
return ApiUtils.toApiResp(form, sysFeign.phoneLogin(form.getParamsMap()));
}
@Override
public ApiResp passwdLogin(ApiForm form) {
return ApiUtils.toApiResp(form, sysFeign.passwdLogin(form.getParamsMap()));
}
@Override
public ApiResp modifyPasswd(ApiForm form) {
return ApiUtils.toApiResp(form, sysFeign.modifyPasswd(form.getParamsMap()));
}
@Override
public ApiResp getAppVersion(ApiForm form) {
return ApiUtils.toApiResp(form, sysFeign.getAppVersion(form.getString("appName")));
}
@Override
public ApiResp getChildAreaList(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getChildAreaList(form.getString("areaCode")));
}
@Override
public ApiResp getMarriageStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getMarriageStats(form.getParamsMap()));
}
@Override
public ApiResp getYearMarriedCouple(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getYearMarriedCouple(form.getParamsMap()));
}
@Override
public ApiResp getAreaUnderMarriageStatsList(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAreaUnderMarriageStatsList(form.getParamsMap()));
}
@Override
public ApiResp getFivesYearMarriageLine(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getFivesYearMarriageLine(form.getParamsMap()));
}
@Override
public ApiResp getAreaDisabledIssueStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAreaDisabledIssueStats(form.getParamsMap()));
}
@Override
public ApiResp getYearDisabledIssueStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getYearDisabledIssueStats(form.getParamsMap()));
}
@Override
public ApiResp getEnjoySubsidyStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getEnjoySubsidyStats(form.getParamsMap()));
}
@Override
public ApiResp getAreaShjzStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAreaShjzStats(form.getParamsMap()));
}
@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) {
return ApiUtils.toApiResp(form, portalFeign.getAreaUnderNumStats(form.getParamsMap()));
}
@Override
public ApiResp getFivesYearShjzAchieveStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getFivesYearShjzAchieveStats(form.getParamsMap()));
}
@Override
public ApiResp getFivesYearShjzProvideStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getFivesYearShjzProvideStats(form.getParamsMap()));
}
@Override
public ApiResp getSoorganStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getSoorganStats(form.getParamsMap()));
}
@Override
public ApiResp getAreaUnderSoorganStatsList(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAreaUnderSoorganStatsList(form.getParamsMap()));
}
@Override
public ApiResp getAppMapStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAppMapStats(form.getParamsMap()));
}
@Override
public ApiResp gatherSearch(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.gatherSearch(form.getParamsMap()));
}
@Override
public ApiResp getAgencyChildStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAgencyChildStats(form.getParamsMap()));
}
@Override
public ApiResp getAgencyChildStatsList(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getAgencyChildStatsList(form.getParamsMap()));
}
@Override
public ApiResp getCremationStats(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getCremationStats(form.getParamsMap()));
}
@Override
public ApiResp getCremationStatsList(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getCremationStatsList(form.getParamsMap()));
}
@Override
public ApiResp getCremationStatsById(ApiForm form) {
return ApiUtils.toApiResp(form, portalFeign.getCremationStatsById(form.getParamsMap()));
}
@Override
public ApiResp getSsoUserInfo(ApiForm form) {
return ApiUtils.toApiResp(form, sysFeign.getSsoUserInfo(form.getAppId()));
}
@Override
public ApiResp ssoLogout(ApiForm form) {
return ApiUtils.toApiResp(form, sysFeign.ssoLogout());
}
@Override
public ApiResp marriageSearch(ApiForm form) {
Map<String, Object> paramsMap = form.getParamsMap();
ApiTokenVo apiTokenVo = form.getApiTokenVo();
if (apiTokenVo != null && apiTokenVo.getRoleLevel() == 1) {
paramsMap.put("queryType", 1);
}
return ApiUtils.toApiResp(form, openFeign.marriageSearch(paramsMap));
}
@Override
public ApiResp naturalPersonSearch(ApiForm form) {
return ApiUtils.toApiResp(form, openFeign.naturalPersonSearch(form.getParamsMap()));
}
@Override
public ApiResp cremationSearch(ApiForm form) {
return ApiUtils.toApiResp(form, openFeign.cremationSearch(form.getParamsMap()));
}
}
......@@ -47,4 +47,10 @@ public class CjStatsController {
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 {
@ApiOperation("获取区域统计列表")
@PostMapping(value = "/getAreaShjzStats")
public ResultVo getAreaShjzStats(@RequestBody StatsReqVo vo) {
// AssertUtils.notNull(vo.getYear(), "年份不能为空");
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 {
List<StatsVo> getAreaSubsidyStats(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;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.zq.common.constant.DBName;
import com.zq.portal.entity.AppData;
import com.zq.portal.vo.SearchReqVo;
import com.zq.portal.vo.StatsReqVo;
import com.zq.portal.vo.StatsVo;
......@@ -79,4 +80,8 @@ public interface ShjzStatsDao {
List<StatsVo> getMonyNumStats(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 {
issueStatsList.sort(Comparator.comparing(StatsVo::getYear));
for (StatsVo difficultStats : issueStatsList) {
numList.add(String.valueOf(difficultStats.getNum()));
amountList.add(difficultStats.getAmount());
amountList.add(difficultStats.getAmount().toString());
}
}
......@@ -229,7 +229,7 @@ public class CjStatsService {
}
areaList.add(area.getName());
severeIssueNumList.add(String.valueOf(severeAreaIssueStat.getNum()));
severeIssueAmountList.add(severeAreaIssueStat.getAmount());
severeIssueAmountList.add(severeAreaIssueStat.getAmount().toString());
vo.setSubAreaCode(severeAreaIssueStat.getCode());
Map<String, Object> data = new HashMap<>();
......@@ -250,7 +250,7 @@ public class CjStatsService {
Optional<Map<String, Object>> oData = areaPeopleNumList.stream().filter(m -> m.get("areaCode").toString().equals(statsVo.getCode())).findFirst();
oData.ifPresent(data -> {
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 issueAmount = new BigDecimal(data.get("issueAmount").toString()).add(new BigDecimal(statsVo.getAmount()));
data.put("issueNum", issueNum);
......@@ -328,4 +328,51 @@ public class CjStatsService {
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 {
Map<String, Object> totalData = new HashMap<>();
for (StatsVo totalStat : stats) {
if ("0".equals(totalStat.getType())) {
totalData.put("villageTotal",totalStat.getNum());//农村低保
if ("农村低保".equals(totalStat.getType())) {
totalData.put("villageTotal",BigDecimal.valueOf(totalStat.getNum()).divide(BigDecimal.valueOf(10000),2,RoundingMode.HALF_UP));//农村低保
} 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 {
List<StatsVo> cityPeopleNumStats = peopleNumStats.stream().filter(statsVo -> "城市低保".equals(statsVo.getType())).collect(Collectors.toList());
cityPeopleNumStats.forEach(statsVo -> {
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());
villagePeopleNumStats.forEach(statsVo -> {
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());
cityMonyStats.forEach(statsVo -> {
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());
villageMonyStats.forEach(statsVo -> {
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<>();
......@@ -741,4 +741,37 @@ public class ShjzStatsService {
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;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zq.portal.dao.CjStatsDao">
<select id="getPeopleAmountStats" resultType="com.zq.portal.vo.StatsVo">
SELECT COUNT(1) 'num', SUM( SUBSIDY_STANDARD_MONEY ) 'amount', `YEAR` 'year'
FROM `cjrjz_application`
WHERE CHECK_STATUS = 1
AND `STATUS` = 0
AND APPROVE_DATE IS NOT NULL
GROUP BY `YEAR`
ORDER BY `YEAR` DESC LIMIT 5
</select>
<select id="getDisabledLevelStats" resultType="com.zq.portal.vo.StatsVo">
SELECT ENSURE_LEVEL_ID 'type', COUNT( 1 ) 'num'
FROM `cjrjz_proposer`
WHERE ENSURE_LEVEL_ID IS NOT NULL
<if test="type != null">
AND ENSURE_LEVEL_ID = #{type}
</if>
<if test="subAreaCode != null and subAreaCode != ''">
AND CARD_CODE LIKE CONCAT(#{subAreaCode}, '%')
</if>
<if test="year != null">
AND LEFT(CREATE_DATE, 4) = #{year}
</if>
GROUP BY ENSURE_LEVEL_ID
</select>
<!--获取近年重度残疾人数-->
<select id="getYearSevereDisabledStats" resultType="com.zq.portal.vo.StatsVo">
SELECT
LEFT ( CREATE_DATE, 4 ) 'year',
COUNT( 1 ) 'num'
FROM
`cjrjz_proposer`
WHERE
ENSURE_LEVEL_ID IS NOT NULL
AND ENSURE_LEVEL_ID IN (1,2)
<if test="subAreaCode != null and subAreaCode != ''">
AND CARD_CODE LIKE CONCAT(#{subAreaCode}, '%')
</if>
<if test="year != null">
AND LEFT(CREATE_DATE, 4) = #{year}
</if>
GROUP BY LEFT ( CREATE_DATE, 4 )
ORDER BY LEFT ( CREATE_DATE, 4 ) DESC
LIMIT #{size}
</select>
<select id="getSeverePeopleNumStats" resultType="com.zq.portal.vo.StatsVo">
SELECT
COUNT( 1 ) 'num'
FROM
`cjrjz_proposer`
WHERE
ENSURE_LEVEL_ID IS NOT NULL
AND ENSURE_LEVEL_ID IN (1,2)
<if test="subAreaCode != null and subAreaCode != ''">
AND CARD_CODE LIKE CONCAT(#{subAreaCode}, '%')
</if>
<if test="year != null">
AND LEFT(CREATE_DATE, 4) = #{year}
</if>
</select>
<select id="getDifficultPeopleNumStats" resultType="com.zq.portal.vo.StatsVo">
SELECT
COUNT( 1 ) 'num'
FROM
`cjrjz_proposer`
WHERE
ENSURE_LEVEL_ID IS NOT NULL
AND ENSURE_LEVEL_ID IN (3,4)
<if test="subAreaCode != null and subAreaCode != ''">
AND CARD_CODE LIKE CONCAT(#{subAreaCode}, '%')
</if>
<if test="year != null">
AND LEFT(CREATE_DATE, 4) = #{year}
</if>
</select>
<select id="getAreaIssueStats" resultType="com.zq.portal.vo.StatsVo">
SELECT LEFT(UNIT_ID, #{size}) 'code', APPLY_TYPE_ID 'type', GRANT_YEAR 'year', COUNT_PEOPLE 'num', SUM_MONEY
'amount'
FROM `statics_grant`
WHERE
# DATE_FORMAT(create_time, '%Y-%m-%d') = (SELECT DATE_FORMAT(create_time, '%Y-%m-%d') FROM statics_grant ORDER BY create_time DESC LIMIT 1)
CHAR_LENGTH (LEFT ( UNIT_ID, #{size} )) = #{size}
<if test="year != null">
AND GRANT_YEAR = #{year}
</if>
<if test="type != null">
AND APPLY_TYPE_ID = #{type}
</if>
<if test="subAreaCode != null and subAreaCode != ''">
AND UNIT_ID LIKE CONCAT(#{subAreaCode}, '%')
</if>
GROUP BY LEFT(UNIT_ID, #{size})
</select>
<select id="getAreaSubsidyStats" resultType="com.zq.portal.vo.StatsVo">
SELECT LEFT(AREACODE, #{size}) 'code', FF_DATE 'month',SUM(FF_ZD_PC ) 'hlnum', SUM(FF_ZD_MC) 'hlamount',SUM(FF_KUN_PC) 'shnum', SUM(FF_KUN_MC) 'shamount'
FROM `ff_data_jm`
WHERE
CHAR_LENGTH (LEFT ( AREACODE, #{size} )) = #{size}
AND FF_DATE = DATE_FORMAT(NOW(),'%Y-%m')
<if test="subAreaCode != null and subAreaCode != ''">
AND AREACODE LIKE CONCAT(#{subAreaCode}, '%')
</if>
GROUP BY LEFT(AREACODE, #{size})
</select>
<select id="getEnjoySumStats" resultType="com.zq.portal.vo.StatsVo">
SELECT SUM(S_PC) 'num' , SUM(S_MC) 'amount'
FROM ff_data_jm
WHERE FF_DATE = DATE_FORMAT(NOW(),'%Y-%m')
</select>
<select id="getYearIssueStats" resultType="com.zq.portal.vo.StatsVo">
SELECT APPLY_TYPE_ID 'type', GRANT_YEAR 'year', SUM( COUNT_PEOPLE ) 'num', SUM( SUM_MONEY ) 'amount'
FROM `statics_grant`
WHERE 1=1
# DATE_FORMAT(create_time, '%Y-%m-%d') = (SELECT DATE_FORMAT(create_time, '%Y-%m-%d') FROM statics_grant
# ORDER BY create_time DESC LIMIT 1)
<if test="subAreaCode != null and subAreaCode != ''">
AND UNIT_ID LIKE CONCAT( #{subAreaCode}, '%' )
</if>
<if test="type != null">
AND APPLY_TYPE_ID = #{type}
</if>
GROUP BY GRANT_YEAR
ORDER BY GRANT_YEAR DESC LIMIT #{size}
</select>
<select id="getYearList" resultType="java.lang.String">
SELECT GRANT_YEAR 'year'
FROM `statics_grant`
GROUP BY GRANT_YEAR
ORDER BY GRANT_YEAR DESC LIMIT 5
</select>
<select id="search" resultType="java.util.Map">
SELECT NAME 'name', CARD_CODE 'idCard',MARRY_TYPE_ID 'marryType', REGISTER_ADDRESS_NAME
'addressName',ENSURE_LEVEL_ID 'levelId', CREATE_DATE 'createTime'
FROM
cjrjz_proposer
WHERE 1=1
<if test="keyword != null and keyword != ''">
AND (NAME =#{keyword} OR CARD_CODE =#{keyword})
</if>
<if test="subAreaCode != null and subAreaCode != ''">
AND CARD_CODE LIKE CONCAT(#{subAreaCode}, '%')
</if>
ORDER BY CREATE_DATE DESC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zq.portal.dao.CjStatsDao">
<select id="getPeopleAmountStats" resultType="com.zq.portal.vo.StatsVo">
SELECT COUNT(1) 'num', SUM( SUBSIDY_STANDARD_MONEY ) 'amount', `YEAR` 'year'
FROM `cjrjz_application`
WHERE CHECK_STATUS = 1
AND `STATUS` = 0
AND APPROVE_DATE IS NOT NULL
GROUP BY `YEAR`
ORDER BY `YEAR` DESC LIMIT 5
</select>
<select id="getDisabledLevelStats" resultType="com.zq.portal.vo.StatsVo">
SELECT ENSURE_LEVEL_ID 'type', COUNT( 1 ) 'num'
FROM `cjrjz_proposer`
WHERE ENSURE_LEVEL_ID IS NOT NULL
<if test="type != null">
AND ENSURE_LEVEL_ID = #{type}
</if>
<if test="subAreaCode != null and subAreaCode != ''">
AND CARD_CODE LIKE CONCAT(#{subAreaCode}, '%')
</if>
<if test="year != null">
AND LEFT(CREATE_DATE, 4) = #{year}
</if>
GROUP BY ENSURE_LEVEL_ID
</select>
<!--获取近年重度残疾人数-->
<select id="getYearSevereDisabledStats" resultType="com.zq.portal.vo.StatsVo">
SELECT
LEFT ( CREATE_DATE, 4 ) 'year',
COUNT( 1 ) 'num'
FROM
`cjrjz_proposer`
WHERE
ENSURE_LEVEL_ID IS NOT NULL
AND ENSURE_LEVEL_ID IN (1,2)
<if test="subAreaCode != null and subAreaCode != ''">
AND CARD_CODE LIKE CONCAT(#{subAreaCode}, '%')
</if>
<if test="year != null">
AND LEFT(CREATE_DATE, 4) = #{year}
</if>
GROUP BY LEFT ( CREATE_DATE, 4 )
ORDER BY LEFT ( CREATE_DATE, 4 ) DESC
LIMIT #{size}
</select>
<select id="getSeverePeopleNumStats" resultType="com.zq.portal.vo.StatsVo">
SELECT
COUNT( 1 ) 'num'
FROM
`cjrjz_proposer`
WHERE
ENSURE_LEVEL_ID IS NOT NULL
AND ENSURE_LEVEL_ID IN (1,2)
<if test="subAreaCode != null and subAreaCode != ''">
AND CARD_CODE LIKE CONCAT(#{subAreaCode}, '%')
</if>
<if test="year != null">
AND LEFT(CREATE_DATE, 4) = #{year}
</if>
</select>
<select id="getDifficultPeopleNumStats" resultType="com.zq.portal.vo.StatsVo">
SELECT
COUNT( 1 ) 'num'
FROM
`cjrjz_proposer`
WHERE
ENSURE_LEVEL_ID IS NOT NULL
AND ENSURE_LEVEL_ID IN (3,4)
<if test="subAreaCode != null and subAreaCode != ''">
AND CARD_CODE LIKE CONCAT(#{subAreaCode}, '%')
</if>
<if test="year != null">
AND LEFT(CREATE_DATE, 4) = #{year}
</if>
</select>
<select id="getAreaIssueStats" resultType="com.zq.portal.vo.StatsVo">
SELECT LEFT(UNIT_ID, #{size}) 'code', APPLY_TYPE_ID 'type', GRANT_YEAR 'year', COUNT_PEOPLE 'num', SUM_MONEY
'amount'
FROM `statics_grant`
WHERE
# DATE_FORMAT(create_time, '%Y-%m-%d') = (SELECT DATE_FORMAT(create_time, '%Y-%m-%d') FROM statics_grant ORDER BY create_time DESC LIMIT 1)
CHAR_LENGTH (LEFT ( UNIT_ID, #{size} )) = #{size}
<if test="year != null">
AND GRANT_YEAR = #{year}
</if>
<if test="type != null">
AND APPLY_TYPE_ID = #{type}
</if>
<if test="subAreaCode != null and subAreaCode != ''">
AND UNIT_ID LIKE CONCAT(#{subAreaCode}, '%')
</if>
GROUP BY LEFT(UNIT_ID, #{size})
</select>
<select id="getAreaSubsidyStats" resultType="com.zq.portal.vo.StatsVo">
SELECT LEFT(AREACODE, #{size}) 'code', FF_DATE 'month',SUM(FF_ZD_PC ) 'hlnum', SUM(FF_ZD_MC) 'hlamount',SUM(FF_KUN_PC) 'shnum', SUM(FF_KUN_MC) 'shamount'
FROM `ff_data_jm`
WHERE
CHAR_LENGTH (LEFT ( AREACODE, #{size} )) = #{size}
AND FF_DATE = DATE_FORMAT(NOW(),'%Y-%m')
<if test="subAreaCode != null and subAreaCode != ''">
AND AREACODE LIKE CONCAT(#{subAreaCode}, '%')
</if>
GROUP BY LEFT(AREACODE, #{size})
</select>
<select id="getEnjoySumStats" resultType="com.zq.portal.vo.StatsVo">
SELECT SUM(S_PC) 'num' , SUM(S_MC) 'amount'
FROM ff_data_jm
WHERE FF_DATE = DATE_FORMAT(NOW(),'%Y-%m')
</select>
<select id="getYearIssueStats" resultType="com.zq.portal.vo.StatsVo">
SELECT APPLY_TYPE_ID 'type', GRANT_YEAR 'year', SUM( COUNT_PEOPLE ) 'num', SUM( SUM_MONEY ) 'amount'
FROM `statics_grant`
WHERE 1=1
# DATE_FORMAT(create_time, '%Y-%m-%d') = (SELECT DATE_FORMAT(create_time, '%Y-%m-%d') FROM statics_grant
# ORDER BY create_time DESC LIMIT 1)
<if test="subAreaCode != null and subAreaCode != ''">
AND UNIT_ID LIKE CONCAT( #{subAreaCode}, '%' )
</if>
<if test="type != null">
AND APPLY_TYPE_ID = #{type}
</if>
GROUP BY GRANT_YEAR
ORDER BY GRANT_YEAR DESC LIMIT #{size}
</select>
<select id="getYearList" resultType="java.lang.String">
SELECT GRANT_YEAR 'year'
FROM `statics_grant`
GROUP BY GRANT_YEAR
ORDER BY GRANT_YEAR DESC LIMIT 5
</select>
<select id="search" resultType="java.util.Map">
SELECT NAME 'name', CARD_CODE 'idCard',MARRY_TYPE_ID 'marryType', REGISTER_ADDRESS_NAME
'addressName',ENSURE_LEVEL_ID 'levelId', CREATE_DATE 'createTime'
FROM
cjrjz_proposer
WHERE 1=1
<if test="keyword != null and keyword != ''">
AND (NAME =#{keyword} OR CARD_CODE =#{keyword})
</if>
<if test="subAreaCode != null and subAreaCode != ''">
AND CARD_CODE LIKE CONCAT(#{subAreaCode}, '%')
</if>
ORDER BY CREATE_DATE DESC
</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>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zq.portal.dao.ShjzStatsDao">
<!-- <select id="search" resultType="java.util.Map">-->
<!-- SELECT AXDF0002 'name', AXDF0004 'mainIdCard', AXDF0011 'phone',AXDF0008 'address', AXAA2701 'unitCode'-->
<!-- ,UPDATETIME 'createTime'-->
<!-- FROM-->
<!-- baf01-->
<!-- WHERE 1 = 1-->
<!-- <choose>-->
<!-- <when test="keyword != null and keyword != ''">-->
<!-- AND (AXDF0002 = #{keyword}-->
<!-- OR AXDF0004 = #{keyword})-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- ORDER BY UPDATETIME DESC LIMIT 20-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- </select>-->
<select id="search" resultType="java.util.Map">
SELECT
REPLACE(address, '广西壮族自治区-', '') 'address',
NAME 'name',
id_card 'idCard',
help_type 'helpType',
help_amount 'helpAmount',
provide_state 'provideState',
start_provide_date 'startProvideDate',
end_provide_date 'endProvideDate'
FROM
`gw_temptable_20210630`
WHERE 1 = 1
<if test="keyword != null and keyword != ''">
AND (NAME = #{keyword}
OR id_card = #{keyword})
</if>
<if test="subAreaCode != null and subAreaCode != ''">
AND id_card LIKE CONCAT(#{subAreaCode},'%')
</if>
ORDER BY start_provide_date DESC
</select>
<select id="getEnjoyNum" resultType="com.zq.portal.vo.StatsVo">
SELECT
( 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
<if test="subAreaCode != null and subAreaCode != ''">
AND h.UNIT_ID LIKE CONCAT(#{subAreaCode}, '%')
</if>
AND DATE_FORMAT( h.PERMIT_DATE, "%Y-%m-%d" ) &lt;= #{date}
AND DATE_FORMAT( h.STOP_DATE, "%Y-%m-%d" ) >= #{date}
GROUP BY
ISCITY
</select>
<select id="getTemporaryNumStats" resultType="com.zq.portal.vo.StatsVo">
SELECT
LEFT(h.UNIT_ID, 4) 'code',
SUM(h.SURE_POPULATION ) 'num'
FROM
tem_home_his h
WHERE
h.VP_STATE = 4
<if test="subAreaCode != null and subAreaCode != ''">
AND h.UNIT_ID LIKE CONCAT(#{subAreaCode}, '%')
</if>
<choose>
<when test="year != null">
AND DATE_FORMAT( h.PERMIT_DATE, "%Y" ) = #{year}
</when>
<otherwise>
AND DATE_FORMAT( h.PERMIT_DATE, "%Y" ) = DATE_FORMAT(NOW(), "%Y" )
</otherwise>
</choose>
</select>
<select id="getBorderNumStats" resultType="com.zq.portal.vo.StatsVo">
SELECT
LEFT(h.UNIT_ID, #{size}) 'code',
sum( h.SURE_POPULATION ) 'num'
FROM
border_region_home h
WHERE h.VP_STATE = 4
AND h.ISCITY = 8
<if test="subAreaCode != null and subAreaCode != ''">
AND h.UNIT_ID LIKE CONCAT(#{subAreaCode}, '%')
</if>
<choose>
<when test="year != null">
AND DATE_FORMAT( h.PERMIT_DATE, "%Y" ) = #{year}
</when>
<otherwise>
AND DATE_FORMAT( h.PERMIT_DATE, "%Y" ) = DATE_FORMAT(NOW(), "%Y" )
</otherwise>
</choose>
</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="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 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 LEFT(date, 4) 'year', type, SUM(num) 'num' FROM ( 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" )
<if test="subAreaCode != null and subAreaCode != ''">
AND h.UNIT_ID LIKE CONCAT(#{subAreaCode}, '%')
</if>
GROUP BY
DATE_FORMAT( h.PERMIT_DATE, "%Y-%m" ),
ISCITY) t
WHERE type IN("城市低保","农村低保")
GROUP BY
LEFT(date, 4),
type
</select>
<select id="getPeopleNumStats" resultType="com.zq.portal.vo.StatsVo">
SELECT
LEFT ( a.area_code, #{size} ) 'code',
a.type 'type',
SUM(a.people_num) 'num'
FROM city_coutry a
WHERE
CHAR_LENGTH (LEFT ( a.area_code, #{size} )) = #{size}
<if test="subAreaCode != null and subAreaCode != ''">
AND a.area_code LIKE CONCAT(#{subAreaCode}, '%')
</if>
<if test="type != null and type != ''">
AND a.type = #{type}
</if>
GROUP BY
LEFT ( a.area_code, #{size} ),
a.type
</select>
<!-- iscity = 1 是城市 0是农村 -->
<select id="getMonyNumStats" resultType="com.zq.portal.vo.StatsVo">
SELECT
LEFT(p.unit_id, #{size}) 'code',
p.iscity 'type',
SUM( p.money ) 'amount'
FROM
mon_pay p
WHERE
p.pay_state = 2
AND p.vp_state = 4
AND DATE_FORMAT( p.pmonth, "%Y-%m-%d" ) >= '2021-12-01'
AND DATE_FORMAT( p.pmonth, "%Y-%m-%d" ) &lt;= '2021-12-01'
AND CHAR_LENGTH (LEFT ( p.unit_id, #{size} )) = #{size}
<if test="subAreaCode != null and subAreaCode != ''">
AND p.unit_id LIKE CONCAT(#{subAreaCode}, '%')
</if>
<if test="type != null and type != ''">
AND p.iscity = #{type}
</if>
GROUP BY
LEFT(p.unit_id, #{size}),
p.iscity
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zq.portal.dao.ShjzStatsDao">
<!-- <select id="search" resultType="java.util.Map">-->
<!-- SELECT AXDF0002 'name', AXDF0004 'mainIdCard', AXDF0011 'phone',AXDF0008 'address', AXAA2701 'unitCode'-->
<!-- ,UPDATETIME 'createTime'-->
<!-- FROM-->
<!-- baf01-->
<!-- WHERE 1 = 1-->
<!-- <choose>-->
<!-- <when test="keyword != null and keyword != ''">-->
<!-- AND (AXDF0002 = #{keyword}-->
<!-- OR AXDF0004 = #{keyword})-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- ORDER BY UPDATETIME DESC LIMIT 20-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- </select>-->
<select id="search" resultType="java.util.Map">
SELECT
REPLACE(address, '广西壮族自治区-', '') 'address',
NAME 'name',
id_card 'idCard',
help_type 'helpType',
help_amount 'helpAmount',
provide_state 'provideState',
start_provide_date 'startProvideDate',
end_provide_date 'endProvideDate'
FROM
`gw_temptable_20210630`
WHERE 1 = 1
<if test="keyword != null and keyword != ''">
AND (NAME = #{keyword}
OR id_card = #{keyword})
</if>
<if test="subAreaCode != null and subAreaCode != ''">
AND id_card LIKE CONCAT(#{subAreaCode},'%')
</if>
ORDER BY start_provide_date DESC
</select>
<select id="getEnjoyNum" resultType="com.zq.portal.vo.StatsVo">
SELECT
( 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
<if test="subAreaCode != null and subAreaCode != ''">
AND h.UNIT_ID LIKE CONCAT(#{subAreaCode}, '%')
</if>
AND DATE_FORMAT( h.PERMIT_DATE, "%Y-%m-%d" ) &lt;= #{date}
AND DATE_FORMAT( h.STOP_DATE, "%Y-%m-%d" ) >= #{date}
GROUP BY
ISCITY
</select>
<select id="getTemporaryNumStats" resultType="com.zq.portal.vo.StatsVo">
SELECT
LEFT(h.UNIT_ID, 4) 'code',
SUM(h.SURE_POPULATION ) 'num'
FROM
tem_home_his h
WHERE
h.VP_STATE = 4
<if test="subAreaCode != null and subAreaCode != ''">
AND h.UNIT_ID LIKE CONCAT(#{subAreaCode}, '%')
</if>
<choose>
<when test="year != null">
AND DATE_FORMAT( h.PERMIT_DATE, "%Y" ) = #{year}
</when>
<otherwise>
AND DATE_FORMAT( h.PERMIT_DATE, "%Y" ) = DATE_FORMAT(NOW(), "%Y" )
</otherwise>
</choose>
</select>
<select id="getBorderNumStats" resultType="com.zq.portal.vo.StatsVo">
SELECT
LEFT(h.UNIT_ID, #{size}) 'code',
sum( h.SURE_POPULATION ) 'num'
FROM
border_region_home h
WHERE h.VP_STATE = 4
AND h.ISCITY = 8
<if test="subAreaCode != null and subAreaCode != ''">
AND h.UNIT_ID LIKE CONCAT(#{subAreaCode}, '%')
</if>
<choose>
<when test="year != null">
AND DATE_FORMAT( h.PERMIT_DATE, "%Y" ) = #{year}
</when>
<otherwise>
AND DATE_FORMAT( h.PERMIT_DATE, "%Y" ) = DATE_FORMAT(NOW(), "%Y" )
</otherwise>
</choose>
</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
LEFT(h.area_code, #{size}) 'code',
h.type,
SUM(h.people_num) 'people_num',
SUM(h.family_num) 'family_num'
FROM
city_coutry h
WHERE
1=1
AND LEFT(h.area_code, #{size}) IS NOT NULL
<if test="subAreaCode != null and subAreaCode != ''">
AND h.area_code LIKE CONCAT(#{subAreaCode}, '%')
</if>
GROUP BY
LEFT(h.area_code, #{size}),
h.type
</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
h.type 'type',
SUM(h.people_num) 'num'
FROM
city_coutry h
WHERE
h.type IN('城市低保','农村低保')
GROUP BY
type
</select>
<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',
( 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" )
<if test="subAreaCode != null and subAreaCode != ''">
AND h.UNIT_ID LIKE CONCAT(#{subAreaCode}, '%')
</if>
GROUP BY
DATE_FORMAT( h.PERMIT_DATE, "%Y-%m" ),
ISCITY) t
WHERE type IN("城市低保","农村低保")
GROUP BY
LEFT(date, 4),
type
</select>
<select id="getPeopleNumStats" resultType="com.zq.portal.vo.StatsVo">
SELECT
LEFT ( a.area_code, #{size} ) 'code',
a.type 'type',
SUM(a.people_num) 'num'
FROM city_coutry a
WHERE
CHAR_LENGTH (LEFT ( a.area_code, #{size} )) = #{size}
<if test="subAreaCode != null and subAreaCode != ''">
AND a.area_code LIKE CONCAT(#{subAreaCode}, '%')
</if>
<if test="type != null and type != ''">
AND a.type = #{type}
</if>
GROUP BY
LEFT ( a.area_code, #{size} ),
a.type
</select>
<!-- iscity = 1 是城市 0是农村 -->
<select id="getMonyNumStats" resultType="com.zq.portal.vo.StatsVo">
SELECT
LEFT(p.unit_id, #{size}) 'code',
p.iscity 'type',
SUM( p.money ) 'amount'
FROM
mon_pay p
WHERE
p.pay_state = 2
AND p.vp_state = 4
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;= 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}
<if test="subAreaCode != null and subAreaCode != ''">
AND p.unit_id LIKE CONCAT(#{subAreaCode}, '%')
</if>
<if test="type != null and type != ''">
AND p.iscity = #{type}
</if>
GROUP BY
LEFT(p.unit_id, #{size}),
p.iscity
</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>
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