update 首页应收账款统计列表查询增加排序

This commit is contained in:
lijiarao
2023-03-14 14:51:24 +08:00
parent 7d7c5ddea1
commit f0a89f946c
4 changed files with 50 additions and 21 deletions
@@ -120,11 +120,13 @@ public class IndexController {
public Result<?> uncollectedList(
@RequestParam(name="type",defaultValue = "1")String type,
@RequestParam(name="departCode",required = false)String departCode,
@RequestParam(name="column",required = false)String column,
@RequestParam(name="order",required = false)String order,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
Page<AllProjectStatistics> page = new Page<>(pageNo, pageSize);
HashMap<String, Object> hashMap = indexService.uncollectedList(type,departCode,page);
HashMap<String, Object> hashMap = indexService.uncollectedList(type,departCode,page,column,order);
return Result.OK(hashMap);
@@ -359,21 +359,21 @@ public class IndexService {
return uncollectedPieChartVO;
}
public HashMap<String, Object> uncollectedList(String type, String departCode, Page<AllProjectStatistics> page) {
public HashMap<String, Object> uncollectedList(String type, String departCode, Page<AllProjectStatistics> page, String column, String order) {
IPage<AllProjectStatistics> pageList = new Page<>();
switch (type) {
case "1":
pageList = payWorkingGroupMapper.invoiceAmountList(page, null, 90, departCode);
pageList = payWorkingGroupMapper.invoiceAmountList(page, null, 90, departCode,column,order);
break;
case "2":
pageList = payWorkingGroupMapper.invoiceAmountList(page, 91, 180, departCode);
pageList = payWorkingGroupMapper.invoiceAmountList(page, 91, 180, departCode,column,order);
break;
case "3":
pageList = payWorkingGroupMapper.invoiceAmountList(page, 181, 360, departCode);
pageList = payWorkingGroupMapper.invoiceAmountList(page, 181, 360, departCode,column,order);
break;
case "4":
pageList = payWorkingGroupMapper.invoiceAmountList(page, 361, null, departCode);
pageList = payWorkingGroupMapper.invoiceAmountList(page, 361, null, departCode,column,order);
break;
}
if (pageList.getRecords() != null) {
@@ -244,7 +244,7 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
BigDecimal invoiceAmount(@Param("start") Integer start, @Param("end") Integer end, @Param("departCode") String departCode);
IPage<AllProjectStatistics> invoiceAmountList(Page<AllProjectStatistics> page, @Param("start") Integer start, @Param("end") Integer end, @Param("departCode") String departCode);
IPage<AllProjectStatistics> invoiceAmountList(Page<AllProjectStatistics> page, @Param("start") Integer start, @Param("end") Integer end, @Param("departCode") String departCode, @Param("column") String column, @Param("order") String order);
AllMoney invoiceAmountList33(@Param("start") Integer start, @Param("end") Integer end, @Param("departCode") String departCode);
@@ -2413,7 +2413,8 @@
</select>
<select id="invoiceAmountList" resultType="com.jero.statistics.entity.AllProjectStatistics">
SELECT DISTINCT v.projectId,
select * from
(SELECT DISTINCT v.projectId,
projectName,
principalName,
chargeCompanyTemporaryName,
@@ -2429,23 +2430,49 @@
FROM v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id
left join pay_mail_bill pmb on pmb.id = pmbp.bill_id
<where>
<if test="end != null">
bill_date >= DATE_SUB(CURDATE(), INTERVAL #{end} DAY)
<where>
<if test="end != null">
bill_date >= DATE_SUB(CURDATE(), INTERVAL #{end} DAY)
</if>
<if test="start != null">
AND bill_date <![CDATA[<=]]> DATE_SUB(CURDATE(), INTERVAL #{start} DAY)
</if>
<if test="start == null">
AND bill_date <![CDATA[<=]]> CURDATE()
</if>
<if test="departCode != null and departCode != ''">
and departCode = #{departCode}
</if>
<!-- 开票未来款 -->
AND (comeAllMoney <![CDATA[<]]> billMoney or
(comeAllMoney is null and billMoney is not null and billMoney != 0))
</where>) p
<if test="column != null and column != ''">
<if test="column == 'allMoney' and order == 'desc'">
order by allMoney desc
</if>
<if test="start != null">
AND bill_date <![CDATA[<=]]> DATE_SUB(CURDATE(), INTERVAL #{start} DAY)
<if test="column == 'comeAllMoney' and order == 'desc'">
order by comeAllMoney desc
</if>
<if test="start == null">
AND bill_date <![CDATA[<=]]> CURDATE()
<if test="column == 'billMoney' and order == 'desc'">
order by billMoney desc
</if>
<if test="departCode != null and departCode != ''">
and departCode = #{departCode}
<if test="column == 'confirmAmount' and order == 'desc'">
order by confirmAmount desc
</if>
<!-- 开票未来款 -->
AND (comeAllMoney <![CDATA[<]]> billMoney or
(comeAllMoney is null and billMoney is not null and billMoney != 0))
</where>
<if test="column == 'confirmAmount' and order == 'asc'">
order by confirmAmount
</if>
<if test="column == 'allMoney' and order == 'asc'">
order by allMoney
</if>
<if test="column == 'comeAllMoney' and order == 'asc'">
order by comeAllMoney
</if>
<if test="column == 'billMoney' and order == 'asc'">
order by billMoney
</if>
</if>
</select>
<select id="invoiceAmountList33" resultType="com.jero.statistics.entity.AllMoney">