add 统计报表-科室总体统计

This commit is contained in:
lijiarao
2022-06-11 17:25:14 +08:00
parent f6c9d003af
commit a01d0db2c8
10 changed files with 208 additions and 23 deletions
@@ -212,4 +212,7 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
AllMoney queryPageListForPrincipalDetail33(@Param("principalPeopleDetailSearch") PrincipalPeopleDetailSearch principalPeopleDetailSearch);
IPage<DepartStatistics> queryPageListDepartment(Page<DepartStatistics> page, @Param("departStatisticsSearch") DepartStatisticsSearch departStatisticsSearch, @Param("idList") List<String> idList);
AllMoney queryPageListDepartment33(@Param("departStatisticsSearch") DepartStatisticsSearch departStatisticsSearch, @Param("idList") List<String> idList);
}
@@ -2052,5 +2052,84 @@
) pp
</select>
<select id="queryPageListDepartment" resultType="com.jero.statistics.entity.DepartStatistics">
select
allMoney,
comeAllMoney,
departName,
billMoney,
CONCAT(CAST(ROUND((comeAllMoney / allMoney) * 100, 2) AS CHAR), '%') AS finishRate,
confirmAmount
from
(select
sum(allMoney) as allMoney,
sum(comeAllMoney) as comeAllMoney,
depart as departName,
if(sum(pmb.invoice_amount) is null, 0.00, sum(pmb.invoice_amount)) as billMoney,
sum(confirmAmount) as confirmAmount
from v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id
left join pay_mail_bill pmb on pmbp.bill_id = pmb.id
<where>
<foreach item="item" open="departId in(" separator="," close=")" collection="idList">
#{item}
</foreach>
<if test="departStatisticsSearch.year != null and departStatisticsSearch.year != ''">
AND year LIKE
concat(#{departStatisticsSearch.year}, '%')
</if>
<if test="departStatisticsSearch.billYear != null and departStatisticsSearch.billYear != ''">
and DATE_FORMAT (pmb.bill_date,'%Y') like concat(#{departStatisticsSearch.billYear}, '%')
</if>
</where>
group by v.departId) p
<if test="departStatisticsSearch.column != null and departStatisticsSearch.column != ''">
<if test="departStatisticsSearch.column == 'allMoney' and departStatisticsSearch.order == 'desc'">
order by allMoney desc
</if>
<if test="departStatisticsSearch.column == 'comeAllMoney' and departStatisticsSearch.order == 'desc'">
order by comeAllMoney desc
</if>
<if test="departStatisticsSearch.column == 'billMoney' and departStatisticsSearch.order == 'desc'">
order by billMoney desc
</if>
<if test="departStatisticsSearch.column == 'confirmAmount' and departStatisticsSearch.order == 'desc'">
order by confirmAmount desc
</if>
<if test="departStatisticsSearch.column == 'confirmAmount' and departStatisticsSearch.order == 'asc'">
order by confirmAmount
</if>
<if test="departStatisticsSearch.column == 'allMoney' and departStatisticsSearch.order == 'asc'">
order by allMoney
</if>
<if test="departStatisticsSearch.column == 'comeAllMoney' and departStatisticsSearch.order == 'asc'">
order by comeAllMoney
</if>
<if test="departStatisticsSearch.column == 'billMoney' and departStatisticsSearch.order == 'asc'">
order by billMoney
</if>
</if>
</select>
<select id="queryPageListDepartment33" resultType="com.jero.statistics.entity.AllMoney">
select sum(allMoney) as allMoney,
sum(comeAllMoney) as comeAllMoney,
if(sum(pmb.invoice_amount) is null, 0.00, sum(pmb.invoice_amount)) as billMoney,
sum(confirmAmount) as confirmAmount
from v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id
left join pay_mail_bill pmb on pmbp.bill_id = pmb.id
<where>
<foreach item="item" open="departId in(" separator="," close=")" collection="idList">
#{item}
</foreach>
<if test="departStatisticsSearch.year != null and departStatisticsSearch.year != ''">
AND year LIKE
concat(#{departStatisticsSearch.year}, '%')
</if>
<if test="departStatisticsSearch.billYear != null and departStatisticsSearch.billYear != ''">
and DATE_FORMAT (pmb.bill_date,'%Y') like concat(#{departStatisticsSearch.billYear}, '%')
</if>
</where>
</select>
</mapper>
@@ -233,4 +233,7 @@ public interface IPayWorkingGroupService extends IService<PayWorkingGroup> {
AllMoney queryPageListForPrincipalDetail33(PrincipalPeopleDetailSearch principalPeopleDetailSearch);
IPage<DepartStatistics> queryPageListDepartment(Page<DepartStatistics> page, DepartStatisticsSearch allProjectStatisticsSearch, List<String> idList);
AllMoney queryPageListDepartment33(DepartStatisticsSearch departStatisticsSearch, List<String> idList);
}
@@ -595,6 +595,16 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
return payWorkingGroupMapper.queryPageListForPrincipalDetail33(principalPeopleDetailSearch);
}
@Override
public IPage<DepartStatistics> queryPageListDepartment(Page<DepartStatistics> page, DepartStatisticsSearch departStatisticsSearch, List<String> idList) {
return payWorkingGroupMapper.queryPageListDepartment(page, departStatisticsSearch, idList);
}
@Override
public AllMoney queryPageListDepartment33(DepartStatisticsSearch departStatisticsSearch, List<String> idList) {
return payWorkingGroupMapper.queryPageListDepartment33(departStatisticsSearch, idList);
}
/**
* @Description 校验是存在关联合同的项目