fix 87900 科室统计--导出所有数据--缺少数据

This commit is contained in:
lijiarao
2024-08-02 09:42:05 +08:00
parent 1a7781f42c
commit a656925b2c
5 changed files with 147 additions and 1 deletions
@@ -278,4 +278,5 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
List<CompanyComeMoneyClassificationList> queryPageListForCompanyClassification(@Param("companyComeMoneySearch") CompanyComeMoneySearch companyComeMoneySearch);
List<AllProjectStatistics> queryPageListExcelForProject(@Param("allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch, @Param("idList") List<String> idList);
}
@@ -2706,4 +2706,140 @@
</where>
group by chargeCompanyId,year,chargeUse
</select>
<select id="queryPageListExcelForProject" resultType="com.jero.statistics.entity.AllProjectStatistics">
select * from
(select projectId,
projectName,
principalName,
chargeCompanyTemporaryName,
allMoney,
paidNoTaxAmount as comeAllMoney,
chargeUse,
depart,
createTime,
packText,
pack,
invoiceNoTaxAmount as billMoney,
confirmNoTaxAmount as confirmAmount,
year
from
<if test="allProjectStatisticsSearch.paymentYear == null or allProjectStatisticsSearch.paymentYear == ''">
v_statistical v
</if>
<if test="allProjectStatisticsSearch.paymentYear != null and allProjectStatisticsSearch.paymentYear != ''">
(select
<include refid="v_statistical_confirm_sql"/>
from v_statistical_confirm v
<where>
<choose>
<when test="allProjectStatisticsSearch.paymentMonth != null and allProjectStatisticsSearch.paymentMonth != ''">
and confirmDate like
concat('%',#{allProjectStatisticsSearch.paymentYear},'-',#{allProjectStatisticsSearch.paymentMonth},'%')
</when>
<when test="allProjectStatisticsSearch.paymentYear != null and allProjectStatisticsSearch.paymentYear != ''">
and confirmDate like concat('%',#{allProjectStatisticsSearch.paymentYear},'%')
</when>
</choose>
</where>
group by projectId
) v
</if>
<where>
<if test="idList != null and idList != ''">
principalNameId in
<foreach item="item" open="(" separator="," close=")" collection="idList">
#{item}
</foreach>
</if>
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
AND projectName LIKE
concat('%', #{allProjectStatisticsSearch.projectName}, '%')
</if>
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
AND year LIKE
concat(#{allProjectStatisticsSearch.year}, '%')
</if>
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
AND payStatue LIKE
concat('%', #{allProjectStatisticsSearch.payStatue}, '%')
</if>
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
AND departCode = #{allProjectStatisticsSearch.departCode}
</if>
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
AND chargeUse = #{allProjectStatisticsSearch.chargeUse}
</if>
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
AND chargeCompanyTemporaryName LIKE
concat('%', #{allProjectStatisticsSearch.chargeCompanyTemporaryName}, '%')
</if>
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
AND principalNameId = #{allProjectStatisticsSearch.principalNameId}
</if>
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
AND pack = #{allProjectStatisticsSearch.pack}
</if>
<if test="allProjectStatisticsSearch.estimatedArrivalDateHasFlag != null and allProjectStatisticsSearch.estimatedArrivalDateHasFlag == '1'.toString()">
AND estimatedArrivalDate is null
</if>
<if test="allProjectStatisticsSearch.estimatedArrivalDateHasFlag != null and allProjectStatisticsSearch.estimatedArrivalDateHasFlag == '0'.toString()">
AND estimatedArrivalDate is not null
</if>
<choose>
<when test="allProjectStatisticsSearch.estimatedArrivalMonth != null and allProjectStatisticsSearch.estimatedArrivalMonth != ''">
and estimatedArrivalDate like
concat('%',#{allProjectStatisticsSearch.estimatedArrivalYear},'-',#{allProjectStatisticsSearch.estimatedArrivalMonth},'%')
</when>
<when test="allProjectStatisticsSearch.estimatedArrivalYear != null and allProjectStatisticsSearch.estimatedArrivalYear != ''">
and estimatedArrivalDate like concat('%',#{allProjectStatisticsSearch.estimatedArrivalYear},'%')
</when>
</choose>
<choose>
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
AND allMoney >= #{allProjectStatisticsSearch.allMoney}
and allMoney <![CDATA[<]]>=
#{allProjectStatisticsSearch.allMoneyTwo}
</when>
<otherwise>
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
AND allMoney >= #{allProjectStatisticsSearch.allMoney}
</if>
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
AND allMoney <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
</if>
</otherwise>
</choose>
<if test="allProjectStatisticsSearch.companyContactName != null and allProjectStatisticsSearch.companyContactName != ''">
and contactsName like concat('%', #{allProjectStatisticsSearch.companyContactName}, '%')
</if>
</where>
group by v.projectId) p
<if test="allProjectStatisticsSearch.column != null and allProjectStatisticsSearch.column != ''">
<if test="allProjectStatisticsSearch.column == 'allMoney' and allProjectStatisticsSearch.order == 'desc'">
order by allMoney desc
</if>
<if test="allProjectStatisticsSearch.column == 'comeAllMoney' and allProjectStatisticsSearch.order == 'desc'">
order by comeAllMoney desc
</if>
<if test="allProjectStatisticsSearch.column == 'billMoney' and allProjectStatisticsSearch.order == 'desc'">
order by billMoney desc
</if>
<if test="allProjectStatisticsSearch.column == 'confirmAmount' and allProjectStatisticsSearch.order == 'desc'">
order by confirmAmount desc
</if>
<if test="allProjectStatisticsSearch.column == 'confirmAmount' and allProjectStatisticsSearch.order == 'asc'">
order by confirmAmount
</if>
<if test="allProjectStatisticsSearch.column == 'allMoney' and allProjectStatisticsSearch.order == 'asc'">
order by allMoney
</if>
<if test="allProjectStatisticsSearch.column == 'comeAllMoney' and allProjectStatisticsSearch.order == 'asc'">
order by comeAllMoney
</if>
<if test="allProjectStatisticsSearch.column == 'billMoney' and allProjectStatisticsSearch.order == 'asc'">
order by billMoney
</if>
</if>
</select>
</mapper>
@@ -269,4 +269,6 @@ public interface IPayWorkingGroupService extends IService<PayWorkingGroup> {
void exportAllFile(HttpServletRequest request, HttpServletResponse response, PayWorkingGroup payWorkingGroup);
List<CompanyComeMoneyClassificationList> queryPageListForCompanyClassification(CompanyComeMoneySearch companyComeMoneySearch);
List<AllProjectStatistics> queryPageListExcelForProject(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList);
}
@@ -609,6 +609,13 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
public AllMoney queryPageListProjectTotal(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList) {
return payWorkingGroupMapper.queryPageListProjectTotal(allProjectStatisticsSearch, idList);
}
/**
* 科室统计excel
*/
@Override
public List<AllProjectStatistics> queryPageListExcelForProject(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList) {
return payWorkingGroupMapper.queryPageListExcelForProject(allProjectStatisticsSearch, idList);
}
@Override
public AllMoney queryPageListForCompany33(CompanyComeMoneySearch companyComeMoneySearch,List<String> idList) {
@@ -239,7 +239,7 @@ public class AllProjectStatisticsController {
return AmountUtil.exportListXls(objects, AllProjectStatistics.class, "科室统计");
}
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch, idList);
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcelForProject(allProjectStatisticsSearch, idList);
if (pageList != null) {
for (AllProjectStatistics s : pageList) {
String key = String.valueOf(s.getChargeUse());