update 科室总体统计改为和首页数据一致
This commit is contained in:
@@ -177,16 +177,20 @@ public class IndexService {
|
||||
}
|
||||
|
||||
public List<HistogramVO> overallDepartmentStatistics() {
|
||||
String year = String.valueOf(DateUtil.year(new DateTime()));
|
||||
DepartStatisticsSearch departStatisticsSearch = new DepartStatisticsSearch();
|
||||
departStatisticsSearch.setYear(year);
|
||||
departStatisticsSearch.setColumn("allMoney");
|
||||
departStatisticsSearch.setOrder("desc");
|
||||
Page<DepartStatistics> page = new Page<>(-1, -1);
|
||||
IPage<DepartStatistics> pageList = payWorkingGroupService.queryPageListDepartment(page, departStatisticsSearch, new ArrayList<>());
|
||||
List<DepartStatistics> records = pageList.getRecords();
|
||||
|
||||
return convertDepartStatistics(records);
|
||||
String year = String.valueOf(DateUtil.year(new DateTime()));
|
||||
List<DepartStatistics> records = payWorkingGroupMapper.overallDepartmentStatistics(year);
|
||||
List<DepartStatistics> all = payWorkingGroupMapper.allDepartmentStatistics(year);
|
||||
for (DepartStatistics a : all) {
|
||||
String departName = a.getDepartName();
|
||||
for (DepartStatistics record : records) {
|
||||
String departName1 = record.getDepartName();
|
||||
if (departName.equals(departName1)){
|
||||
a.setConfirmAmount(record.getConfirmAmount());
|
||||
}
|
||||
}
|
||||
}
|
||||
return convertDepartStatistics(all);
|
||||
}
|
||||
|
||||
private List<HistogramVO> convertDepartStatistics(List<DepartStatistics> list){
|
||||
|
||||
+3
@@ -251,4 +251,7 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
|
||||
BigDecimal invoiceAmount(@Param("start") Integer start, @Param("end") Integer end, @Param("departCode") String departCode);
|
||||
|
||||
|
||||
List<DepartStatistics> overallDepartmentStatistics(@Param("year") String year);
|
||||
|
||||
List<DepartStatistics> allDepartmentStatistics(@Param("year") String year);
|
||||
}
|
||||
|
||||
+20
@@ -2736,5 +2736,25 @@
|
||||
) a
|
||||
</select>
|
||||
|
||||
<select id="overallDepartmentStatistics" resultType="com.jero.statistics.entity.DepartStatistics">
|
||||
select
|
||||
sum(no_tax_amount) as confirmAmount,
|
||||
v.depart as departName
|
||||
from pay_confirm_payment_record pcpr left join v_statistical v on pcpr.project_id = v.projectId
|
||||
<where>
|
||||
DATE_FORMAT (payment_date,'%Y') like concat(#{year}, '%')
|
||||
</where>
|
||||
group by departCode
|
||||
</select>
|
||||
|
||||
<select id="allDepartmentStatistics" resultType="com.jero.statistics.entity.DepartStatistics">
|
||||
select
|
||||
sum(allMoney) as allMoney,
|
||||
v.depart as departName
|
||||
from v_statistical v
|
||||
<where>
|
||||
year = #{year}
|
||||
</where>
|
||||
group by departCode
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user