Commit 2db0bc54248bb521bdb4f82b82d8c5bcdbcac534

Authored by 陈威
1 parent 8a2eb055
Exists in dev

资金统计列表

zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/controller/McBasicMoneyController.java
... ... @@ -11,7 +11,9 @@ import com.chinagas.common.log.annotation.Log;
11 11 import com.chinagas.common.log.enums.BusinessType;
12 12 import com.chinagas.common.security.annotation.RequirePermission;
13 13 import com.chinagas.common.security.enums.Logical;
  14 +import com.chinagas.modules.schsf.domain.McBasicCmty;
14 15 import com.chinagas.modules.schsf.domain.McBasicMoney;
  16 +import com.chinagas.modules.schsf.domain.vo.McBasicCmtyVo;
15 17 import com.chinagas.modules.schsf.domain.vo.McBasicMoneyVo;
16 18 import com.chinagas.modules.schsf.service.IMcBasicMoneyService;
17 19 import com.chinagas.modules.schsf.utils.listener.McBasicMoneyImportInspection;
... ... @@ -167,4 +169,16 @@ public class McBasicMoneyController extends BaseController {
167 169 response.getWriter().println(JSON.toJSONString(map));
168 170 }
169 171 }
  172 +
  173 +
  174 +
  175 +
  176 + @GetMapping("/summaryList")
  177 + public TableDataInfo summaryList(McBasicMoneyVo mcBasicMoneyVo) {
  178 + startPage();
  179 + mcBasicMoneyVo.setDefFlag("0");
  180 + List<McBasicMoney> list = mcBasicMoneyService.selectMcBasicMoneySummaryList(mcBasicMoneyVo);
  181 + return getDataTable(list);
  182 + }
  183 +
170 184 }
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/mapper/McBasicMoneyMapper.java
... ... @@ -64,4 +64,6 @@ public interface McBasicMoneyMapper
64 64 List<McBasicMoney> selectMcBasicMoneyByData(McBasicMoney mcBasicMoney);
65 65  
66 66  
  67 + List<McBasicMoney> selectMcBasicMoneySummaryList(McBasicMoneyVo mcBasicMoneyVo);
  68 +
67 69 }
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/IMcBasicMoneyService.java
... ... @@ -60,4 +60,8 @@ public interface IMcBasicMoneyService
60 60 * @return 结果
61 61 */
62 62 public int deleteMcBasicMoneyById(Long id);
  63 +
  64 + List<McBasicMoney> selectMcBasicMoneySummaryList(McBasicMoneyVo mcBasicMoneyVo);
  65 +
  66 +
63 67 }
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/McBasicMoneyServiceImpl.java
... ... @@ -3,6 +3,7 @@ package com.chinagas.modules.schsf.service.impl;
3 3 import com.chinagas.common.core.utils.DateUtils;
4 4 import com.chinagas.common.datascope.annotation.DataScope;
5 5 import com.chinagas.common.security.utils.SecurityUtils;
  6 +import com.chinagas.modules.schsf.domain.McBasicCmty;
6 7 import com.chinagas.modules.schsf.domain.McBasicMoney;
7 8 import com.chinagas.modules.schsf.domain.vo.McBasicMoneyVo;
8 9 import com.chinagas.modules.schsf.mapper.McBasicMoneyMapper;
... ... @@ -11,6 +12,7 @@ import com.chinagas.modules.schsf.service.IMcBasicMoneyService;
11 12 import org.springframework.beans.factory.annotation.Autowired;
12 13 import org.springframework.stereotype.Service;
13 14  
  15 +import java.util.Collections;
14 16 import java.util.HashMap;
15 17 import java.util.List;
16 18  
... ... @@ -115,4 +117,9 @@ public class McBasicMoneyServiceImpl implements IMcBasicMoneyService
115 117 {
116 118 return mcBasicMoneyMapper.deleteMcBasicMoneyById(id);
117 119 }
  120 +
  121 + @Override
  122 + public List<McBasicMoney> selectMcBasicMoneySummaryList(McBasicMoneyVo mcBasicMoneyVo) {
  123 + return mcBasicMoneyMapper.selectMcBasicMoneySummaryList(mcBasicMoneyVo);
  124 + }
