全所统计

This commit is contained in:
zhangqinlin
2021-09-18 10:45:11 +08:00
parent 2e9a63f4da
commit b4fba29e03
34 changed files with 818 additions and 152 deletions
@@ -4,8 +4,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.member.entity.PayMemberProject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jero.project.entity.PayWorkGroupSubletStatistics;
import com.jero.statistics.entity.AllProjectStatistics;
import com.jero.statistics.entity.AllProjectStatisticsSearch;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Description: 会员项目表
* @Author: jero-boot
@@ -13,6 +18,13 @@ import org.apache.ibatis.annotations.Param;
* @Version: V1.0
*/
public interface PayMemberProjectMapper extends BaseMapper<PayMemberProject> {
/**
* 全所统计
* @param
* @param allProjectStatisticsSearch
* @return
*/
List<AllProjectStatistics> queryPageList3( @Param("allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch);
/**
* @Description 查询与收入合同企业一致的数据
@@ -2,6 +2,11 @@ package com.jero.member.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.project.entity.PayWorkGroupSubletStatistics;
import com.jero.statistics.entity.AllProjectStatistics;
import com.jero.statistics.entity.AllProjectStatisticsSearch;
import org.apache.ibatis.annotations.Param;
import com.jero.member.entity.TbMemberProject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -14,4 +19,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface TbMemberProjectMapper extends BaseMapper<TbMemberProject> {
List<AllProjectStatistics> queryPageList3(@Param("allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch);
}
@@ -16,6 +16,57 @@
<result column="charge_notice_file_id" property="chargeNoticeFileId" />
<result column="remark" property="remark" />
</resultMap>
<select id="queryPageList3" resultType="com.jero.statistics.entity.AllProjectStatistics">
SELECT
pmp.project_name AS projectName,
pmp.director_name as principalName,
pmps.company_name AS chargeCompanyTemporaryName,
pmps.allMoney,
pmps.comeAllMoney,
pmps.charge_use as chargeUse
FROM pay_member_project pmp left join (select id,project_id,company_name,in_account,pack,charge_use,SUM(amount_receivable) AS allMoney,SUM(paid_amount) AS comeAllMoney
from pay_member_project_subitem GROUP BY project_id) pmps on(pmp.id=pmps.project_id)
left join pay_payment_record ppr on(pmps.id=ppr.project_id)
<where>
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
AND pmp.project_name LIKE
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
</if>
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
AND pmps.charge_use=#{allProjectStatisticsSearch.chargeUse}
</if>
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
AND pmps.company_name LIKE
concat('%',concat(#{allProjectStatisticsSearch.chargeCompanyTemporaryName},'%'))
</if>
<if test="allProjectStatisticsSearch.inAccountStatue != null and allProjectStatisticsSearch.inAccountStatue != ''">
AND pmps.in_account=#{allProjectStatisticsSearch.inAccountStatue}
</if>
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
AND date_format(ppr.payment_date,'%Y-%m-%d') LIKE concat('%',concat(#{allProjectStatisticsSearch.year},'%'))
</if>
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
AND pmp.director_id=#{allProjectStatisticsSearch.principalNameId}
</if>
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
AND pmps.pack=#{allProjectStatisticsSearch.pack}
</if>
<choose>
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
AND pmps.allMoney > #{allProjectStatisticsSearch.allMoney} and pmps.allMoney <![CDATA[<]]> #{allProjectStatisticsSearch.allMoneyTwo}
</when>
<otherwise>
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
AND pmps.allMoney > #{allProjectStatisticsSearch.allMoney}
</if>
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
AND pmps.allMoney <![CDATA[<]]> #{allProjectStatisticsSearch.allMoneyTwo}
</if>
</otherwise>
</choose>
</where>
</select>
<select id="queryListByCompany" resultType="com.jero.member.entity.PayMemberProject">
SELECT pmp.*,#{projectType} AS projectType FROM pay_member_project_subitem pmps
LEFT JOIN pay_member_project pmp ON pmp.id = pmps.project_id
@@ -9,4 +9,55 @@
<result column="update_time" property="updateTime" />
<result column="project_name" property="projectName" />
</resultMap>
<select id="queryPageList3" resultType="com.jero.statistics.entity.AllProjectStatistics">
SELECT
tmp.project_name AS projectName,
-- tmp.principal_name as principalName,
tmps.company_name AS chargeCompanyTemporaryName,
tmps.allMoney,
tmps.comeAllMoney,
tmps.charge_use as chargeUse
FROM tb_member_project tmp left join (select id,project_id,company_name,charge_use,in_account,SUM(amount_receivable) AS allMoney,SUM(paid_amount) AS comeAllMoney
from tb_member_project_subitem GROUP BY project_id) tmps on(tmp.id=tmps.project_id)
left join pay_payment_record ppr on(tmps.id=ppr.project_id)
<where>
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
AND tmp.project_name LIKE
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
</if>
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
AND tmps.charge_use=#{allProjectStatisticsSearch.chargeUse}
</if>
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
AND tmps.company_name LIKE
concat('%',concat(#{allProjectStatisticsSearch.chargeCompanyTemporaryName},'%'))
</if>
<if test="allProjectStatisticsSearch.inAccountStatue != null and allProjectStatisticsSearch.inAccountStatue != ''">
AND tmps.in_account=#{allProjectStatisticsSearch.inAccountStatue}
</if>
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
AND date_format(ppr.payment_date,'%Y-%m-%d') LIKE concat('%',concat(#{allProjectStatisticsSearch.year},'%'))
</if>
<!-- <if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">-->
<!-- AND tmp.principal_id=#{allProjectStatisticsSearch.principalNameId}-->
<!-- </if>-->
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
AND tmps.pack=#{allProjectStatisticsSearch.pack}
</if>
<choose>
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
AND tmps.allMoney > #{allProjectStatisticsSearch.allMoney} and tmps.allMoney <![CDATA[<]]> #{allProjectStatisticsSearch.allMoneyTwo}
</when>
<otherwise>
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
AND tmps.allMoney > #{allProjectStatisticsSearch.allMoney}
</if>
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
AND tmps.allMoney <![CDATA[<]]> #{allProjectStatisticsSearch.allMoneyTwo}
</if>
</otherwise>
</choose>
</where>
</select>
</mapper>
@@ -5,6 +5,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.member.entity.PayMemberProject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.project.entity.PayWorkGroupSubletStatistics;
import com.jero.statistics.entity.AllProjectStatistics;
import com.jero.statistics.entity.AllProjectStatisticsSearch;
import com.jero.project.common.PayProjectCommon;
import java.util.List;
@@ -72,6 +76,8 @@ public interface IPayMemberProjectService extends IService<PayMemberProject> {
*/
IPage<PayMemberProject> getPage(Page<PayMemberProject> page, QueryWrapper<PayMemberProject> queryWrapper);
List<AllProjectStatistics> queryPageList3(AllProjectStatisticsSearch allProjectStatisticsSearch);
/**
* @Description 查询与收入合同企业一致的数据
* @Author lqt
@@ -1,7 +1,13 @@
package com.jero.member.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.member.entity.TbMemberProject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.project.entity.PayWorkGroupSubletStatistics;
import com.jero.statistics.entity.AllProjectStatistics;
import com.jero.statistics.entity.AllProjectStatisticsSearch;
import java.util.List;
/**
@@ -58,4 +64,12 @@ public interface ITbMemberProjectService extends IService<TbMemberProject> {
* @return
*/
List<TbMemberProject> queryList();
/**
* 全所统计
* @param
* @param allProjectStatisticsSearch
* @return
*/
List<AllProjectStatistics> queryPageList3(AllProjectStatisticsSearch allProjectStatisticsSearch);
}
@@ -14,6 +14,9 @@ import com.jero.member.service.IPayMemberProjectService;
import com.jero.member.service.IPayMemberProjectSubitemService;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.mapper.SysUserMapper;
import com.jero.project.entity.PayWorkGroupSubletStatistics;
import com.jero.statistics.entity.AllProjectStatistics;
import com.jero.statistics.entity.AllProjectStatisticsSearch;
import com.jero.project.entity.PayWorkingGroupSubItem;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -34,10 +37,11 @@ import javax.annotation.Resource;
*/
@Service
public class PayPayMemberProjectServiceImpl extends ServiceImpl<PayMemberProjectMapper, PayMemberProject> implements IPayMemberProjectService {
@Resource
private PayMemberProjectMapper payMemberProjectMapper;
@Resource
private SysUserMapper userMapper;
@Resource
private PayMemberProjectMapper payMemberProjectMapper;
@Autowired
private IPayIncomeContractAssociatedService payIncomeContractAssociatedService;
@Resource
@@ -163,6 +167,17 @@ public class PayPayMemberProjectServiceImpl extends ServiceImpl<PayMemberProject
return memberProjectPage;
}
/**
* 全所统计
* @param
* @param allProjectStatisticsSearch
* @return
*/
@Override
public List<AllProjectStatistics> queryPageList3( AllProjectStatisticsSearch allProjectStatisticsSearch) {
return payMemberProjectMapper.queryPageList3(allProjectStatisticsSearch);
}
@Override
public IPage<PayMemberProject> queryListByCompany(Page<PayMemberProject> page,String companyId, String memberName, String projectType,Integer pack,String packYear) {
return payMemberProjectMapper.queryListByCompany(page,companyId,memberName,projectType, pack, packYear);
@@ -5,6 +5,8 @@ import com.jero.common.exception.JeroBootException;
import com.jero.contract.entity.PayIncomeContractAssociated;
import com.jero.contract.service.IPayIncomeContractAssociatedService;
import com.jero.member.entity.PayMemberProjectSubitem;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.member.entity.TbMemberProject;
import com.jero.member.entity.TbMemberProjectSubitem;
import com.jero.member.mapper.TbMemberProjectMapper;
@@ -12,6 +14,9 @@ import com.jero.member.service.ITbMemberProjectService;
import com.jero.member.service.ITbMemberProjectSubitemService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.jero.project.entity.PayWorkGroupSubletStatistics;
import com.jero.statistics.entity.AllProjectStatistics;
import com.jero.statistics.entity.AllProjectStatisticsSearch;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
@@ -33,6 +38,8 @@ public class TbMemberProjectServiceImpl extends ServiceImpl<TbMemberProjectMappe
private IPayIncomeContractAssociatedService payIncomeContractAssociatedService;
@Resource
private ITbMemberProjectSubitemService tbMemberProjectSubitemService;
@Resource
private TbMemberProjectMapper tbMemberProjectMapper;
/**
* 保存
*/
@@ -107,4 +114,15 @@ public class TbMemberProjectServiceImpl extends ServiceImpl<TbMemberProjectMappe
public List<TbMemberProject> queryList() {
return list();
}
/**
* 全所查询
* @param
* @param allProjectStatisticsSearch
* @return
*/
@Override
public List<AllProjectStatistics> queryPageList3( AllProjectStatisticsSearch allProjectStatisticsSearch) {
return tbMemberProjectMapper.queryPageList3(allProjectStatisticsSearch);
}
}