fix 调整统计视图使数据回显正确

This commit is contained in:
lijiarao
2022-09-26 16:22:20 +08:00
parent acc3707f27
commit a8dff572a1
7 changed files with 343 additions and 189 deletions
+19 -1
View File
@@ -24,6 +24,7 @@ select pp.id as projectId,
paidNoTaxAmount, paidNoTaxAmount,
confirmNoTaxAmount, confirmNoTaxAmount,
contactsName, contactsName,
confirmDate,
pp.pack pp.pack
from (SELECT pwgs.id, from (SELECT pwgs.id,
pwg.id as superId, pwg.id as superId,
@@ -48,13 +49,15 @@ from (SELECT pwgs.id,
invoice_no_tax_amount as invoiceNoTaxAmount, invoice_no_tax_amount as invoiceNoTaxAmount,
paid_no_tax_amount as paidNoTaxAmount, paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount, confirm_no_tax_amount as confirmNoTaxAmount,
GROUP_CONCAT(pwgsc.contacts_temporary_name order by pwgsc.contacts_temporary_name) as contactsName, GROUP_CONCAT(DISTINCT pwgsc.contacts_temporary_name order by pwgsc.contacts_temporary_name) as contactsName,
GROUP_CONCAT(DISTINCT DATE_FORMAT(pcpr.payment_date,'%Y-%m')) as confirmDate,
pwgs.create_time as createTime pwgs.create_time as createTime
FROM pay_working_group pwg FROM pay_working_group pwg
right join pay_working_group_subitem pwgs on (pwg.id = pwgs.working_group_id) right join pay_working_group_subitem pwgs on (pwg.id = pwgs.working_group_id)
left JOIN sys_user su on (pwg.principal_id_a = su.id) left JOIN sys_user su on (pwg.principal_id_a = su.id)
left join sys_depart sd on (su.depart_ids = sd.id) left join sys_depart sd on (su.depart_ids = sd.id)
left JOIN pay_working_group_subitem_contacts pwgsc on pwgsc.working_group_sub_id = pwgs.id left JOIN pay_working_group_subitem_contacts pwgsc on pwgsc.working_group_sub_id = pwgs.id
left join pay_confirm_payment_record pcpr on pwgs.id = pcpr.project_id
group by pwgs.id group by pwgs.id
union all union all
SELECT pcp.id, SELECT pcp.id,
@@ -81,10 +84,13 @@ from (SELECT pwgs.id,
paid_no_tax_amount as paidNoTaxAmount, paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount, confirm_no_tax_amount as confirmNoTaxAmount,
contacts_temporary_name as contactsName, contacts_temporary_name as contactsName,
GROUP_CONCAT(DATE_FORMAT(pcpr.payment_date,'%Y-%m')) as confirmDate,
pcp.create_time as createTime pcp.create_time as createTime
FROM pay_common_project pcp FROM pay_common_project pcp
left JOIN sys_user su on (pcp.principal_id = su.id) left JOIN sys_user su on (pcp.principal_id = su.id)
left join sys_depart sd on (su.depart_ids = sd.id) left join sys_depart sd on (su.depart_ids = sd.id)
left join pay_confirm_payment_record pcpr on pcp.id = pcpr.project_id
group by pcp.id
union all union all
SELECT pmps.id, SELECT pmps.id,
pmp.id as superId, pmp.id as superId,
@@ -110,11 +116,14 @@ from (SELECT pwgs.id,
paid_no_tax_amount as paidNoTaxAmount, paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount, confirm_no_tax_amount as confirmNoTaxAmount,
company_contact_name as contactsName, company_contact_name as contactsName,
GROUP_CONCAT(DATE_FORMAT(pcpr.payment_date,'%Y-%m')) as confirmDate,
pmps.create_time as createTime pmps.create_time as createTime
FROM pay_member_project pmp FROM pay_member_project pmp
right join pay_member_project_subitem pmps on (pmp.id = pmps.project_id) right join pay_member_project_subitem pmps on (pmp.id = pmps.project_id)
left JOIN sys_user su on (pmp.director_id = su.id) left JOIN sys_user su on (pmp.director_id = su.id)
left join sys_depart sd on (su.depart_ids = sd.id) left join sys_depart sd on (su.depart_ids = sd.id)
left join pay_confirm_payment_record pcpr on pmps.id = pcpr.project_id
group by pmps.id
union all union all
SELECT pms.id, SELECT pms.id,
pm.id as superId, pm.id as superId,
@@ -140,11 +149,14 @@ from (SELECT pwgs.id,
paid_no_tax_amount as paidNoTaxAmount, paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount, confirm_no_tax_amount as confirmNoTaxAmount,
company_contact_name as contactsName, company_contact_name as contactsName,
GROUP_CONCAT(DATE_FORMAT(pcpr.payment_date,'%Y-%m')) as confirmDate,
pms.create_time as createTime pms.create_time as createTime
FROM pay_meeting pm FROM pay_meeting pm
right join pay_meeting_situation pms on (pm.id = pms.meeting_id) right join pay_meeting_situation pms on (pm.id = pms.meeting_id)
left JOIN sys_user su on (pm.director_id = su.id) left JOIN sys_user su on (pm.director_id = su.id)
left join sys_depart sd on (su.depart_ids = sd.id) left join sys_depart sd on (su.depart_ids = sd.id)
left join pay_confirm_payment_record pcpr on pms.id = pcpr.project_id
group by pms.id
union all union all
SELECT tmps.id, SELECT tmps.id,
tmp.id as superId, tmp.id as superId,
@@ -170,11 +182,14 @@ from (SELECT pwgs.id,
paid_no_tax_amount as paidNoTaxAmount, paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount, confirm_no_tax_amount as confirmNoTaxAmount,
liaison_man as contactsName, liaison_man as contactsName,
GROUP_CONCAT(DATE_FORMAT(pcpr.payment_date,'%Y-%m')) as confirmDate,
tmps.create_time as createTime tmps.create_time as createTime
FROM tb_member_project tmp FROM tb_member_project tmp
left join tb_member_project_subitem tmps on (tmp.id = tmps.project_id) left join tb_member_project_subitem tmps on (tmp.id = tmps.project_id)
left JOIN sys_user su on (tmp.director_id = su.id) left JOIN sys_user su on (tmp.director_id = su.id)
left join sys_depart sd on (su.depart_ids = sd.id) left join sys_depart sd on (su.depart_ids = sd.id)
left join pay_confirm_payment_record pcpr on tmps.id = pcpr.project_id
group by tmps.id
union all union all
SELECT tcp.id, SELECT tcp.id,
tmp.id as superId, tmp.id as superId,
@@ -200,11 +215,14 @@ from (SELECT pwgs.id,
paid_no_tax_amount as paidNoTaxAmount, paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount, confirm_no_tax_amount as confirmNoTaxAmount,
liaison_man as contactsName, liaison_man as contactsName,
GROUP_CONCAT(DATE_FORMAT(pcpr.payment_date,'%Y-%m')) as confirmDate,
tcp.create_time as createTime tcp.create_time as createTime
FROM tb_member_project tmp FROM tb_member_project tmp
left join tb_certificate_payment tcp on (tmp.id = tcp.project_id) left join tb_certificate_payment tcp on (tmp.id = tcp.project_id)
left JOIN sys_user su on (tmp.director_id = su.id) left JOIN sys_user su on (tmp.director_id = su.id)
left join sys_depart sd on (su.depart_ids = sd.id) left join sys_depart sd on (su.depart_ids = sd.id)
left join pay_confirm_payment_record pcpr on tcp.id = pcpr.project_id
group by tcp.id
) pp ) pp
where pp.allMoney is not null where pp.allMoney is not null
and pp.allMoney != 0 and pp.allMoney != 0
@@ -74,7 +74,7 @@ public class IndexController {
List<PieChartVO> pieChartVOS = indexService.totalAmountClassificationStatistics("allMoney", type); List<PieChartVO> pieChartVOS = indexService.totalAmountClassificationStatistics("allMoney", type);
return Result.OK(pieChartVOS); return Result.OK(pieChartVOS);
}else if (Objects.equals(type,2)){ }else if (Objects.equals(type,2)){
List<PieChartVO> pieChartVOS = indexService.totalAmountClassificationStatistics("confirmAmount", type); List<PieChartVO> pieChartVOS = indexService.totalAmountClassificationStatistics("confirmNoTaxAmount", type);
return Result.OK(pieChartVOS); return Result.OK(pieChartVOS);
}else if (Objects.equals(type,3)){ }else if (Objects.equals(type,3)){
List<PieChartVO> pieChartVOS = indexService.totalAmountClassificationStatistics("allMoney", type); List<PieChartVO> pieChartVOS = indexService.totalAmountClassificationStatistics("allMoney", type);
@@ -44,7 +44,7 @@ public class PayConfirmPaymentRecordController extends JeroController<PayConfir
/** /**
* 分页列表查询 * 分页列表查询
*/ */
@ApiOperation(value="-分页列表查询", notes="-分页列表查询") @ApiOperation(value="确认来款-分页列表查询", notes="确认来款-分页列表查询")
@GetMapping(value = "/page") @GetMapping(value = "/page")
public Result<?> queryPageList(PayConfirmPaymentRecord payConfirmPaymentRecord, public Result<?> queryPageList(PayConfirmPaymentRecord payConfirmPaymentRecord,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@@ -59,7 +59,7 @@ public class PayConfirmPaymentRecordController extends JeroController<PayConfir
* 列表查询 * 列表查询
*/ */
@RequiresPermissions("incomePaymentAndInvoiving:confirmPayment") @RequiresPermissions("incomePaymentAndInvoiving:confirmPayment")
@ApiOperation(value="-列表查询", notes="-列表查询") @ApiOperation(value="确认来款-列表查询", notes="确认来款-列表查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result<List<PayConfirmPaymentRecord>> queryList(PayConfirmPaymentRecord payConfirmPaymentRecord, public Result<List<PayConfirmPaymentRecord>> queryList(PayConfirmPaymentRecord payConfirmPaymentRecord,
HttpServletRequest req) { HttpServletRequest req) {
@@ -72,8 +72,8 @@ public class PayConfirmPaymentRecordController extends JeroController<PayConfir
* 添加 * 添加
*/ */
@RequiresPermissions("incomePaymentAndInvoiving:confirmPayment") @RequiresPermissions("incomePaymentAndInvoiving:confirmPayment")
@AutoLog(value = "-添加") @AutoLog(value = "确认来款-添加")
@ApiOperation(value="-添加", notes="-添加") @ApiOperation(value="确认来款-添加", notes="确认来款-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody PayConfirmPaymentRecord payConfirmPaymentRecord) { public Result<?> add(@Validated @RequestBody PayConfirmPaymentRecord payConfirmPaymentRecord) {
payConfirmPaymentRecordService.add(payConfirmPaymentRecord); payConfirmPaymentRecordService.add(payConfirmPaymentRecord);
@@ -84,8 +84,8 @@ public class PayConfirmPaymentRecordController extends JeroController<PayConfir
* 编辑 * 编辑
*/ */
@RequiresPermissions("incomePaymentAndInvoiving:confirmPayment") @RequiresPermissions("incomePaymentAndInvoiving:confirmPayment")
@AutoLog(value = "-编辑") @AutoLog(value = "确认来款-编辑")
@ApiOperation(value="-编辑", notes="-编辑") @ApiOperation(value="确认来款-编辑", notes="确认来款-编辑")
@PostMapping(value = "/edit") @PostMapping(value = "/edit")
public Result<?> edit(@Validated @RequestBody PayConfirmPaymentRecord payConfirmPaymentRecord) { public Result<?> edit(@Validated @RequestBody PayConfirmPaymentRecord payConfirmPaymentRecord) {
payConfirmPaymentRecordService.editById(payConfirmPaymentRecord); payConfirmPaymentRecordService.editById(payConfirmPaymentRecord);
@@ -95,8 +95,8 @@ public class PayConfirmPaymentRecordController extends JeroController<PayConfir
/** /**
* 通过id删除 * 通过id删除
*/ */
@AutoLog(value = "-通过id删除") @AutoLog(value = "确认来款-通过id删除")
@ApiOperation(value="-通过id删除", notes="-通过id删除") @ApiOperation(value="确认来款-通过id删除", notes="确认来款-通过id删除")
@GetMapping(value = "/delete") @GetMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id") String id) { public Result<?> delete(@RequestParam(name="id") String id) {
payConfirmPaymentRecordService.deleteById(id); payConfirmPaymentRecordService.deleteById(id);
@@ -106,8 +106,8 @@ public class PayConfirmPaymentRecordController extends JeroController<PayConfir
/** /**
* 批量删除 * 批量删除
*/ */
@AutoLog(value = "-批量删除") @AutoLog(value = "确认来款-批量删除")
@ApiOperation(value="-批量删除", notes="-批量删除") @ApiOperation(value="确认来款-批量删除", notes="确认来款-批量删除")
@GetMapping(value = "/deleteBatch") @GetMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids") String ids) { public Result<?> deleteBatch(@RequestParam(name="ids") String ids) {
this.payConfirmPaymentRecordService.deleteByIds(Arrays.asList(ids.split(","))); this.payConfirmPaymentRecordService.deleteByIds(Arrays.asList(ids.split(",")));
@@ -117,7 +117,7 @@ public class PayConfirmPaymentRecordController extends JeroController<PayConfir
/** /**
* 更新所有 * 更新所有
*/ */
@ApiOperation(value="-更新所有") @ApiOperation(value="确认来款-更新所有")
@GetMapping(value = "/editAll") @GetMapping(value = "/editAll")
public Result<?> editAll() { public Result<?> editAll() {
payConfirmPaymentRecordService.editAll(); payConfirmPaymentRecordService.editAll();
@@ -127,7 +127,7 @@ public class PayConfirmPaymentRecordController extends JeroController<PayConfir
/** /**
* 更新所有确认收入状态 * 更新所有确认收入状态
*/ */
@ApiOperation(value="-更新所有确认收入状态") @ApiOperation(value="确认来款-更新所有确认收入状态")
@GetMapping(value = "/updateAffirmIncome") @GetMapping(value = "/updateAffirmIncome")
public Result<?> updateAffirmIncome() { public Result<?> updateAffirmIncome() {
payConfirmPaymentRecordService.updateAffirmIncome(); payConfirmPaymentRecordService.updateAffirmIncome();
@@ -137,7 +137,7 @@ public class PayConfirmPaymentRecordController extends JeroController<PayConfir
/** /**
* 导出excel * 导出excel
*/ */
@ApiOperation(value="-导出excel") @ApiOperation(value="确认来款-导出excel")
@GetMapping(value = "/exportXls") @GetMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, PayConfirmPaymentRecord payConfirmPaymentRecord) { public ModelAndView exportXls(HttpServletRequest request, PayConfirmPaymentRecord payConfirmPaymentRecord) {
return super.exportXls(request, payConfirmPaymentRecord, PayConfirmPaymentRecord.class, ""); return super.exportXls(request, payConfirmPaymentRecord, PayConfirmPaymentRecord.class, "");
@@ -146,7 +146,7 @@ public class PayConfirmPaymentRecordController extends JeroController<PayConfir
/** /**
* 通过excel导入数据 * 通过excel导入数据
*/ */
@ApiOperation(value="-通过excel导入数据") @ApiOperation(value="确认来款-通过excel导入数据")
@PostMapping(value = "/importExcel") @PostMapping(value = "/importExcel")
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, PayConfirmPaymentRecord.class); return super.importExcel(request, response, PayConfirmPaymentRecord.class);
@@ -220,19 +220,28 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
AllMoney queryPageListDepartment33(@Param("departStatisticsSearch") DepartStatisticsSearch departStatisticsSearch, @Param("idList") List<String> idList); AllMoney queryPageListDepartment33(@Param("departStatisticsSearch") DepartStatisticsSearch departStatisticsSearch, @Param("idList") List<String> idList);
List<AllProjectStatistics> queryListAllProjectMoney(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch, @Param("idList") List<String> idList);
List<AllProjectStatistics> queryListAllMoney(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch); List<AllProjectStatistics> queryListAllMoney(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch);
AllMoney queryAllMoney33(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch); AllMoney queryAllMoney33(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch);
List<AllProjectStatistics> cumulativeListAllProjectMoney(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch);
List<AllProjectStatistics> cumulativeListAllMoney(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch); List<AllProjectStatistics> cumulativeListAllMoney();
List<AmountClassDTO> amountClass(@Param("year") String year, @Param("column") String column); List<AmountClassDTO> amountClass(@Param("year") String year, @Param("column") String column);
List<AmountClassDTO> amountClass1(@Param("year") String year, @Param("column") String column); List<AmountClassDTO> amountClass1(@Param("year") String year, @Param("column") String column);
List<YearMoneyDTO> getYearMoneyDTO(); List<YearMoneyDTO> getYearMoneyDTO();
List<AllProjectStatistics> queryListConfirmAmount(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch);
List<AllProjectStatistics> queryListBillMoney(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch);
List<AllProjectStatistics> queryListComeAllMoney(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch);
List<AllProjectStatistics> cumulativeListConfirmAmount();
List<AllProjectStatistics> cumulativeListBillMoney();
List<AllProjectStatistics> cumulativeListComeAllMoney();
} }
@@ -145,7 +145,7 @@
sum(confirmAmount) as confirmAmount1 sum(confirmAmount) as confirmAmount1
from from
v_statistical v v_statistical v
left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id) <!-- left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)-->
<where> <where>
type = 2 type = 2
<if test="ids != null and ids != ''"> <if test="ids != null and ids != ''">
@@ -161,12 +161,14 @@
AND year LIKE AND year LIKE
concat(#{payWorkingGroupSearch.year},'%') concat(#{payWorkingGroupSearch.year},'%')
</if> </if>
<if test="payWorkingGroupSearch.paymentYear != null and payWorkingGroupSearch.paymentYear != ''"> <choose>
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{payWorkingGroupSearch.paymentYear}, '%') <when test="payWorkingGroupSearch.paymentMonth != null and payWorkingGroupSearch.paymentMonth != ''">
<if test="payWorkingGroupSearch.paymentMonth != null and payWorkingGroupSearch.paymentMonth != ''"> and confirmDate like concat('%',#{payWorkingGroupSearch.paymentYear},'-',#{payWorkingGroupSearch.paymentMonth},'%')
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{payWorkingGroupSearch.paymentMonth}, '%') </when>
</if> <when test="payWorkingGroupSearch.paymentYear != null and payWorkingGroupSearch.paymentYear != ''">
</if> and confirmDate like concat('%',#{payWorkingGroupSearch.paymentYear},'%')
</when>
</choose>
<choose> <choose>
<when test="payWorkingGroupSearch.allMoney != null and payWorkingGroupSearch.allMoney != '' and payWorkingGroupSearch.allMoneyTwo != null and payWorkingGroupSearch.allMoneyTwo != ''"> <when test="payWorkingGroupSearch.allMoney != null and payWorkingGroupSearch.allMoney != '' and payWorkingGroupSearch.allMoneyTwo != null and payWorkingGroupSearch.allMoneyTwo != ''">
AND if(allMoney IS NULL OR allMoney = '', 0, allMoney ) >= #{payWorkingGroupSearch.allMoney} and AND if(allMoney IS NULL OR allMoney = '', 0, allMoney ) >= #{payWorkingGroupSearch.allMoney} and
@@ -230,7 +232,7 @@
sum(invoiceNoTaxAmount) as billMoney, sum(invoiceNoTaxAmount) as billMoney,
sum(confirmNoTaxAmount) as confirmAmount sum(confirmNoTaxAmount) as confirmAmount
from v_statistical v from v_statistical v
left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id) <!-- left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)-->
<where> <where>
type = 2 type = 2
<if test="ids != null and ids != ''"> <if test="ids != null and ids != ''">
@@ -246,12 +248,14 @@
AND year LIKE AND year LIKE
concat(#{payWorkingGroupSearch.year}, '%') concat(#{payWorkingGroupSearch.year}, '%')
</if> </if>
<if test="payWorkingGroupSearch.paymentYear != null and payWorkingGroupSearch.paymentYear != ''"> <choose>
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{payWorkingGroupSearch.paymentYear}, '%') <when test="payWorkingGroupSearch.paymentMonth != null and payWorkingGroupSearch.paymentMonth != ''">
<if test="payWorkingGroupSearch.paymentMonth != null and payWorkingGroupSearch.paymentMonth != ''"> and confirmDate like concat('%',#{payWorkingGroupSearch.paymentYear},'-',#{payWorkingGroupSearch.paymentMonth},'%')
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{payWorkingGroupSearch.paymentMonth}, '%') </when>
</if> <when test="payWorkingGroupSearch.paymentYear != null and payWorkingGroupSearch.paymentYear != ''">
</if> and confirmDate like concat('%',#{payWorkingGroupSearch.paymentYear},'%')
</when>
</choose>
<choose> <choose>
<when test="payWorkingGroupSearch.allMoney != null and payWorkingGroupSearch.allMoney != '' and payWorkingGroupSearch.allMoneyTwo != null and payWorkingGroupSearch.allMoneyTwo != ''"> <when test="payWorkingGroupSearch.allMoney != null and payWorkingGroupSearch.allMoney != '' and payWorkingGroupSearch.allMoneyTwo != null and payWorkingGroupSearch.allMoneyTwo != ''">
AND if(allMoney IS NULL OR allMoney = '', 0, allMoney) >= #{payWorkingGroupSearch.allMoney} AND if(allMoney IS NULL OR allMoney = '', 0, allMoney) >= #{payWorkingGroupSearch.allMoney}
@@ -381,7 +385,7 @@
invoiceNoTaxAmount as billMoney, invoiceNoTaxAmount as billMoney,
confirmNoTaxAmount as confirmAmount confirmNoTaxAmount as confirmAmount
from v_statistical v from v_statistical v
left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id) <!-- left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)-->
<where> <where>
<if test="idList != null and idList != ''"> <if test="idList != null and idList != ''">
principalNameId in principalNameId in
@@ -432,12 +436,14 @@
</if> </if>
</otherwise> </otherwise>
</choose> </choose>
<if test="allProjectStatisticsSearch.paymentYear != null and allProjectStatisticsSearch.paymentYear != ''"> <choose>
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{allProjectStatisticsSearch.paymentYear}, '%') <when test="allProjectStatisticsSearch.paymentMonth != null and allProjectStatisticsSearch.paymentMonth != ''">
<if test="allProjectStatisticsSearch.paymentMonth != null and allProjectStatisticsSearch.paymentMonth != ''"> and confirmDate like concat('%',#{allProjectStatisticsSearch.paymentYear},'-',#{allProjectStatisticsSearch.paymentMonth},'%')
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{allProjectStatisticsSearch.paymentMonth}, '%') </when>
</if> <when test="allProjectStatisticsSearch.paymentYear != null and allProjectStatisticsSearch.paymentYear != ''">
</if> and confirmDate like concat('%',#{allProjectStatisticsSearch.paymentYear},'%')
</when>
</choose>
<if test="allProjectStatisticsSearch.companyContactName != null and allProjectStatisticsSearch.companyContactName != ''"> <if test="allProjectStatisticsSearch.companyContactName != null and allProjectStatisticsSearch.companyContactName != ''">
and contactsName like concat('%', #{allProjectStatisticsSearch.companyContactName}, '%') and contactsName like concat('%', #{allProjectStatisticsSearch.companyContactName}, '%')
</if> </if>
@@ -478,7 +484,7 @@
sum(invoiceNoTaxAmount) as billMoney, sum(invoiceNoTaxAmount) as billMoney,
sum(confirmNoTaxAmount) as confirmAmount sum(confirmNoTaxAmount) as confirmAmount
from v_statistical v from v_statistical v
left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id) <!-- left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)-->
<where> <where>
<if test="idList != null and idList != ''"> <if test="idList != null and idList != ''">
principalNameId in principalNameId in
@@ -530,12 +536,14 @@
</if> </if>
</otherwise> </otherwise>
</choose> </choose>
<if test="allProjectStatisticsSearch.paymentYear != null and allProjectStatisticsSearch.paymentYear != ''"> <choose>
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{allProjectStatisticsSearch.paymentYear}, '%') <when test="allProjectStatisticsSearch.paymentMonth != null and allProjectStatisticsSearch.paymentMonth != ''">
<if test="allProjectStatisticsSearch.paymentMonth != null and allProjectStatisticsSearch.paymentMonth != ''"> and confirmDate like concat('%',#{allProjectStatisticsSearch.paymentYear},'-',#{allProjectStatisticsSearch.paymentMonth},'%')
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{allProjectStatisticsSearch.paymentMonth}, '%') </when>
</if> <when test="allProjectStatisticsSearch.paymentYear != null and allProjectStatisticsSearch.paymentYear != ''">
</if> and confirmDate like concat('%',#{allProjectStatisticsSearch.paymentYear},'%')
</when>
</choose>
<if test="allProjectStatisticsSearch.companyContactName != null and allProjectStatisticsSearch.companyContactName != ''"> <if test="allProjectStatisticsSearch.companyContactName != null and allProjectStatisticsSearch.companyContactName != ''">
and contactsName like concat('%', #{allProjectStatisticsSearch.companyContactName}, '%') and contactsName like concat('%', #{allProjectStatisticsSearch.companyContactName}, '%')
</if> </if>
@@ -1103,7 +1111,7 @@
sum(confirmNoTaxAmount) as confirmAmount, sum(confirmNoTaxAmount) as confirmAmount,
sum(confirmAmount) as confirmAmount1 sum(confirmAmount) as confirmAmount1
from v_statistical v from v_statistical v
left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id) <!-- left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)-->
<where> <where>
<if test="idList != null and idList != ''"> <if test="idList != null and idList != ''">
principalNameId in principalNameId in
@@ -1122,12 +1130,14 @@
AND departCode = #{principalPeopleSearch.departCode} AND departCode = #{principalPeopleSearch.departCode}
</if> </if>
</where> </where>
<if test="principalPeopleSearch.paymentYear != null and principalPeopleSearch.paymentYear != ''"> <choose>
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{principalPeopleSearch.paymentYear}, '%') <when test="principalPeopleSearch.paymentMonth != null and principalPeopleSearch.paymentMonth != ''">
<if test="principalPeopleSearch.paymentMonth != null and principalPeopleSearch.paymentMonth != ''"> and confirmDate like concat('%',#{principalPeopleSearch.paymentYear},'-',#{principalPeopleSearch.paymentMonth},'%')
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{principalPeopleSearch.paymentMonth}, '%') </when>
</if> <when test="principalPeopleSearch.paymentYear != null and principalPeopleSearch.paymentYear != ''">
</if> and confirmDate like concat('%',#{principalPeopleSearch.paymentYear},'%')
</when>
</choose>
group by principalId ) ppp group by principalId ) ppp
<where> <where>
<choose> <choose>
@@ -1187,7 +1197,7 @@
sum(invoiceNoTaxAmount) as billMoney, sum(invoiceNoTaxAmount) as billMoney,
sum(confirmNoTaxAmount) as confirmAmount sum(confirmNoTaxAmount) as confirmAmount
from v_statistical v from v_statistical v
left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id) <!-- left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)-->
<where> <where>
<if test="idList != null and idList != ''"> <if test="idList != null and idList != ''">
principalNameId in principalNameId in
@@ -1206,12 +1216,14 @@
AND departCode = #{principalPeopleSearch.departCode} AND departCode = #{principalPeopleSearch.departCode}
</if> </if>
</where> </where>
<if test="principalPeopleSearch.paymentYear != null and principalPeopleSearch.paymentYear != ''"> <choose>
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{principalPeopleSearch.paymentYear}, '%') <when test="principalPeopleSearch.paymentMonth != null and principalPeopleSearch.paymentMonth != ''">
<if test="principalPeopleSearch.paymentMonth != null and principalPeopleSearch.paymentMonth != ''"> and confirmDate like concat('%',#{principalPeopleSearch.paymentYear},'-',#{principalPeopleSearch.paymentMonth},'%')
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{principalPeopleSearch.paymentMonth}, '%') </when>
</if> <when test="principalPeopleSearch.paymentYear != null and principalPeopleSearch.paymentYear != ''">
</if> and confirmDate like concat('%',#{principalPeopleSearch.paymentYear},'%')
</when>
</choose>
group by principalId ) ppp group by principalId ) ppp
<where> <where>
<choose> <choose>
@@ -1362,7 +1374,7 @@
invoiceNoTaxAmount as billMoney, invoiceNoTaxAmount as billMoney,
confirmNoTaxAmount as confirmAmount confirmNoTaxAmount as confirmAmount
from v_statistical v from v_statistical v
left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id) <!-- left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)-->
<where> <where>
principalNameId = #{principalPeopleDetailSearch.principalNameId} principalNameId = #{principalPeopleDetailSearch.principalNameId}
<if test="principalPeopleDetailSearch.projectName != null and principalPeopleDetailSearch.projectName != ''"> <if test="principalPeopleDetailSearch.projectName != null and principalPeopleDetailSearch.projectName != ''">
@@ -1394,12 +1406,14 @@
</if> </if>
</otherwise> </otherwise>
</choose> </choose>
<if test="principalPeopleDetailSearch.paymentYear != null and principalPeopleDetailSearch.paymentYear != ''"> <choose>
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{principalPeopleDetailSearch.paymentYear}, '%') <when test="principalPeopleDetailSearch.paymentMonth != null and principalPeopleDetailSearch.paymentMonth != ''">
<if test="principalPeopleDetailSearch.paymentMonth != null and principalPeopleDetailSearch.paymentMonth != ''"> and confirmDate like concat('%',#{principalPeopleDetailSearch.paymentYear},'-',#{principalPeopleDetailSearch.paymentMonth},'%')
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{principalPeopleDetailSearch.paymentMonth}, '%') </when>
</if> <when test="principalPeopleDetailSearch.paymentYear != null and principalPeopleDetailSearch.paymentYear != ''">
</if> and confirmDate like concat('%',#{principalPeopleDetailSearch.paymentYear},'%')
</when>
</choose>
</where> </where>
</select> </select>
<!-- 个人来款详情总金额--> <!-- 个人来款详情总金额-->
@@ -1420,7 +1434,7 @@
invoiceNoTaxAmount as billMoney, invoiceNoTaxAmount as billMoney,
confirmNoTaxAmount as confirmAmount confirmNoTaxAmount as confirmAmount
from v_statistical v from v_statistical v
left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id) <!-- left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)-->
<where> <where>
principalNameId = #{principalPeopleDetailSearch.principalNameId} principalNameId = #{principalPeopleDetailSearch.principalNameId}
<if test="principalPeopleDetailSearch.projectName != null and principalPeopleDetailSearch.projectName != ''"> <if test="principalPeopleDetailSearch.projectName != null and principalPeopleDetailSearch.projectName != ''">
@@ -1452,12 +1466,14 @@
</if> </if>
</otherwise> </otherwise>
</choose> </choose>
<if test="principalPeopleDetailSearch.paymentYear != null and principalPeopleDetailSearch.paymentYear != ''"> <choose>
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{principalPeopleDetailSearch.paymentYear}, '%') <when test="principalPeopleDetailSearch.paymentMonth != null and principalPeopleDetailSearch.paymentMonth != ''">
<if test="principalPeopleDetailSearch.paymentMonth != null and principalPeopleDetailSearch.paymentMonth != ''"> and confirmDate like concat('%',#{principalPeopleDetailSearch.paymentYear},'-',#{principalPeopleDetailSearch.paymentMonth},'%')
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{principalPeopleDetailSearch.paymentMonth}, '%') </when>
</if> <when test="principalPeopleDetailSearch.paymentYear != null and principalPeopleDetailSearch.paymentYear != ''">
</if> and confirmDate like concat('%',#{principalPeopleDetailSearch.paymentYear},'%')
</when>
</choose>
</where> </where>
) pp ) pp
</select> </select>
@@ -1748,7 +1764,7 @@
sum(confirmNoTaxAmount) as confirmAmount, sum(confirmNoTaxAmount) as confirmAmount,
sum(confirmAmount) as confirmAmount1 sum(confirmAmount) as confirmAmount1
from v_statistical v from v_statistical v
left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id) <!-- left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)-->
<where> <where>
<if test="idList != null and idList != ''"> <if test="idList != null and idList != ''">
principalNameId in principalNameId in
@@ -1763,12 +1779,14 @@
<if test="companyComeMoneySearch.chargeCompanyId != null and companyComeMoneySearch.chargeCompanyId != ''"> <if test="companyComeMoneySearch.chargeCompanyId != null and companyComeMoneySearch.chargeCompanyId != ''">
AND chargeCompanyId = #{companyComeMoneySearch.chargeCompanyId} AND chargeCompanyId = #{companyComeMoneySearch.chargeCompanyId}
</if> </if>
<if test="companyComeMoneySearch.paymentYear != null and companyComeMoneySearch.paymentYear != ''"> <choose>
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{companyComeMoneySearch.paymentYear}, '%') <when test="companyComeMoneySearch.paymentMonth != null and companyComeMoneySearch.paymentMonth != ''">
<if test="companyComeMoneySearch.paymentMonth != null and companyComeMoneySearch.paymentMonth != ''"> and confirmDate like concat('%',#{companyComeMoneySearch.paymentYear},'-',#{companyComeMoneySearch.paymentMonth},'%')
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{companyComeMoneySearch.paymentMonth}, '%') </when>
</if> <when test="companyComeMoneySearch.paymentYear != null and companyComeMoneySearch.paymentYear != ''">
</if> and confirmDate like concat('%',#{companyComeMoneySearch.paymentYear},'%')
</when>
</choose>
</where> </where>
group by chargeCompanyId group by chargeCompanyId
) ppp ) ppp
@@ -1831,7 +1849,7 @@
sum(invoiceNoTaxAmount) as billMoney, sum(invoiceNoTaxAmount) as billMoney,
sum(confirmNoTaxAmount) as confirmAmount sum(confirmNoTaxAmount) as confirmAmount
from v_statistical v from v_statistical v
left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id) <!-- left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)-->
<where> <where>
<if test="idList != null and idList != ''"> <if test="idList != null and idList != ''">
principalNameId in principalNameId in
@@ -1846,12 +1864,14 @@
<if test="companyComeMoneySearch.chargeCompanyId != null and companyComeMoneySearch.chargeCompanyId != ''"> <if test="companyComeMoneySearch.chargeCompanyId != null and companyComeMoneySearch.chargeCompanyId != ''">
AND chargeCompanyId = #{companyComeMoneySearch.chargeCompanyId} AND chargeCompanyId = #{companyComeMoneySearch.chargeCompanyId}
</if> </if>
<if test="companyComeMoneySearch.paymentYear != null and companyComeMoneySearch.paymentYear != ''"> <choose>
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{companyComeMoneySearch.paymentYear}, '%') <when test="companyComeMoneySearch.paymentMonth != null and companyComeMoneySearch.paymentMonth != ''">
<if test="companyComeMoneySearch.paymentMonth != null and companyComeMoneySearch.paymentMonth != ''"> and confirmDate like concat('%',#{companyComeMoneySearch.paymentYear},'-',#{companyComeMoneySearch.paymentMonth},'%')
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{companyComeMoneySearch.paymentMonth}, '%') </when>
</if> <when test="companyComeMoneySearch.paymentYear != null and companyComeMoneySearch.paymentYear != ''">
</if> and confirmDate like concat('%',#{companyComeMoneySearch.paymentYear},'%')
</when>
</choose>
</where> </where>
group by chargeCompanyId group by chargeCompanyId
) ppp ) ppp
@@ -1993,7 +2013,7 @@
invoiceNoTaxAmount as billMoney, invoiceNoTaxAmount as billMoney,
confirmNoTaxAmount as confirmAmount confirmNoTaxAmount as confirmAmount
from v_statistical v from v_statistical v
left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id) <!-- left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)-->
<where> <where>
chargeCompanyId = #{CompanyComeMoneyDetailSearch.chargeCompanyId} chargeCompanyId = #{CompanyComeMoneyDetailSearch.chargeCompanyId}
<if test="idList != null and idList != ''"> <if test="idList != null and idList != ''">
@@ -2033,12 +2053,14 @@
</if> </if>
</otherwise> </otherwise>
</choose> </choose>
<if test="CompanyComeMoneyDetailSearch.paymentYear != null and CompanyComeMoneyDetailSearch.paymentYear != ''"> <choose>
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{CompanyComeMoneyDetailSearch.paymentYear}, '%') <when test="CompanyComeMoneyDetailSearch.paymentMonth != null and CompanyComeMoneyDetailSearch.paymentMonth != ''">
<if test="CompanyComeMoneyDetailSearch.paymentMonth != null and CompanyComeMoneyDetailSearch.paymentMonth != ''"> and confirmDate like concat('%',#{CompanyComeMoneyDetailSearch.paymentYear},'-',#{CompanyComeMoneyDetailSearch.paymentMonth},'%')
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{CompanyComeMoneyDetailSearch.paymentMonth}, '%') </when>
</if> <when test="CompanyComeMoneyDetailSearch.paymentYear != null and CompanyComeMoneyDetailSearch.paymentYear != ''">
</if> and confirmDate like concat('%',#{CompanyComeMoneyDetailSearch.paymentYear},'%')
</when>
</choose>
</where> </where>
) p ) p
<if test="CompanyComeMoneyDetailSearch.column != null and CompanyComeMoneyDetailSearch.column != ''"> <if test="CompanyComeMoneyDetailSearch.column != null and CompanyComeMoneyDetailSearch.column != ''">
@@ -2084,7 +2106,7 @@
invoiceNoTaxAmount as billMoney, invoiceNoTaxAmount as billMoney,
confirmNoTaxAmount as confirmAmount confirmNoTaxAmount as confirmAmount
from v_statistical v from v_statistical v
left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id) <!-- left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)-->
<where> <where>
chargeCompanyId = #{CompanyComeMoneyDetailSearch.chargeCompanyId} chargeCompanyId = #{CompanyComeMoneyDetailSearch.chargeCompanyId}
<if test="idList != null and idList != ''"> <if test="idList != null and idList != ''">
@@ -2125,12 +2147,14 @@
</if> </if>
</otherwise> </otherwise>
</choose> </choose>
<if test="CompanyComeMoneyDetailSearch.paymentYear != null and CompanyComeMoneyDetailSearch.paymentYear != ''"> <choose>
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{CompanyComeMoneyDetailSearch.paymentYear}, '%') <when test="CompanyComeMoneyDetailSearch.paymentMonth != null and CompanyComeMoneyDetailSearch.paymentMonth != ''">
<if test="CompanyComeMoneyDetailSearch.paymentMonth != null and CompanyComeMoneyDetailSearch.paymentMonth != ''"> and confirmDate like concat('%',#{CompanyComeMoneyDetailSearch.paymentYear},'-',#{CompanyComeMoneyDetailSearch.paymentMonth},'%')
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{CompanyComeMoneyDetailSearch.paymentMonth}, '%') </when>
</if> <when test="CompanyComeMoneyDetailSearch.paymentYear != null and CompanyComeMoneyDetailSearch.paymentYear != ''">
</if> and confirmDate like concat('%',#{CompanyComeMoneyDetailSearch.paymentYear},'%')
</when>
</choose>
</where> </where>
) pp ) pp
</select> </select>
@@ -2153,7 +2177,7 @@
sum(confirmNoTaxAmount) as confirmAmount, sum(confirmNoTaxAmount) as confirmAmount,
sum(confirmAmount) as confirmAmount1 sum(confirmAmount) as confirmAmount1
from v_statistical v from v_statistical v
left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id) <!-- left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)-->
<where> <where>
<foreach item="item" open="departId in(" separator="," close=")" collection="idList"> <foreach item="item" open="departId in(" separator="," close=")" collection="idList">
#{item} #{item}
@@ -2162,12 +2186,14 @@
AND year LIKE AND year LIKE
concat(#{departStatisticsSearch.year}, '%') concat(#{departStatisticsSearch.year}, '%')
</if> </if>
<if test="departStatisticsSearch.paymentYear != null and departStatisticsSearch.paymentYear != ''"> <choose>
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{departStatisticsSearch.paymentYear}, '%') <when test="departStatisticsSearch.paymentMonth != null and departStatisticsSearch.paymentMonth != ''">
<if test="departStatisticsSearch.paymentMonth != null and departStatisticsSearch.paymentMonth != ''"> and confirmDate like concat('%',#{departStatisticsSearch.paymentYear},'-',#{departStatisticsSearch.paymentMonth},'%')
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{departStatisticsSearch.paymentMonth}, '%') </when>
</if> <when test="departStatisticsSearch.paymentYear != null and departStatisticsSearch.paymentYear != ''">
</if> and confirmDate like concat('%',#{departStatisticsSearch.paymentYear},'%')
</when>
</choose>
</where> </where>
group by v.departId) p group by v.departId) p
<if test="departStatisticsSearch.column != null and departStatisticsSearch.column != ''"> <if test="departStatisticsSearch.column != null and departStatisticsSearch.column != ''">
@@ -2204,7 +2230,7 @@
sum(invoiceNoTaxAmount) as billMoney, sum(invoiceNoTaxAmount) as billMoney,
sum(confirmNoTaxAmount) as confirmAmount sum(confirmNoTaxAmount) as confirmAmount
from v_statistical v from v_statistical v
left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id) <!-- left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)-->
<where> <where>
<foreach item="item" open="departId in(" separator="," close=")" collection="idList"> <foreach item="item" open="departId in(" separator="," close=")" collection="idList">
#{item} #{item}
@@ -2213,33 +2239,17 @@
AND year LIKE AND year LIKE
concat(#{departStatisticsSearch.year}, '%') concat(#{departStatisticsSearch.year}, '%')
</if> </if>
<if test="departStatisticsSearch.paymentYear != null and departStatisticsSearch.paymentYear != ''"> <choose>
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{departStatisticsSearch.paymentYear}, '%') <when test="departStatisticsSearch.paymentMonth != null and departStatisticsSearch.paymentMonth != ''">
<if test="departStatisticsSearch.paymentMonth != null and departStatisticsSearch.paymentMonth != ''"> and confirmDate like concat('%',#{departStatisticsSearch.paymentYear},'-',#{departStatisticsSearch.paymentMonth},'%')
and DATE_FORMAT (pcpr.payment_date,'%m') like concat(#{departStatisticsSearch.paymentMonth}, '%') </when>
</if> <when test="departStatisticsSearch.paymentYear != null and departStatisticsSearch.paymentYear != ''">
</if> and confirmDate like concat('%',#{departStatisticsSearch.paymentYear},'%')
</when>
</choose>
</where> </where>
</select> </select>
<!--全所收入统计 合同金额-->
<!-- 全所收入统计-->
<select id="queryListAllProjectMoney" resultType="com.jero.statistics.entity.AllProjectStatistics">
select
sum(paidNoTaxAmount) as comeAllMoney,
sum(invoiceNoTaxAmount) as billMoney,
sum(confirmNoTaxAmount) as confirmAmount,
DATE_FORMAT(pcpr.payment_date,'%Y-%m') as paymentDate
from v_statistical v
left join pay_confirm_payment_record pcpr on(v.projectId=pcpr.project_id)
<where>
<if test="allProjectStatisticsSearch.paymentYear != null and allProjectStatisticsSearch.paymentYear != ''">
and DATE_FORMAT (pcpr.payment_date,'%Y') like concat(#{allProjectStatisticsSearch.paymentYear}, '%')
</if>
</where>
group by DATE_FORMAT(pcpr.payment_date,'%Y-%m')
order by paymentDate
</select>
<!-- 全所收入统计-->
<select id="queryListAllMoney" resultType="com.jero.statistics.entity.AllProjectStatistics"> <select id="queryListAllMoney" resultType="com.jero.statistics.entity.AllProjectStatistics">
select select
sum(contract_amount) as allMoney, sum(contract_amount) as allMoney,
@@ -2254,6 +2264,52 @@
order by contract_date order by contract_date
</select> </select>
<!--全所收入统计 确认收入金额-->
<select id="queryListConfirmAmount" resultType="com.jero.statistics.entity.AllProjectStatistics">
select
sum(no_tax_amount) as confirmAmount,
DATE_FORMAT(payment_date,'%Y-%m') as paymentDate
from pay_confirm_payment_record
<where>
<if test="allProjectStatisticsSearch.paymentYear != null and allProjectStatisticsSearch.paymentYear != ''">
and DATE_FORMAT (payment_date,'%Y') like concat(#{allProjectStatisticsSearch.paymentYear}, '%')
</if>
</where>
group by DATE_FORMAT(payment_date,'%Y-%m')
order by payment_date
</select>
<!--全所收入统计 开票金额-->
<select id="queryListBillMoney" resultType="com.jero.statistics.entity.AllProjectStatistics">
select
sum(no_tax_amount) as billMoney,
DATE_FORMAT(bill_date,'%Y-%m') as paymentDate
from pay_mail_bill
<where>
<if test="allProjectStatisticsSearch.paymentYear != null and allProjectStatisticsSearch.paymentYear != ''">
and DATE_FORMAT (bill_date,'%Y') like concat(#{allProjectStatisticsSearch.paymentYear}, '%')
</if>
</where>
group by DATE_FORMAT(bill_date,'%Y-%m')
order by bill_date
</select>
<!--全所收入统计 开票金额-->
<select id="queryListComeAllMoney" resultType="com.jero.statistics.entity.AllProjectStatistics">
select
sum(no_tax_amount) as comeAllMoney,
DATE_FORMAT(payment_date,'%Y-%m') as paymentDate
from pay_payment_record
<where>
<if test="allProjectStatisticsSearch.paymentYear != null and allProjectStatisticsSearch.paymentYear != ''">
and DATE_FORMAT (payment_date,'%Y') like concat(#{allProjectStatisticsSearch.paymentYear}, '%')
</if>
</where>
group by DATE_FORMAT(payment_date,'%Y-%m')
order by payment_date
</select>
<select id="queryAllMoney33" resultType="com.jero.statistics.entity.AllMoney"> <select id="queryAllMoney33" resultType="com.jero.statistics.entity.AllMoney">
select select
sum(contract_amount) as allMoney sum(contract_amount) as allMoney
@@ -2265,34 +2321,6 @@
</where> </where>
</select> </select>
<select id="cumulativeListAllProjectMoney" resultType="com.jero.statistics.entity.AllProjectStatistics">
select TMP1.paymentDate,
sum(TMP2.comeAllMoney) as comeAllMoney,
sum(TMP2.billMoney) as billMoney,
sum(TMP2.confirmAmount) as confirmAmount
from (SELECT sum(paidNoTaxAmount) AS comeAllMoney,
sum(invoiceNoTaxAmount) AS billMoney,
sum(confirmNoTaxAmount) AS confirmAmount,
DATE_FORMAT(pcpr.payment_date, '%Y-%m') AS paymentDate
FROM v_statistical v
LEFT JOIN pay_confirm_payment_record pcpr ON (v.projectId = pcpr.project_id)
WHERE DATE_FORMAT(pcpr.payment_date, '%Y') like concat(#{allProjectStatisticsSearch.paymentYear}, '%')
GROUP BY DATE_FORMAT(pcpr.payment_date, '%Y-%m')
ORDER BY paymentDate) TMP1,
(SELECT sum(paidNoTaxAmount) AS comeAllMoney,
sum(invoiceNoTaxAmount) AS billMoney,
sum(confirmNoTaxAmount) AS confirmAmount,
DATE_FORMAT(pcpr.payment_date, '%Y-%m') AS paymentDate
FROM v_statistical v
LEFT JOIN pay_confirm_payment_record pcpr ON (v.projectId = pcpr.project_id)
WHERE DATE_FORMAT(pcpr.payment_date, '%Y') like concat(#{allProjectStatisticsSearch.paymentYear}, '%')
GROUP BY DATE_FORMAT(pcpr.payment_date, '%Y-%m')
ORDER BY paymentDate) TMP2
where TMP1.paymentDate >= TMP2.paymentDate
group by TMP1.paymentDate
ORDER BY TMP1.paymentDate
</select>
<select id="cumulativeListAllMoney" resultType="com.jero.statistics.entity.AllProjectStatistics"> <select id="cumulativeListAllMoney" resultType="com.jero.statistics.entity.AllProjectStatistics">
SELECT TMP1.paymentDate, SELECT TMP1.paymentDate,
sum(TMP2.allMoney) as allMoney sum(TMP2.allMoney) as allMoney
@@ -2311,13 +2339,69 @@
ORDER BY TMP1.paymentDate ORDER BY TMP1.paymentDate
</select> </select>
<!--全所收入统计 累计 确认收入金额-->
<select id="cumulativeListConfirmAmount" resultType="com.jero.statistics.entity.AllProjectStatistics">
SELECT TMP1.paymentDate,
sum(TMP2.allMoney) as confirmAmount
FROM (SELECT sum(no_tax_amount) AS allMoney,
DATE_FORMAT(payment_date, '%Y-%m') AS paymentDate
FROM pay_confirm_payment_record
WHERE DATE_FORMAT(payment_date, '%Y') LIKE concat('2022', '%')
GROUP BY DATE_FORMAT(payment_date, '%Y-%m')) TMP1,
(SELECT sum(no_tax_amount) AS allMoney,
DATE_FORMAT(payment_date, '%Y-%m') AS paymentDate
FROM pay_confirm_payment_record
WHERE DATE_FORMAT(payment_date, '%Y') LIKE concat('2022', '%')
GROUP BY DATE_FORMAT(payment_date, '%Y-%m')) TMP2
WHERE TMP1.paymentDate >= TMP2.paymentDate
GROUP BY TMP1.paymentDate
ORDER BY TMP1.paymentDate
</select>
<!--全所收入统计 累计 开票金额-->
<select id="cumulativeListBillMoney" resultType="com.jero.statistics.entity.AllProjectStatistics">
SELECT TMP1.paymentDate,
sum(TMP2.allMoney) as billMoney
FROM (SELECT sum(no_tax_amount) AS allMoney,
DATE_FORMAT(bill_date, '%Y-%m') AS paymentDate
FROM pay_mail_bill
WHERE DATE_FORMAT(bill_date, '%Y') LIKE concat('2022', '%')
GROUP BY DATE_FORMAT(bill_date, '%Y-%m')) TMP1,
(SELECT sum(no_tax_amount) AS allMoney,
DATE_FORMAT(bill_date, '%Y-%m') AS paymentDate
FROM pay_mail_bill
WHERE DATE_FORMAT(bill_date, '%Y') LIKE concat('2022', '%')
GROUP BY DATE_FORMAT(bill_date, '%Y-%m')) TMP2
WHERE TMP1.paymentDate >= TMP2.paymentDate
GROUP BY TMP1.paymentDate
ORDER BY TMP1.paymentDate
</select>
<!--全所收入统计 累计 开票金额-->
<select id="cumulativeListComeAllMoney" resultType="com.jero.statistics.entity.AllProjectStatistics">
SELECT TMP1.paymentDate,
sum(TMP2.allMoney) as comeAllMoney
FROM (SELECT sum(no_tax_amount) AS allMoney,
DATE_FORMAT(payment_date, '%Y-%m') AS paymentDate
FROM pay_payment_record
WHERE DATE_FORMAT(payment_date, '%Y') LIKE concat('2022', '%')
GROUP BY DATE_FORMAT(payment_date, '%Y-%m')) TMP1,
(SELECT sum(no_tax_amount) AS allMoney,
DATE_FORMAT(payment_date, '%Y-%m') AS paymentDate
FROM pay_payment_record
WHERE DATE_FORMAT(payment_date, '%Y') LIKE concat('2022', '%')
GROUP BY DATE_FORMAT(payment_date, '%Y-%m')) TMP2
WHERE TMP1.paymentDate >= TMP2.paymentDate
GROUP BY TMP1.paymentDate
ORDER BY TMP1.paymentDate
</select>
<select id="amountClass" resultType="com.jero.index.vo.AmountClassDTO"> <select id="amountClass" resultType="com.jero.index.vo.AmountClassDTO">
SELECT chargeUse, SELECT chargeUse,
ifnull(SUM(${column}),0) as money ifnull(SUM(${column}),0) as money
FROM v_statistical v FROM v_statistical v
LEFT JOIN pay_confirm_payment_record pcpr ON (v.projectId = pcpr.project_id)
<where> <where>
DATE_FORMAT(pcpr.payment_date, '%Y') like concat(#{year}, '%') confirmDate like concat('%',#{year},'%')
</where> </where>
GROUP BY chargeUse GROUP BY chargeUse
</select> </select>
@@ -2349,6 +2433,7 @@
paidNoTaxAmount, paidNoTaxAmount,
confirmNoTaxAmount, confirmNoTaxAmount,
contactsName, contactsName,
confirmDate,
pp.pack pp.pack
from ( from (
SELECT pwgs.id, SELECT pwgs.id,
@@ -2374,13 +2459,15 @@
invoice_no_tax_amount as invoiceNoTaxAmount, invoice_no_tax_amount as invoiceNoTaxAmount,
paid_no_tax_amount as paidNoTaxAmount, paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount, confirm_no_tax_amount as confirmNoTaxAmount,
GROUP_CONCAT(pwgsc.contacts_temporary_name order by pwgsc.contacts_temporary_name) as contactsName, GROUP_CONCAT(DISTINCT pwgsc.contacts_temporary_name order by pwgsc.contacts_temporary_name) as contactsName,
GROUP_CONCAT(DISTINCT DATE_FORMAT(pcpr.payment_date,'%Y-%m')) as confirmDate,
pwgs.create_time as createTime pwgs.create_time as createTime
FROM pay_working_group pwg FROM pay_working_group pwg
right join pay_working_group_subitem pwgs on (pwg.id = pwgs.working_group_id) right join pay_working_group_subitem pwgs on (pwg.id = pwgs.working_group_id)
left JOIN sys_user su on (pwg.principal_id_a = su.id) left JOIN sys_user su on (pwg.principal_id_a = su.id)
left join sys_depart sd on (su.depart_ids = sd.id) left join sys_depart sd on (su.depart_ids = sd.id)
left JOIN pay_working_group_subitem_contacts pwgsc on pwgsc.working_group_sub_id = pwgs.id left JOIN pay_working_group_subitem_contacts pwgsc on pwgsc.working_group_sub_id = pwgs.id
left join pay_confirm_payment_record pcpr on pwgs.id = pcpr.project_id
where pwgs.charge_way = 2 where pwgs.charge_way = 2
group by pwgs.id group by pwgs.id
union all union all
@@ -2407,13 +2494,15 @@
invoice_no_tax_amount as invoiceNoTaxAmount, invoice_no_tax_amount as invoiceNoTaxAmount,
paid_no_tax_amount as paidNoTaxAmount, paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount, confirm_no_tax_amount as confirmNoTaxAmount,
GROUP_CONCAT(pwgsc.contacts_temporary_name order by pwgsc.contacts_temporary_name) as contactsName, GROUP_CONCAT(DISTINCT pwgsc.contacts_temporary_name order by pwgsc.contacts_temporary_name) as contactsName,
GROUP_CONCAT(DISTINCT DATE_FORMAT(pcpr.payment_date,'%Y-%m')) as confirmDate,
pwgs.create_time as createTime pwgs.create_time as createTime
FROM pay_working_group pwg FROM pay_working_group pwg
right join pay_working_group_subitem pwgs on (pwg.id = pwgs.working_group_id) right join pay_working_group_subitem pwgs on (pwg.id = pwgs.working_group_id)
left JOIN sys_user su on (pwg.principal_id_a = su.id) left JOIN sys_user su on (pwg.principal_id_a = su.id)
left join sys_depart sd on (su.depart_ids = sd.id) left join sys_depart sd on (su.depart_ids = sd.id)
left JOIN pay_working_group_subitem_contacts pwgsc on pwgsc.working_group_sub_id = pwgs.id left JOIN pay_working_group_subitem_contacts pwgsc on pwgsc.working_group_sub_id = pwgs.id
left join pay_confirm_payment_record pcpr on pwgs.id = pcpr.project_id
where pwgs.charge_way != 2 where pwgs.charge_way != 2
group by pwgs.id group by pwgs.id
union all union all
@@ -2441,10 +2530,13 @@
paid_no_tax_amount as paidNoTaxAmount, paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount, confirm_no_tax_amount as confirmNoTaxAmount,
contacts_temporary_name as contactsName, contacts_temporary_name as contactsName,
GROUP_CONCAT(DATE_FORMAT(pcpr.payment_date,'%Y-%m')) as confirmDate,
pcp.create_time as createTime pcp.create_time as createTime
FROM pay_common_project pcp FROM pay_common_project pcp
left JOIN sys_user su on (pcp.principal_id = su.id) left JOIN sys_user su on (pcp.principal_id = su.id)
left join sys_depart sd on (su.depart_ids = sd.id) left join sys_depart sd on (su.depart_ids = sd.id)
left join pay_confirm_payment_record pcpr on pcp.id = pcpr.project_id
group by pcp.id
union all union all
SELECT pmps.id, SELECT pmps.id,
pmp.id as superId, pmp.id as superId,
@@ -2470,11 +2562,14 @@
paid_no_tax_amount as paidNoTaxAmount, paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount, confirm_no_tax_amount as confirmNoTaxAmount,
company_contact_name as contactsName, company_contact_name as contactsName,
GROUP_CONCAT(DATE_FORMAT(pcpr.payment_date,'%Y-%m')) as confirmDate,
pmps.create_time as createTime pmps.create_time as createTime
FROM pay_member_project pmp FROM pay_member_project pmp
right join pay_member_project_subitem pmps on (pmp.id = pmps.project_id) right join pay_member_project_subitem pmps on (pmp.id = pmps.project_id)
left JOIN sys_user su on (pmp.director_id = su.id) left JOIN sys_user su on (pmp.director_id = su.id)
left join sys_depart sd on (su.depart_ids = sd.id) left join sys_depart sd on (su.depart_ids = sd.id)
left join pay_confirm_payment_record pcpr on pmps.id = pcpr.project_id
group by pmps.id
union all union all
SELECT pms.id, SELECT pms.id,
pm.id as superId, pm.id as superId,
@@ -2500,11 +2595,14 @@
paid_no_tax_amount as paidNoTaxAmount, paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount, confirm_no_tax_amount as confirmNoTaxAmount,
company_contact_name as contactsName, company_contact_name as contactsName,
GROUP_CONCAT(DATE_FORMAT(pcpr.payment_date,'%Y-%m')) as confirmDate,
pms.create_time as createTime pms.create_time as createTime
FROM pay_meeting pm FROM pay_meeting pm
right join pay_meeting_situation pms on (pm.id = pms.meeting_id) right join pay_meeting_situation pms on (pm.id = pms.meeting_id)
left JOIN sys_user su on (pm.director_id = su.id) left JOIN sys_user su on (pm.director_id = su.id)
left join sys_depart sd on (su.depart_ids = sd.id) left join sys_depart sd on (su.depart_ids = sd.id)
left join pay_confirm_payment_record pcpr on pms.id = pcpr.project_id
group by pms.id
union all union all
SELECT tmps.id, SELECT tmps.id,
tmp.id as superId, tmp.id as superId,
@@ -2530,11 +2628,14 @@
paid_no_tax_amount as paidNoTaxAmount, paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount, confirm_no_tax_amount as confirmNoTaxAmount,
liaison_man as contactsName, liaison_man as contactsName,
GROUP_CONCAT(DATE_FORMAT(pcpr.payment_date,'%Y-%m')) as confirmDate,
tmps.create_time as createTime tmps.create_time as createTime
FROM tb_member_project tmp FROM tb_member_project tmp
left join tb_member_project_subitem tmps on (tmp.id = tmps.project_id) left join tb_member_project_subitem tmps on (tmp.id = tmps.project_id)
left JOIN sys_user su on (tmp.director_id = su.id) left JOIN sys_user su on (tmp.director_id = su.id)
left join sys_depart sd on (su.depart_ids = sd.id) left join sys_depart sd on (su.depart_ids = sd.id)
left join pay_confirm_payment_record pcpr on tmps.id = pcpr.project_id
group by tmps.id
union all union all
SELECT tcp.id, SELECT tcp.id,
tmp.id as superId, tmp.id as superId,
@@ -2560,18 +2661,20 @@
paid_no_tax_amount as paidNoTaxAmount, paid_no_tax_amount as paidNoTaxAmount,
confirm_no_tax_amount as confirmNoTaxAmount, confirm_no_tax_amount as confirmNoTaxAmount,
liaison_man as contactsName, liaison_man as contactsName,
GROUP_CONCAT(DATE_FORMAT(pcpr.payment_date,'%Y-%m')) as confirmDate,
tcp.create_time as createTime tcp.create_time as createTime
FROM tb_member_project tmp FROM tb_member_project tmp
left join tb_certificate_payment tcp on (tmp.id = tcp.project_id) left join tb_certificate_payment tcp on (tmp.id = tcp.project_id)
left JOIN sys_user su on (tmp.director_id = su.id) left JOIN sys_user su on (tmp.director_id = su.id)
left join sys_depart sd on (su.depart_ids = sd.id) left join sys_depart sd on (su.depart_ids = sd.id)
left join pay_confirm_payment_record pcpr on tcp.id = pcpr.project_id
group by tcp.id
) pp ) pp
where pp.allMoney is not null where pp.allMoney is not null
and pp.allMoney != 0 and pp.allMoney != 0
order by pp.createTime) v order by pp.createTime) v
LEFT JOIN pay_confirm_payment_record pcpr ON (v.projectId = pcpr.project_id)
<where> <where>
DATE_FORMAT(pcpr.payment_date, '%Y') like concat(#{year}, '%') confirmDate like concat('%',#{year},'%')
</where> </where>
GROUP BY chargeUse GROUP BY chargeUse
</select> </select>
@@ -588,23 +588,30 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
@Override @Override
public List<AllProjectStatistics> queryListAllProjectMoney(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList) { public List<AllProjectStatistics> queryListAllProjectMoney(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList) {
List<AllProjectStatistics> list = payWorkingGroupMapper.queryListAllProjectMoney(allProjectStatisticsSearch,idList);
List<AllProjectStatistics> allMoneyList = payWorkingGroupMapper.queryListAllMoney(allProjectStatisticsSearch); List<AllProjectStatistics> allMoneyList = payWorkingGroupMapper.queryListAllMoney(allProjectStatisticsSearch);
return getAllProjectMoneyStatistics(allProjectStatisticsSearch, list,allMoneyList); List<AllProjectStatistics> listConfirmAmount = payWorkingGroupMapper.queryListConfirmAmount(allProjectStatisticsSearch);
List<AllProjectStatistics> listBillMoney = payWorkingGroupMapper.queryListBillMoney(allProjectStatisticsSearch);
List<AllProjectStatistics> listComeAllMoney = payWorkingGroupMapper.queryListComeAllMoney(allProjectStatisticsSearch);
return getAllProjectMoneyStatistics(allProjectStatisticsSearch,allMoneyList,listConfirmAmount, listBillMoney,listComeAllMoney);
} }
@Override @Override
public List<AllProjectStatistics> cumulativeListAllProjectMoney(AllProjectStatisticsSearch allProjectStatisticsSearch) { public List<AllProjectStatistics> cumulativeListAllProjectMoney(AllProjectStatisticsSearch allProjectStatisticsSearch) {
List<AllProjectStatistics> list = payWorkingGroupMapper.cumulativeListAllProjectMoney(allProjectStatisticsSearch); List<AllProjectStatistics> allMoneyList = payWorkingGroupMapper.cumulativeListAllMoney();
List<AllProjectStatistics> allMoneyList = payWorkingGroupMapper.cumulativeListAllMoney(allProjectStatisticsSearch); List<AllProjectStatistics> listConfirmAmount = payWorkingGroupMapper.cumulativeListConfirmAmount();
return getAllProjectMoneyStatistics(allProjectStatisticsSearch, list,allMoneyList); List<AllProjectStatistics> listBillMoney = payWorkingGroupMapper.cumulativeListBillMoney();
List<AllProjectStatistics> listComeAllMoney = payWorkingGroupMapper.cumulativeListComeAllMoney();
return getAllProjectMoneyStatistics(allProjectStatisticsSearch,allMoneyList,listConfirmAmount, listBillMoney,listComeAllMoney);
} }
@Override @Override
public List<AllProjectMoneyExcel> queryListAllProjectMoneyExcel(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList) { public List<AllProjectMoneyExcel> queryListAllProjectMoneyExcel(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList) {
List<AllProjectStatistics> list = payWorkingGroupMapper.queryListAllProjectMoney(allProjectStatisticsSearch,idList);
List<AllProjectStatistics> allMoneyList = payWorkingGroupMapper.queryListAllMoney(allProjectStatisticsSearch); List<AllProjectStatistics> allMoneyList = payWorkingGroupMapper.queryListAllMoney(allProjectStatisticsSearch);
List<AllProjectStatistics> list2=getAllProjectMoneyStatistics(allProjectStatisticsSearch, list, allMoneyList); List<AllProjectStatistics> listConfirmAmount = payWorkingGroupMapper.queryListConfirmAmount(allProjectStatisticsSearch);
List<AllProjectStatistics> listBillMoney = payWorkingGroupMapper.queryListBillMoney(allProjectStatisticsSearch);
List<AllProjectStatistics> listComeAllMoney = payWorkingGroupMapper.queryListComeAllMoney(allProjectStatisticsSearch);
List<AllProjectStatistics> list2=getAllProjectMoneyStatistics(allProjectStatisticsSearch,allMoneyList,listConfirmAmount, listBillMoney,listComeAllMoney);
AllMoney allMoney=payWorkingGroupMapper.queryPageList33(allProjectStatisticsSearch, idList); AllMoney allMoney=payWorkingGroupMapper.queryPageList33(allProjectStatisticsSearch, idList);
List<String> comeAllMoneyList=list2.stream().map(AllProjectStatistics::getComeAllMoney).collect(Collectors.toList()); List<String> comeAllMoneyList=list2.stream().map(AllProjectStatistics::getComeAllMoney).collect(Collectors.toList());
@@ -652,11 +659,15 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
} }
@NotNull @NotNull
private List<AllProjectStatistics> getAllProjectMoneyStatistics(AllProjectStatisticsSearch allProjectStatisticsSearch, List<AllProjectStatistics> list, List<AllProjectStatistics> allMoneyList) { private List<AllProjectStatistics> getAllProjectMoneyStatistics(AllProjectStatisticsSearch allProjectStatisticsSearch,
Map<String, String> comeAllMoneyMap = list.stream().collect(Collectors.toMap(AllProjectStatistics::getPaymentDate, AllProjectStatistics::getComeAllMoney)); List<AllProjectStatistics> allMoneyList,
Map<String, String> billMoneyMap = list.stream().collect(Collectors.toMap(AllProjectStatistics::getPaymentDate, AllProjectStatistics::getBillMoney)); List<AllProjectStatistics> listConfirmAmount,
Map<String, String> confirmAmountMap = list.stream().collect(Collectors.toMap(AllProjectStatistics::getPaymentDate, AllProjectStatistics::getConfirmAmount)); List<AllProjectStatistics> listBillMoney,
List<AllProjectStatistics> listComeAllMoney) {
Map<String, String> allMoneyMap = allMoneyList.stream().collect(Collectors.toMap(AllProjectStatistics::getPaymentDate, AllProjectStatistics::getAllMoney)); Map<String, String> allMoneyMap = allMoneyList.stream().collect(Collectors.toMap(AllProjectStatistics::getPaymentDate, AllProjectStatistics::getAllMoney));
Map<String, String> confirmAmountMap = listConfirmAmount.stream().collect(Collectors.toMap(AllProjectStatistics::getPaymentDate, AllProjectStatistics::getConfirmAmount));
Map<String, String> billMoneyMap = listBillMoney.stream().collect(Collectors.toMap(AllProjectStatistics::getPaymentDate, AllProjectStatistics::getBillMoney));
Map<String, String> comeAllMoneyMap = listComeAllMoney.stream().collect(Collectors.toMap(AllProjectStatistics::getPaymentDate, AllProjectStatistics::getComeAllMoney));
String paymentYear=allProjectStatisticsSearch.getPaymentYear(); String paymentYear=allProjectStatisticsSearch.getPaymentYear();
List<String> yearMonth = getYearMonth(paymentYear); List<String> yearMonth = getYearMonth(paymentYear);
@@ -17,6 +17,7 @@ import com.jero.statistics.entity.AllProjectStatisticsSearch;
import com.jero.util.AmountUtil; import com.jero.util.AmountUtil;
import com.mchange.lang.IntegerUtils; import com.mchange.lang.IntegerUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
@@ -29,6 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
@@ -67,14 +69,25 @@ public class AllProjectMoneyStatisticsController {
public Result<?> list(AllProjectStatisticsSearch allProjectStatisticsSearch) { public Result<?> list(AllProjectStatisticsSearch allProjectStatisticsSearch) {
List<AllProjectStatistics> list = payWorkingGroupService.queryListAllProjectMoney(allProjectStatisticsSearch, null); List<AllProjectStatistics> list = payWorkingGroupService.queryListAllProjectMoney(allProjectStatisticsSearch, null);
BigDecimal allMoney = BigDecimal.ZERO;
BigDecimal comeAllMoney = BigDecimal.ZERO;
BigDecimal billMoney = BigDecimal.ZERO;
BigDecimal confirmAmount = BigDecimal.ZERO;
for (AllProjectStatistics item : list) {
BigDecimal allMoney1 = new BigDecimal(item.getAllMoney());
allMoney = allMoney.add(allMoney1);
BigDecimal comeAllMoney1 = new BigDecimal(item.getComeAllMoney());
comeAllMoney = comeAllMoney.add(comeAllMoney1);
BigDecimal billMoney1 = new BigDecimal(item.getBillMoney());
billMoney = billMoney.add(billMoney1);
BigDecimal confirmAmount1 = new BigDecimal(item.getConfirmAmount());
confirmAmount = confirmAmount.add(confirmAmount1);
};
HashMap<String, Object> hashMap = new HashMap<>(); HashMap<String, Object> hashMap = new HashMap<>();
AllMoney allMoney = payWorkingGroupService.queryPageList33(allProjectStatisticsSearch, null); hashMap.put("sumOfMoney", allMoney.toString());
AllMoney allMoney1 = payWorkingGroupService.queryAllMoney33(allProjectStatisticsSearch); hashMap.put("sumOfReallyMoney", comeAllMoney.toString());
hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney1) ? 0 : allMoney1.getAllMoney()); hashMap.put("sumOfBillMoney", billMoney.toString());
hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney()); hashMap.put("sumOfConfirmAmount", confirmAmount.toString());
hashMap.put("sumOfBillMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getBillMoney());
hashMap.put("sumOfConfirmAmount", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getConfirmAmount());
hashMap.put("list", list); hashMap.put("list", list);
return Result.OK(hashMap); return Result.OK(hashMap);