118 125 }
... ...
zr-cloud/zr-modules/zr-schsf/src/main/resources/mapper/McBasicMoneyMapper.xml
... ... @@ -272,4 +272,125 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
272 272 and t.street = #{street}
273 273 and t.vlg_or_cmty = #{vlgOrCmty}
274 274 </select>
  275 +
  276 + <select id="selectMcBasicMoneySummaryList" parameterType="com.chinagas.modules.schsf.domain.vo.McBasicMoneyVo" resultMap="McBasicMoneyResult">
  277 + SELECT d.id, d.fiscal_year, d.region_name, d.group_name, d.company_name, d.company_code, d.province, d.city, d.district, d.street, d.vlg_or_cmty, d.resp_person, d.urb_rur_cls, d.budg_conf_prev, d.budg_conf_new, d.budg_total, d.quarterly_target, d.cny_gsg_charged, d.cny_gsg_uncharged, d.cny_gsg_total,
  278 + d.cny_yr_full ,d.cny_yr_instal ,d.cny_prev_full ,d.cny_prev_install,
  279 + (d.cny_yr_full+d.cny_yr_instal+d.cny_prev_full+d.cny_prev_install) AS cny_market_cumr,
  280 + (d.cny_yr_full+d.cny_yr_instal+d.cny_prev_full+d.cny_prev_install+ IFNULL(d.cny_gsg_charged,0)) AS cny_fy_cum_return,
  281 + (d.cny_yr_full+d.cny_prev_full) AS cny_fp_cum_return,
  282 + (d.cny_yr_instal+d.cny_prev_install) AS cny_inst_cum_return,
  283 + (d.cny_yr_full+d.cny_yr_instal) AS cny_new_cum_return,
  284 + (d.cny_prev_full+d.cny_prev_install) AS cny_rcvbls_cum_return,
  285 + (d.cny_yr_full+d.cny_yr_instal+d.cny_prev_full+d.cny_prev_install+ IFNULL(d.cny_gsg_charged,0)) / d.budg_total as cny_bdgt_cmpl_rate,
  286 + (d.cny_prev_full+d.cny_prev_install) / IFNULL(d.budg_conf_prev,0) as cny_rcvbls_cmpl_rate,
  287 + (d.cny_yr_full+d.cny_yr_instal) / IFNULL(d.budg_conf_new,0) as cny_cyn_cmpl_rate,
  288 + IFNULL(d.quarterly_target,0) / (d.cny_yr_full+d.cny_yr_instal+d.cny_prev_full+d.cny_prev_install+ IFNULL(d.cny_gsg_charged,0)) as cny_pt_cmpl_rate
  289 + FROM (
  290 + SELECT
  291 + t.update_time,
  292 + t.id,
  293 + t.fiscal_year,
  294 + t.region_name,
  295 + t.group_name,
  296 + t.company_name,
  297 + t.company_code,
  298 + t.province,
  299 + t.city,
  300 + t.district,
  301 + t.street,
  302 + t.vlg_or_cmty,
  303 + t.resp_person,
  304 + t.urb_rur_cls,
  305 + t.budg_conf_prev,
  306 + t.budg_conf_new,
  307 + (IFNULL(t.budg_conf_prev,0) + IFNULL(t.budg_conf_new,0)) AS budg_total,
  308 + t.quarterly_target,
  309 + t.cny_gsg_charged,
  310 + t.cny_gsg_uncharged,
  311 + (IFNULL(t.cny_gsg_charged,0) + IFNULL(t.cny_gsg_uncharged,0)) AS cny_gsg_total,
  312 + (IFNULL(t.cny_yr_full,0) + IFNULL(bnqk.cny_yr_full,0)) AS cny_yr_full,
  313 + (IFNULL(t.cny_yr_instal,0) + IFNULL(bnfq.cny_yr_instal,0)) AS cny_yr_instal,
  314 + (
  315 + SELECT IFNULL(SUM(visit.charge_amt),0) + IFNULL(t.cny_prev_full,0)
  316 + FROM mc_visit visit WHERE visit.charge_type='2' AND visit.is_charged='Y'
  317 + AND visit.company_code=t.company_code AND visit.urb_rur_cls=t.urb_rur_cls
  318 + AND visit.user_province=t.province AND visit.user_city=t.city
  319 + AND visit.user_district=t.district AND visit.user_street=t.street
  320 + AND visit.vlg_or_cmty=t.vlg_or_cmty AND visit.fiscal_year &lt; t.fiscal_year
  321 + ) AS cny_prev_full,
  322 + (
  323 + SELECT IFNULL(SUM(visit.charge_amt),0) + IFNULL(t.cny_prev_install,0)
  324 + FROM mc_visit visit WHERE visit.charge_type in ("1","4") AND visit.is_charged='Y'
  325 + AND visit.company_code=t.company_code AND visit.urb_rur_cls=t.urb_rur_cls
  326 + AND visit.user_province=t.province AND visit.user_city=t.city
  327 + AND visit.user_district=t.district AND visit.user_street=t.street
  328 + AND visit.vlg_or_cmty=t.vlg_or_cmty AND visit.fiscal_year &lt; t.fiscal_year
  329 + ) AS cny_prev_install
  330 + FROM mc_basic_money t
  331 + LEFT JOIN (
  332 + SELECT fiscal_year, company_code, urb_rur_cls,
  333 + user_province, user_city, user_district, user_street, vlg_or_cmty,SUM(charge_amt) AS cny_yr_full
  334 + FROM mc_visit
  335 + WHERE 1=1 AND charge_type='2'
  336 + AND is_charged='Y'
  337 + GROUP BY
  338 + fiscal_year, company_code, urb_rur_cls,
  339 + user_province, user_city, user_district, user_street, vlg_or_cmty
  340 + ) bnqk on bnqk.fiscal_year = t.fiscal_year and bnqk.company_code=t.company_code and bnqk.urb_rur_cls=t.urb_rur_cls
  341 + and bnqk.user_province=t.province and bnqk.user_city=t.city and bnqk.user_district=t.district and bnqk.user_street=t.street and bnqk.vlg_or_cmty=t.vlg_or_cmty
  342 + LEFT JOIN (
  343 + SELECT fiscal_year, company_code, urb_rur_cls,
  344 + user_province, user_city, user_district, user_street, vlg_or_cmty,SUM(charge_amt) AS cny_yr_instal
  345 + FROM mc_visit
  346 + WHERE 1=1 AND charge_type in ("1","4")
  347 + AND is_charged='Y'
  348 + GROUP BY
  349 + fiscal_year, company_code, urb_rur_cls,
  350 + user_province, user_city, user_district, user_street, vlg_or_cmty
  351 + ) bnfq on bnfq.fiscal_year = t.fiscal_year and bnfq.company_code=t.company_code and bnfq.urb_rur_cls=t.urb_rur_cls
  352 + and bnfq.user_province=t.province and bnfq.user_city=t.city and bnfq.user_district=t.district and bnfq.user_street=t.street and bnfq.vlg_or_cmty=t.vlg_or_cmty
  353 + where 1=1
  354 + <if test="fiscalYear != null "> and t.fiscal_year = #{fiscalYear}</if>
  355 + <if test="regionName != null and regionName != ''"> and t.region_name like concat('%', #{regionName}, '%')</if>
  356 + <if test="groupName != null and groupName != ''"> and t.group_name like concat('%', #{groupName}, '%')</if>
  357 + <if test="companyName != null and companyName != ''"> and t.company_name like concat('%', #{companyName}, '%')</if>
  358 + <if test="companyCode != null and companyCode != ''"> and t.company_code = #{companyCode}</if>
  359 + <if test="province != null and province != ''"> and t.province = #{province}</if>
  360 + <if test="city != null and city != ''"> and t.city = #{city}</if>
  361 + <if test="district != null and district != ''"> and t.district = #{district}</if>
  362 + <if test="street != null and street != ''"> and t.street = #{street}</if>
  363 + <if test="vlgOrCmty != null and vlgOrCmty != ''"> and t.vlg_or_cmty = #{vlgOrCmty}</if>
  364 + <if test="respPerson != null and respPerson != ''"> and t.resp_person = #{respPerson}</if>
  365 + <if test="urbRurCls != null and urbRurCls != ''"> and t.urb_rur_cls = #{urbRurCls}</if>
  366 + <if test="budgConfPrev != null "> and t.budg_conf_prev = #{budgConfPrev}</if>
  367 + <if test="budgConfNew != null "> and t.budg_conf_new = #{budgConfNew}</if>
  368 + <if test="budgTotal != null "> and t.budg_total = #{budgTotal}</if>
  369 + <if test="quarterlyTarget != null "> and t.quarterly_target = #{quarterlyTarget}</if>
  370 + <if test="cnyGsgCharged != null "> and t.cny_gsg_charged = #{cnyGsgCharged}</if>
  371 + <if test="cnyGsgUncharged != null "> and t.cny_gsg_uncharged = #{cnyGsgUncharged}</if>
  372 + <if test="cnyGsgTotal != null "> and t.cny_gsg_total = #{cnyGsgTotal}</if>
  373 + <if test="cnyYrFull != null "> and t.cny_yr_full = #{cnyYrFull}</if>
  374 + <if test="cnyYrInstal != null "> and t.cny_yr_instal = #{cnyYrInstal}</if>
  375 + <if test="cnyPrevFull != null "> and t.cny_prev_full = #{cnyPrevFull}</if>
  376 + <if test="cnyPrevInstall != null "> and t.cny_prev_install = #{cnyPrevInstall}</if>
  377 + <if test="cnyMarketCumr != null "> and t.cny_market_cumr = #{cnyMarketCumr}</if>
  378 + <if test="cnyFyCumReturn != null "> and t.cny_fy_cum_return = #{cnyFyCumReturn}</if>
  379 + <if test="cnyFpCumReturn != null "> and t.cny_fp_cum_return = #{cnyFpCumReturn}</if>
  380 + <if test="cnyInstCumReturn != null "> and t.cny_inst_cum_return = #{cnyInstCumReturn}</if>
  381 + <if test="cnyNewCumReturn != null "> and t.cny_new_cum_return = #{cnyNewCumReturn}</if>
  382 + <if test="cnyRcvblsCumReturn != null "> and t.cny_rcvbls_cum_return = #{cnyRcvblsCumReturn}</if>
  383 + <if test="cnyBdgtCmplRate != null "> and t.cny_bdgt_cmpl_rate = #{cnyBdgtCmplRate}</if>
  384 + <if test="cnyRcvblsCmplRate != null "> and t.cny_rcvbls_cmpl_rate = #{cnyRcvblsCmplRate}</if>
  385 + <if test="cnyCynCmplRate != null "> and t.cny_cyn_cmpl_rate = #{cnyCynCmplRate}</if>
  386 + <if test="cnyPtCmplRate != null "> and t.cny_pt_cmpl_rate = #{cnyPtCmplRate}</if>
  387 + <if test="defFlag != null and defFlag != ''"> and t.def_flag = #{defFlag}</if>
  388 + <if test="startFiscalYear != null and startFiscalYear != ''"> and t.fiscal_year &gt;= #{startFiscalYear}</if>
  389 + <if test="finishFiscalYear != null and finishFiscalYear != ''"> and t.fiscal_year &lt;= #{finishFiscalYear}</if>
  390 + <!-- 数据范围过滤 -->
  391 + ${params.dataScope}
  392 + ) d
  393 + order by d.update_time desc
  394 +
  395 + </select>
275 396 </mapper>
... ...