update 全所统计改用视图查询
This commit is contained in:
+131
@@ -0,0 +1,131 @@
|
|||||||
|
create view v_statistical as
|
||||||
|
select pp.id as projectId,
|
||||||
|
pp.projectName,
|
||||||
|
principalName,
|
||||||
|
chargeCompanyTemporaryName,
|
||||||
|
allMoney,
|
||||||
|
comeAllMoney,
|
||||||
|
chargeUse,
|
||||||
|
depart,
|
||||||
|
createTime,
|
||||||
|
if(pp.pack = 0, '否', '是') as packText,
|
||||||
|
year,
|
||||||
|
payStatue,
|
||||||
|
departCode,
|
||||||
|
principalNameId,
|
||||||
|
pp.pack
|
||||||
|
from (SELECT pwgs.id,
|
||||||
|
pwg.working_group_project AS projectName,
|
||||||
|
pwg.principal_name_a as principalName,
|
||||||
|
pwgs.charge_company_temporary_name AS chargeCompanyTemporaryName,
|
||||||
|
pwgs.receivable_amount as allMoney,
|
||||||
|
pwgs.paid_amount as comeAllMoney,
|
||||||
|
pwgs.charge_use as chargeUse,
|
||||||
|
sd.depart_name as depart,
|
||||||
|
pwgs.pack as pack,
|
||||||
|
pwg.year as year,
|
||||||
|
pwgs.in_account as payStatue,
|
||||||
|
su.org_code as departCode,
|
||||||
|
pwg.principal_id_a as principalNameId,
|
||||||
|
pwgs.create_time as createTime
|
||||||
|
FROM pay_working_group pwg
|
||||||
|
right join pay_working_group_subitem pwgs on (pwg.id = pwgs.working_group_id)
|
||||||
|
left JOIN sys_user su on (pwg.principal_id_a = su.id)
|
||||||
|
left join sys_depart sd on (su.org_code = sd.org_code)
|
||||||
|
union all
|
||||||
|
SELECT pcp.id,
|
||||||
|
pcp.charge_project AS projectName,
|
||||||
|
pcp.principal_name as principalName,
|
||||||
|
pcp.charge_company_temporary_name AS chargeCompanyTemporaryName,
|
||||||
|
pcp.receivable_amount as allMoney,
|
||||||
|
pcp.paid_amount as comeAllMoney,
|
||||||
|
pcp.charge_use as chargeUse,
|
||||||
|
sd.depart_name as depart,
|
||||||
|
pcp.pack as pack,
|
||||||
|
pcp.year as year,
|
||||||
|
pcp.in_account as payStatue,
|
||||||
|
su.org_code as departCode,
|
||||||
|
pcp.principal_id as principalNameId,
|
||||||
|
pcp.create_time as createTime
|
||||||
|
FROM pay_common_project pcp
|
||||||
|
left JOIN sys_user su on (pcp.principal_id = su.id)
|
||||||
|
left join sys_depart sd on (su.org_code = sd.org_code)
|
||||||
|
union all
|
||||||
|
SELECT pmps.id,
|
||||||
|
pmp.project_name AS projectName,
|
||||||
|
su.realname as principalName,
|
||||||
|
pmps.company_name AS chargeCompanyTemporaryName,
|
||||||
|
pmps.amount_receivable as allMoney,
|
||||||
|
pmps.paid_amount as comeAllMoney,
|
||||||
|
pmps.charge_use as chargeUse,
|
||||||
|
sd.depart_name as depart,
|
||||||
|
pmps.pack as pack,
|
||||||
|
pmp.particular_year as year,
|
||||||
|
pmps.in_account as payStatue,
|
||||||
|
su.org_code as departCode,
|
||||||
|
pmp.director_id as principalNameId,
|
||||||
|
pmps.create_time as createTime
|
||||||
|
FROM pay_member_project pmp
|
||||||
|
right join pay_member_project_subitem pmps on (pmp.id = pmps.project_id)
|
||||||
|
left JOIN sys_user su on (pmp.director_id = su.id)
|
||||||
|
left join sys_depart sd on (su.org_code = sd.org_code)
|
||||||
|
union all
|
||||||
|
SELECT pms.id,
|
||||||
|
pm.meeting_name AS projectName,
|
||||||
|
su.realname as principalName,
|
||||||
|
pms.company_name AS chargeCompanyTemporaryName,
|
||||||
|
pms.amount_receivable as allMoney,
|
||||||
|
pms.paid_amount as comeAllMoney,
|
||||||
|
pms.charge_use as chargeUse,
|
||||||
|
sd.depart_name as depart,
|
||||||
|
pms.pack as pack,
|
||||||
|
pm.particular_year as year,
|
||||||
|
pms.in_account as payStatue,
|
||||||
|
su.org_code as departCode,
|
||||||
|
pm.director_id as principalNameId,
|
||||||
|
pms.create_time as createTime
|
||||||
|
FROM pay_meeting pm
|
||||||
|
right join pay_meeting_situation pms on (pm.id = pms.meeting_id)
|
||||||
|
left JOIN sys_user su on (pm.director_id = su.id)
|
||||||
|
left join sys_depart sd on (su.org_code = sd.org_code)
|
||||||
|
union all
|
||||||
|
SELECT tmps.id,
|
||||||
|
tmp.project_name AS projectName,
|
||||||
|
su.realname as principalName,
|
||||||
|
tmps.company_name AS chargeCompanyTemporaryName,
|
||||||
|
tmps.amount_receivable as allMoney,
|
||||||
|
tmps.paid_amount as comeAllMoney,
|
||||||
|
tmps.charge_use as chargeUse,
|
||||||
|
sd.depart_name as depart,
|
||||||
|
tmps.pack as pack,
|
||||||
|
tmp.year as year,
|
||||||
|
tmps.in_account as payStatue,
|
||||||
|
su.org_code as departCode,
|
||||||
|
tmp.director_id as principalNameId,
|
||||||
|
tmps.create_time as createTime
|
||||||
|
FROM tb_member_project tmp
|
||||||
|
left join tb_member_project_subitem tmps on (tmp.id = tmps.project_id)
|
||||||
|
left JOIN sys_user su on (tmp.director_id = su.id)
|
||||||
|
left join sys_depart sd on (su.org_code = sd.org_code)
|
||||||
|
union all
|
||||||
|
SELECT tcp.id,
|
||||||
|
tmp.project_name AS projectName,
|
||||||
|
su.realname as principalName,
|
||||||
|
tcp.company_name AS chargeCompanyTemporaryName,
|
||||||
|
tcp.amount_receivable as allMoney,
|
||||||
|
tcp.paid_amount as comeAllMoney,
|
||||||
|
tcp.charge_use as chargeUse,
|
||||||
|
sd.depart_name as depart,
|
||||||
|
tcp.pack as pack,
|
||||||
|
tmp.year as year,
|
||||||
|
tcp.in_account as payStatue,
|
||||||
|
su.org_code as departCode,
|
||||||
|
tmp.director_id as principalNameId,
|
||||||
|
tcp.create_time as createTime
|
||||||
|
FROM tb_member_project tmp
|
||||||
|
left join tb_certificate_payment tcp on (tmp.id = tcp.project_id)
|
||||||
|
left JOIN sys_user su on (tmp.director_id = su.id)
|
||||||
|
left join sys_depart sd on (su.org_code = sd.org_code)
|
||||||
|
) pp
|
||||||
|
where pp.allMoney is not null
|
||||||
|
and pp.allMoney != 0
|
||||||
+16
-5
@@ -91,7 +91,7 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
|
|||||||
* @Return
|
* @Return
|
||||||
* @Exception
|
* @Exception
|
||||||
*/
|
*/
|
||||||
List<AllProjectStatistics> queryPageList3(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch);
|
//List<AllProjectStatistics> queryPageList3(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description 全所统计
|
* @Description 全所统计
|
||||||
@@ -101,7 +101,8 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
|
|||||||
* @Return
|
* @Return
|
||||||
* @Exception
|
* @Exception
|
||||||
*/
|
*/
|
||||||
List<AllProjectStatistics> queryPageList3(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch,List<String> idList);
|
List<AllProjectStatistics> queryPageList3(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch, @Param("idList") List<String> idList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description 企业来款查询和全所统计
|
* @Description 企业来款查询和全所统计
|
||||||
* @Author zql
|
* @Author zql
|
||||||
@@ -111,12 +112,13 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
|
|||||||
* @Exception
|
* @Exception
|
||||||
*/
|
*/
|
||||||
IPage<AllProjectStatistics> queryPageList3(Page<AllProjectStatistics> page, @Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch, @Param("idList") List<String> idList);
|
IPage<AllProjectStatistics> queryPageList3(Page<AllProjectStatistics> page, @Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch, @Param("idList") List<String> idList);
|
||||||
List<AllProjectStatistics> queryPageListExcel(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch,@Param("idList") List<String> idList,@Param("ids") List<String> ids);
|
|
||||||
|
|
||||||
|
List<AllProjectStatistics> queryPageListExcel(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch, @Param("idList") List<String> idList, @Param("ids") List<String> ids);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人来款统计
|
* 个人来款统计
|
||||||
|
*
|
||||||
* @param page
|
* @param page
|
||||||
* @param principalPeopleSearch
|
* @param principalPeopleSearch
|
||||||
* @param idList
|
* @param idList
|
||||||
@@ -126,18 +128,23 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人来款统计导出excel
|
* 个人来款统计导出excel
|
||||||
|
*
|
||||||
* @param idList
|
* @param idList
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<PrincipalPeopleList> queryPageListForPrincipal(@Param("principalPeopleSearch") PrincipalPeopleSearch principalPeopleSearch, @Param("idList") List<String> idList);
|
List<PrincipalPeopleList> queryPageListForPrincipal(@Param("principalPeopleSearch") PrincipalPeopleSearch principalPeopleSearch, @Param("idList") List<String> idList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人来款统计详情导出
|
* 个人来款统计详情导出
|
||||||
|
*
|
||||||
* @param principalPeopleDetailSearch
|
* @param principalPeopleDetailSearch
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<PrincipalPeopleDetail> queryPageListForPrincipalDetail(@Param("principalPeopleDetailSearch") PrincipalPeopleDetailSearch principalPeopleDetailSearch);
|
List<PrincipalPeopleDetail> queryPageListForPrincipalDetail(@Param("principalPeopleDetailSearch") PrincipalPeopleDetailSearch principalPeopleDetailSearch);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人来款统计详情
|
* 个人来款统计详情
|
||||||
|
*
|
||||||
* @param page
|
* @param page
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -145,22 +152,27 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业来款统计
|
* 企业来款统计
|
||||||
|
*
|
||||||
* @param page
|
* @param page
|
||||||
* @param companyComeMoneySearch
|
* @param companyComeMoneySearch
|
||||||
* @param idList
|
* @param idList
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
IPage<CompanyComeMoneyList> queryPageListForCompany(Page<CompanyComeMoneyList> page, @Param("companyComeMoneySearch") CompanyComeMoneySearch companyComeMoneySearch, @Param("idList") List<String> idList);
|
IPage<CompanyComeMoneyList> queryPageListForCompany(Page<CompanyComeMoneyList> page, @Param("companyComeMoneySearch") CompanyComeMoneySearch companyComeMoneySearch, @Param("idList") List<String> idList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业来款统计
|
* 企业来款统计
|
||||||
|
*
|
||||||
* @param
|
* @param
|
||||||
* @param companyComeMoneySearch
|
* @param companyComeMoneySearch
|
||||||
* @param idList
|
* @param idList
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<CompanyComeMoneyList> queryPageListForCompany(@Param("companyComeMoneySearch") CompanyComeMoneySearch companyComeMoneySearch, @Param("idList") List<String> idList);
|
List<CompanyComeMoneyList> queryPageListForCompany(@Param("companyComeMoneySearch") CompanyComeMoneySearch companyComeMoneySearch, @Param("idList") List<String> idList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业来款详情
|
* 企业来款详情
|
||||||
|
*
|
||||||
* @param page
|
* @param page
|
||||||
* @param companyComeMoneyDetailSearch
|
* @param companyComeMoneyDetailSearch
|
||||||
* @return
|
* @return
|
||||||
@@ -170,6 +182,7 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业来款详情导出
|
* 企业来款详情导出
|
||||||
|
*
|
||||||
* @param
|
* @param
|
||||||
* @param companyComeMoneyDetailSearch
|
* @param companyComeMoneyDetailSearch
|
||||||
* @return
|
* @return
|
||||||
@@ -177,8 +190,6 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
|
|||||||
List<CompanyComeMoneyDetail> queryPageListForCompanyDetail(@Param("CompanyComeMoneyDetailSearch") CompanyComeMoneyDetailSearch companyComeMoneyDetailSearch, @Param("idList") List<String> idList);
|
List<CompanyComeMoneyDetail> queryPageListForCompanyDetail(@Param("CompanyComeMoneyDetailSearch") CompanyComeMoneyDetailSearch companyComeMoneyDetailSearch, @Param("idList") List<String> idList);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<PrincipalPeopleList> queryPageListForPrincipalFirstPage();
|
List<PrincipalPeopleList> queryPageListForPrincipalFirstPage();
|
||||||
|
|
||||||
List<PayWorkingGroupStatistics> queryPageListForStatisticsFirstPage();
|
List<PayWorkingGroupStatistics> queryPageListForStatisticsFirstPage();
|
||||||
|
|||||||
+34
-805
@@ -325,885 +325,114 @@
|
|||||||
|
|
||||||
<!-- 全所统计-->
|
<!-- 全所统计-->
|
||||||
<select id="queryPageList3" resultType="com.jero.statistics.entity.AllProjectStatistics">
|
<select id="queryPageList3" resultType="com.jero.statistics.entity.AllProjectStatistics">
|
||||||
select pp.id as projectId,pp.projectName, principalName, chargeCompanyTemporaryName, allMoney, comeAllMoney, chargeUse, depart, createTime,if(pp.pack=0,'否','是') as packText,pp.pack from
|
select projectId,projectName, principalName, chargeCompanyTemporaryName, allMoney, comeAllMoney, chargeUse, depart, createTime, packText,pack
|
||||||
(SELECT
|
from v_statistical
|
||||||
pwgs.id,
|
|
||||||
pwg.working_group_project AS projectName,
|
|
||||||
pwg.principal_name_a as principalName,
|
|
||||||
pwgs.charge_company_temporary_name AS chargeCompanyTemporaryName,
|
|
||||||
pwgs.receivable_amount as allMoney,
|
|
||||||
pwgs.paid_amount as comeAllMoney,
|
|
||||||
pwgs.charge_use as chargeUse,
|
|
||||||
sd.depart_name as depart,
|
|
||||||
pwgs.pack as pack,
|
|
||||||
pwgs.create_time as createTime
|
|
||||||
FROM pay_working_group pwg right join pay_working_group_subitem pwgs on(pwg.id=pwgs.working_group_id)
|
|
||||||
left JOIN sys_user su on(pwg.principal_id_a=su.id) left join sys_depart sd on(su.org_code=sd.org_code)
|
|
||||||
<where>
|
<where>
|
||||||
<if test="idList != null and idList != ''">
|
<if test="idList != null and idList != ''">
|
||||||
pwg.principal_id_a in
|
principalNameId in
|
||||||
<foreach item="item" open="(" separator="," close=")" collection="idList">
|
<foreach item="item" open="(" separator="," close=")" collection="idList">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
|
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
|
||||||
AND pwg.working_group_project LIKE
|
AND projectName LIKE
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
|
concat('%', #{allProjectStatisticsSearch.projectName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
|
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
|
||||||
AND pwg.year LIKE
|
AND year LIKE
|
||||||
concat(#{allProjectStatisticsSearch.year}, '%')
|
concat(#{allProjectStatisticsSearch.year}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
|
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
|
||||||
AND pwgs.in_account LIKE
|
AND payStatue LIKE
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.payStatue},'%'))
|
concat('%', #{allProjectStatisticsSearch.payStatue}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
|
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
|
||||||
AND su.org_code =#{allProjectStatisticsSearch.departCode}
|
AND departCode = #{allProjectStatisticsSearch.departCode}
|
||||||
</if>
|
</if>
|
||||||
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
|
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
|
||||||
AND pwgs.charge_use=#{allProjectStatisticsSearch.chargeUse}
|
AND chargeUse = #{allProjectStatisticsSearch.chargeUse}
|
||||||
</if>
|
</if>
|
||||||
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
|
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
|
||||||
AND pwgs.charge_company_temporary_name LIKE
|
AND chargeCompanyTemporaryName LIKE
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.chargeCompanyTemporaryName},'%'))
|
concat('%', #{allProjectStatisticsSearch.chargeCompanyTemporaryName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
|
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
|
||||||
AND pwg.principal_id_a=#{allProjectStatisticsSearch.principalNameId}
|
AND principalNameId = #{allProjectStatisticsSearch.principalNameId}
|
||||||
</if>
|
</if>
|
||||||
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
|
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
|
||||||
AND pwgs.pack=#{allProjectStatisticsSearch.pack}
|
AND pack = #{allProjectStatisticsSearch.pack}
|
||||||
</if>
|
</if>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
||||||
AND pwgs.receivable_amount >= #{allProjectStatisticsSearch.allMoney} and pwgs.receivable_amount <![CDATA[<]]>=
|
AND allMoney >= #{allProjectStatisticsSearch.allMoney}
|
||||||
|
and allMoney <![CDATA[<]]>=
|
||||||
#{allProjectStatisticsSearch.allMoneyTwo}
|
#{allProjectStatisticsSearch.allMoneyTwo}
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
|
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
|
||||||
AND pwgs.receivable_amount >= #{allProjectStatisticsSearch.allMoney}
|
AND allMoney >= #{allProjectStatisticsSearch.allMoney}
|
||||||
</if>
|
</if>
|
||||||
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
||||||
AND pwgs.receivable_amount <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
|
AND allMoney <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
|
||||||
</if>
|
</if>
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
union all
|
|
||||||
SELECT
|
|
||||||
pcp.id,
|
|
||||||
pcp.charge_project AS projectName,
|
|
||||||
pcp.principal_name as principalName,
|
|
||||||
pcp.charge_company_temporary_name AS chargeCompanyTemporaryName,
|
|
||||||
pcp.receivable_amount as allMoney,
|
|
||||||
pcp.paid_amount as comeAllMoney,
|
|
||||||
pcp.charge_use as chargeUse,
|
|
||||||
sd.depart_name as depart,
|
|
||||||
pcp.pack as pack,
|
|
||||||
pcp.create_time as createTime
|
|
||||||
FROM pay_common_project pcp left JOIN sys_user su on(pcp.principal_id=su.id) left join sys_depart sd
|
|
||||||
on(su.org_code=sd.org_code)
|
|
||||||
<where>
|
|
||||||
<if test="idList != null and idList != ''">
|
|
||||||
pcp.principal_id in
|
|
||||||
<foreach item="item" open="(" separator="," close=")" collection="idList">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
|
|
||||||
AND pcp.charge_project LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
|
|
||||||
AND pcp.year LIKE
|
|
||||||
concat(#{allProjectStatisticsSearch.year},'%')
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
|
|
||||||
AND pcp.in_account LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.payStatue},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
|
|
||||||
AND pcp.charge_company_temporary_name LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.chargeCompanyTemporaryName},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
|
|
||||||
AND su.org_code =#{allProjectStatisticsSearch.departCode}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
|
|
||||||
AND pcp.charge_use=#{allProjectStatisticsSearch.chargeUse}
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
|
|
||||||
AND pcp.principal_id=#{allProjectStatisticsSearch.principalNameId}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
|
|
||||||
AND pcp.pack=#{allProjectStatisticsSearch.pack}
|
|
||||||
</if>
|
|
||||||
<choose>
|
|
||||||
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
|
||||||
AND pcp.receivable_amount >= #{allProjectStatisticsSearch.allMoney} and pcp.receivable_amount
|
|
||||||
<![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</when>
|
|
||||||
<otherwise>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
|
|
||||||
AND pcp.receivable_amount >= #{allProjectStatisticsSearch.allMoney}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
|
||||||
AND pcp.receivable_amount <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</if>
|
|
||||||
</otherwise>
|
|
||||||
</choose>
|
|
||||||
</where>
|
|
||||||
union all
|
|
||||||
SELECT
|
|
||||||
pmps.id,
|
|
||||||
pmp.project_name AS projectName,
|
|
||||||
su.realname as principalName,
|
|
||||||
pmps.company_name AS chargeCompanyTemporaryName,
|
|
||||||
pmps.amount_receivable as allMoney,
|
|
||||||
pmps.paid_amount as comeAllMoney,
|
|
||||||
pmps.charge_use as chargeUse,
|
|
||||||
sd.depart_name as depart,
|
|
||||||
pmps.pack as pack,
|
|
||||||
pmps.create_time as createTime
|
|
||||||
FROM pay_member_project pmp right join pay_member_project_subitem pmps on(pmp.id=pmps.project_id)
|
|
||||||
left JOIN sys_user su on(pmp.director_id=su.id) left join sys_depart sd on(su.org_code=sd.org_code)
|
|
||||||
<where>
|
|
||||||
<if test="idList != null and idList != ''">
|
|
||||||
pmp.director_id in
|
|
||||||
<foreach item="item" open="(" separator="," close=")" collection="idList">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
|
|
||||||
AND pmp.project_name LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
|
|
||||||
AND pmp.particular_year LIKE
|
|
||||||
concat(#{allProjectStatisticsSearch.year},'%')
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
|
|
||||||
AND pmps.in_account LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.payStatue},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
|
|
||||||
AND su.org_code =#{allProjectStatisticsSearch.departCode}
|
|
||||||
</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.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.amount_receivable >= #{allProjectStatisticsSearch.allMoney} and pmps.amount_receivable <![CDATA[<]]>=
|
|
||||||
#{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</when>
|
|
||||||
<otherwise>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
|
|
||||||
AND pmps.amount_receivable >= #{allProjectStatisticsSearch.allMoney}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
|
||||||
AND pmps.amount_receivable <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</if>
|
|
||||||
</otherwise>
|
|
||||||
</choose>
|
|
||||||
</where>
|
|
||||||
union all
|
|
||||||
SELECT
|
|
||||||
pms.id,
|
|
||||||
pm.meeting_name AS projectName,
|
|
||||||
su.realname as principalName,
|
|
||||||
pms.company_name AS chargeCompanyTemporaryName,
|
|
||||||
pms.amount_receivable as allMoney,
|
|
||||||
pms.paid_amount as comeAllMoney,
|
|
||||||
pms.charge_use as chargeUse,
|
|
||||||
sd.depart_name as depart,
|
|
||||||
pms.pack as pack,
|
|
||||||
pms.create_time as createTime
|
|
||||||
FROM pay_meeting pm right join pay_meeting_situation pms on(pm.id=pms.meeting_id)
|
|
||||||
left JOIN sys_user su on(pm.director_id=su.id) left join sys_depart sd on(su.org_code=sd.org_code)
|
|
||||||
<where>
|
|
||||||
<if test="idList != null and idList != ''">
|
|
||||||
pm.director_id in
|
|
||||||
<foreach item="item" open="(" separator="," close=")" collection="idList">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
|
|
||||||
AND pm.meeting_name LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
|
|
||||||
AND pm.particular_year LIKE
|
|
||||||
concat(#{allProjectStatisticsSearch.year},'%')
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
|
|
||||||
AND pms.in_account LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.payStatue},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
|
|
||||||
AND su.org_code =#{allProjectStatisticsSearch.departCode}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
|
|
||||||
AND pms.charge_use=#{allProjectStatisticsSearch.chargeUse}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
|
|
||||||
AND pms.company_name LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.chargeCompanyTemporaryName},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
|
|
||||||
AND pm.director_id=#{allProjectStatisticsSearch.principalNameId}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
|
|
||||||
AND pms.pack=#{allProjectStatisticsSearch.pack}
|
|
||||||
</if>
|
|
||||||
<choose>
|
|
||||||
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
|
||||||
AND pms.amount_receivable >= #{allProjectStatisticsSearch.allMoney} and pms.amount_receivable <![CDATA[<]]>=
|
|
||||||
#{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</when>
|
|
||||||
<otherwise>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
|
|
||||||
AND pms.amount_receivable >= #{allProjectStatisticsSearch.allMoney}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
|
||||||
AND pms.amount_receivable <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</if>
|
|
||||||
</otherwise>
|
|
||||||
</choose>
|
|
||||||
</where>
|
|
||||||
union all
|
|
||||||
SELECT
|
|
||||||
tmps.id,
|
|
||||||
tmp.project_name AS projectName,
|
|
||||||
su.realname as principalName,
|
|
||||||
tmps.company_name AS chargeCompanyTemporaryName,
|
|
||||||
tmps.amount_receivable as allMoney,
|
|
||||||
tmps.paid_amount as comeAllMoney,
|
|
||||||
tmps.charge_use as chargeUse,
|
|
||||||
sd.depart_name as depart,
|
|
||||||
tmps.pack as pack,
|
|
||||||
tmps.create_time as createTime
|
|
||||||
FROM tb_member_project tmp left join tb_member_project_subitem tmps on(tmp.id=tmps.project_id)
|
|
||||||
left JOIN sys_user su on(tmp.director_id=su.id) left join sys_depart sd on(su.org_code=sd.org_code)
|
|
||||||
<where>
|
|
||||||
<if test="idList != null and idList != ''">
|
|
||||||
tmp.director_id in
|
|
||||||
<foreach item="item" open="(" separator="," close=")" collection="idList">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
|
|
||||||
AND tmp.project_name LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
|
|
||||||
AND tmp.year LIKE
|
|
||||||
concat(#{allProjectStatisticsSearch.year},'%')
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
|
|
||||||
AND tmps.in_account LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.payStatue},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
|
|
||||||
AND tmp.director_id=#{allProjectStatisticsSearch.principalNameId}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
|
|
||||||
AND su.org_code =#{allProjectStatisticsSearch.departCode}
|
|
||||||
</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.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.amount_receivable >= #{allProjectStatisticsSearch.allMoney} and tmps.amount_receivable <![CDATA[<]]>=
|
|
||||||
#{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</when>
|
|
||||||
<otherwise>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
|
|
||||||
AND tmps.amount_receivable >= #{allProjectStatisticsSearch.allMoney}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
|
||||||
AND tmps.amount_receivable <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</if>
|
|
||||||
</otherwise>
|
|
||||||
</choose>
|
|
||||||
</where>
|
|
||||||
union all
|
|
||||||
SELECT
|
|
||||||
tcp.id,
|
|
||||||
tmp.project_name AS projectName,
|
|
||||||
su.realname as principalName,
|
|
||||||
tcp.company_name AS chargeCompanyTemporaryName,
|
|
||||||
tcp.amount_receivable as allMoney,
|
|
||||||
tcp.paid_amount as comeAllMoney,
|
|
||||||
tcp.charge_use as chargeUse,
|
|
||||||
sd.depart_name as depart,
|
|
||||||
tcp.pack as pack,
|
|
||||||
tcp.create_time as createTime
|
|
||||||
FROM tb_member_project tmp left join tb_certificate_payment tcp on(tmp.id=tcp.project_id)
|
|
||||||
left JOIN sys_user su on(tmp.director_id=su.id) left join sys_depart sd on(su.org_code=sd.org_code)
|
|
||||||
<where>
|
|
||||||
<if test="idList != null and idList != ''">
|
|
||||||
tmp.director_id in
|
|
||||||
<foreach item="item" open="(" separator="," close=")" collection="idList">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
|
|
||||||
AND tmp.project_name LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
|
|
||||||
AND tmp.year LIKE
|
|
||||||
concat(#{allProjectStatisticsSearch.year},'%')
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
|
|
||||||
AND tcp.in_account LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.payStatue},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
|
|
||||||
AND tmp.director_id=#{allProjectStatisticsSearch.principalNameId}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
|
|
||||||
AND su.org_code =#{allProjectStatisticsSearch.departCode}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
|
|
||||||
AND tcp.charge_use=#{allProjectStatisticsSearch.chargeUse}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
|
|
||||||
AND tcp.company_name LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.chargeCompanyTemporaryName},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
|
|
||||||
AND tcp.pack=#{allProjectStatisticsSearch.pack}
|
|
||||||
</if>
|
|
||||||
<choose>
|
|
||||||
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
|
||||||
AND tcp.amount_receivable >= #{allProjectStatisticsSearch.allMoney} and tcp.amount_receivable <![CDATA[<]]>=
|
|
||||||
#{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</when>
|
|
||||||
<otherwise>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
|
|
||||||
AND tcp.amount_receivable >= #{allProjectStatisticsSearch.allMoney}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
|
||||||
AND tcp.amount_receivable <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</if>
|
|
||||||
</otherwise>
|
|
||||||
</choose>
|
|
||||||
</where>) pp where pp.allMoney is not null and pp.allMoney !=0
|
|
||||||
<!-- pp left join-->
|
|
||||||
<!-- (-->
|
|
||||||
<!-- select pwgs.id as id,max(ppr.payment_date) as payment_date-->
|
|
||||||
<!-- from pay_working_group_subitem pwgs-->
|
|
||||||
<!-- inner join pay_payment_record ppr on(pwgs.id=ppr.project_id)-->
|
|
||||||
<!-- <if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">-->
|
|
||||||
<!-- WHERE ppr.payment_date like-->
|
|
||||||
<!-- concat('%',#{allProjectStatisticsSearch.year},'%')-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<!-- GROUP BY pwgs.id-->
|
|
||||||
<!-- union ALL-->
|
|
||||||
<!-- SELECT-->
|
|
||||||
<!-- pcp.id as id,max(ppr.payment_date) as payment_date-->
|
|
||||||
<!-- FROM pay_common_project pcp inner JOIN pay_payment_record ppr on(pcp.id=ppr.project_id)-->
|
|
||||||
<!-- <if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">-->
|
|
||||||
<!-- WHERE ppr.payment_date like-->
|
|
||||||
<!-- concat('%',#{allProjectStatisticsSearch.year},'%')-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<!-- group by pcp.id-->
|
|
||||||
<!-- union all-->
|
|
||||||
<!-- SELECT-->
|
|
||||||
<!-- pmps.id as id,max(ppr.payment_date) as payment_date from-->
|
|
||||||
<!-- pay_member_project_subitem pmps inner join pay_payment_record ppr on(pmps.id=ppr.project_id)-->
|
|
||||||
<!-- <if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">-->
|
|
||||||
<!-- WHERE ppr.payment_date like-->
|
|
||||||
<!-- concat('%',#{allProjectStatisticsSearch.year},'%')-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<!-- group by pmps.id-->
|
|
||||||
<!-- union all-->
|
|
||||||
<!-- SELECT-->
|
|
||||||
<!-- pms.id,max(ppr.payment_date) as payment_date from pay_meeting_situation pms inner join pay_payment_record ppr on(pms.id=ppr.project_id)-->
|
|
||||||
<!-- <if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">-->
|
|
||||||
<!-- WHERE ppr.payment_date like-->
|
|
||||||
<!-- concat('%',#{allProjectStatisticsSearch.year},'%')-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<!-- group by pms.id-->
|
|
||||||
<!-- union all-->
|
|
||||||
<!-- SELECT-->
|
|
||||||
<!-- tmps.id,max(ppr.payment_date) as payment_date from tb_member_project_subitem tmps inner join pay_payment_record ppr on(tmps.id=ppr.project_id)-->
|
|
||||||
<!-- <if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">-->
|
|
||||||
<!-- WHERE ppr.payment_date like-->
|
|
||||||
<!-- concat('%',#{allProjectStatisticsSearch.year},'%')-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<!-- group by tmps.id-->
|
|
||||||
<!-- union all-->
|
|
||||||
<!-- SELECT-->
|
|
||||||
<!-- tcp.id,max(ppr.payment_date) as payment_date from tb_certificate_payment tcp inner join pay_payment_record ppr on(tcp.id=ppr.project_id)-->
|
|
||||||
<!-- <if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">-->
|
|
||||||
<!-- WHERE ppr.payment_date like-->
|
|
||||||
<!-- concat('%',#{allProjectStatisticsSearch.year},'%')-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<!-- group by tcp.id-->
|
|
||||||
<!-- ) pprr on(pp.id=pprr.id) group by pp.id order by pprr.payment_date desc-->
|
|
||||||
</select>
|
</select>
|
||||||
<!-- 全所统计总金额统计-->
|
<!-- 全所统计总金额统计-->
|
||||||
<select id="queryPageList33" resultType="com.jero.statistics.entity.AllMoney">
|
<select id="queryPageList33" resultType="com.jero.statistics.entity.AllMoney">
|
||||||
select sum(allMoney) as allMoney, sum(comeAllMoney) as comeAllMoney from
|
select sum(allMoney) as allMoney, sum(comeAllMoney) as comeAllMoney from
|
||||||
(SELECT
|
v_statistical
|
||||||
pwgs.id,
|
|
||||||
pwg.working_group_project AS projectName,
|
|
||||||
pwg.principal_name_a as principalName,
|
|
||||||
pwgs.charge_company_temporary_name AS chargeCompanyTemporaryName,
|
|
||||||
pwgs.receivable_amount as allMoney,
|
|
||||||
pwgs.paid_amount as comeAllMoney,
|
|
||||||
pwgs.charge_use as chargeUse,
|
|
||||||
sd.depart_name as depart,
|
|
||||||
pwgs.pack as pack,
|
|
||||||
pwgs.create_time as createTime
|
|
||||||
FROM pay_working_group pwg right join pay_working_group_subitem pwgs on(pwg.id=pwgs.working_group_id)
|
|
||||||
left JOIN sys_user su on(pwg.principal_id_a=su.id) left join sys_depart sd on(su.org_code=sd.org_code)
|
|
||||||
<where>
|
<where>
|
||||||
<if test="idList != null and idList != ''">
|
<if test="idList != null and idList != ''">
|
||||||
pwg.principal_id_a in
|
principalNameId in
|
||||||
<foreach item="item" open="(" separator="," close=")" collection="idList">
|
<foreach item="item" open="(" separator="," close=")" collection="idList">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
|
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
|
||||||
AND pwg.working_group_project LIKE
|
AND projectName LIKE
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
|
concat('%',#{allProjectStatisticsSearch.projectName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
|
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
|
||||||
AND pwg.year LIKE
|
AND year LIKE
|
||||||
concat(#{allProjectStatisticsSearch.year},'%')
|
concat(#{allProjectStatisticsSearch.year},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
|
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
|
||||||
AND pwgs.in_account LIKE
|
AND payStatue LIKE
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.payStatue},'%'))
|
concat('%',#{allProjectStatisticsSearch.payStatue},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
|
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
|
||||||
AND su.org_code =#{allProjectStatisticsSearch.departCode}
|
AND departCode =#{allProjectStatisticsSearch.departCode}
|
||||||
</if>
|
</if>
|
||||||
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
|
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
|
||||||
AND pwgs.charge_use=#{allProjectStatisticsSearch.chargeUse}
|
AND chargeUse=#{allProjectStatisticsSearch.chargeUse}
|
||||||
</if>
|
</if>
|
||||||
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
|
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
|
||||||
AND pwgs.charge_company_temporary_name LIKE
|
AND chargeCompanyTemporaryName LIKE
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.chargeCompanyTemporaryName},'%'))
|
concat('%',#{allProjectStatisticsSearch.chargeCompanyTemporaryName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
|
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
|
||||||
AND pwg.principal_id_a=#{allProjectStatisticsSearch.principalNameId}
|
AND principalNameId=#{allProjectStatisticsSearch.principalNameId}
|
||||||
</if>
|
</if>
|
||||||
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
|
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
|
||||||
AND pwgs.pack=#{allProjectStatisticsSearch.pack}
|
AND pack=#{allProjectStatisticsSearch.pack}
|
||||||
</if>
|
</if>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
||||||
AND pwgs.receivable_amount >= #{allProjectStatisticsSearch.allMoney} and pwgs.receivable_amount <![CDATA[<]]>=
|
AND allMoney >= #{allProjectStatisticsSearch.allMoney} and allMoney <![CDATA[<]]>=
|
||||||
#{allProjectStatisticsSearch.allMoneyTwo}
|
#{allProjectStatisticsSearch.allMoneyTwo}
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
|
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
|
||||||
AND pwgs.receivable_amount >= #{allProjectStatisticsSearch.allMoney}
|
AND allMoney >= #{allProjectStatisticsSearch.allMoney}
|
||||||
</if>
|
</if>
|
||||||
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
||||||
AND pwgs.receivable_amount <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
|
AND allMoney <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
|
||||||
</if>
|
</if>
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
union all
|
|
||||||
SELECT
|
|
||||||
pcp.id,
|
|
||||||
pcp.charge_project AS projectName,
|
|
||||||
pcp.principal_name as principalName,
|
|
||||||
pcp.charge_company_temporary_name AS chargeCompanyTemporaryName,
|
|
||||||
pcp.receivable_amount as allMoney,
|
|
||||||
pcp.paid_amount as comeAllMoney,
|
|
||||||
pcp.charge_use as chargeUse,
|
|
||||||
sd.depart_name as depart,
|
|
||||||
pcp.pack as pack,
|
|
||||||
pcp.create_time as createTime
|
|
||||||
FROM pay_common_project pcp left JOIN sys_user su on(pcp.principal_id=su.id) left join sys_depart sd
|
|
||||||
on(su.org_code=sd.org_code)
|
|
||||||
<where>
|
|
||||||
<if test="idList != null and idList != ''">
|
|
||||||
pcp.principal_id in
|
|
||||||
<foreach item="item" open="(" separator="," close=")" collection="idList">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
|
|
||||||
AND pcp.charge_project LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
|
|
||||||
AND pcp.year LIKE
|
|
||||||
concat(#{allProjectStatisticsSearch.year},'%')
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
|
|
||||||
AND pcp.in_account LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.payStatue},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
|
|
||||||
AND pcp.charge_company_temporary_name LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.chargeCompanyTemporaryName},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
|
|
||||||
AND su.org_code =#{allProjectStatisticsSearch.departCode}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
|
|
||||||
AND pcp.charge_use=#{allProjectStatisticsSearch.chargeUse}
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
|
|
||||||
AND pcp.principal_id=#{allProjectStatisticsSearch.principalNameId}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
|
|
||||||
AND pcp.pack=#{allProjectStatisticsSearch.pack}
|
|
||||||
</if>
|
|
||||||
<choose>
|
|
||||||
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
|
||||||
AND pcp.receivable_amount >= #{allProjectStatisticsSearch.allMoney} and pcp.receivable_amount
|
|
||||||
<![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</when>
|
|
||||||
<otherwise>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
|
|
||||||
AND pcp.receivable_amount >= #{allProjectStatisticsSearch.allMoney}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
|
||||||
AND pcp.receivable_amount <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</if>
|
|
||||||
</otherwise>
|
|
||||||
</choose>
|
|
||||||
</where>
|
|
||||||
union all
|
|
||||||
SELECT
|
|
||||||
pmps.id,
|
|
||||||
pmp.project_name AS projectName,
|
|
||||||
su.realname as principalName,
|
|
||||||
pmps.company_name AS chargeCompanyTemporaryName,
|
|
||||||
pmps.amount_receivable as allMoney,
|
|
||||||
pmps.paid_amount as comeAllMoney,
|
|
||||||
pmps.charge_use as chargeUse,
|
|
||||||
sd.depart_name as depart,
|
|
||||||
pmps.pack as pack,
|
|
||||||
pmps.create_time as createTime
|
|
||||||
FROM pay_member_project pmp right join pay_member_project_subitem pmps on(pmp.id=pmps.project_id)
|
|
||||||
left JOIN sys_user su on(pmp.director_id=su.id) left join sys_depart sd on(su.org_code=sd.org_code)
|
|
||||||
<where>
|
|
||||||
<if test="idList != null and idList != ''">
|
|
||||||
pmp.director_id in
|
|
||||||
<foreach item="item" open="(" separator="," close=")" collection="idList">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
|
|
||||||
AND pmp.project_name LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
|
|
||||||
AND pmp.particular_year LIKE
|
|
||||||
concat(#{allProjectStatisticsSearch.year},'%')
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
|
|
||||||
AND pmps.in_account LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.payStatue},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
|
|
||||||
AND su.org_code =#{allProjectStatisticsSearch.departCode}
|
|
||||||
</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.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.amount_receivable >= #{allProjectStatisticsSearch.allMoney} and pmps.amount_receivable <![CDATA[<]]>=
|
|
||||||
#{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</when>
|
|
||||||
<otherwise>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
|
|
||||||
AND pmps.amount_receivable >= #{allProjectStatisticsSearch.allMoney}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
|
||||||
AND pmps.amount_receivable <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</if>
|
|
||||||
</otherwise>
|
|
||||||
</choose>
|
|
||||||
</where>
|
|
||||||
union all
|
|
||||||
SELECT
|
|
||||||
pms.id,
|
|
||||||
pm.meeting_name AS projectName,
|
|
||||||
su.realname as principalName,
|
|
||||||
pms.company_name AS chargeCompanyTemporaryName,
|
|
||||||
pms.amount_receivable as allMoney,
|
|
||||||
pms.paid_amount as comeAllMoney,
|
|
||||||
pms.charge_use as chargeUse,
|
|
||||||
sd.depart_name as depart,
|
|
||||||
pms.pack as pack,
|
|
||||||
pms.create_time as createTime
|
|
||||||
FROM pay_meeting pm right join pay_meeting_situation pms on(pm.id=pms.meeting_id)
|
|
||||||
left JOIN sys_user su on(pm.director_id=su.id) left join sys_depart sd on(su.org_code=sd.org_code)
|
|
||||||
<where>
|
|
||||||
<if test="idList != null and idList != ''">
|
|
||||||
pm.director_id in
|
|
||||||
<foreach item="item" open="(" separator="," close=")" collection="idList">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
|
|
||||||
AND pm.meeting_name LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
|
|
||||||
AND pm.particular_year LIKE
|
|
||||||
concat(#{allProjectStatisticsSearch.year},'%')
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
|
|
||||||
AND pms.in_account LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.payStatue},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
|
|
||||||
AND su.org_code =#{allProjectStatisticsSearch.departCode}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
|
|
||||||
AND pms.charge_use=#{allProjectStatisticsSearch.chargeUse}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
|
|
||||||
AND pms.company_name LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.chargeCompanyTemporaryName},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
|
|
||||||
AND pm.director_id=#{allProjectStatisticsSearch.principalNameId}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
|
|
||||||
AND pms.pack=#{allProjectStatisticsSearch.pack}
|
|
||||||
</if>
|
|
||||||
<choose>
|
|
||||||
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
|
||||||
AND pms.amount_receivable >= #{allProjectStatisticsSearch.allMoney} and pms.amount_receivable <![CDATA[<]]>=
|
|
||||||
#{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</when>
|
|
||||||
<otherwise>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
|
|
||||||
AND pms.amount_receivable >= #{allProjectStatisticsSearch.allMoney}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
|
||||||
AND pms.amount_receivable <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</if>
|
|
||||||
</otherwise>
|
|
||||||
</choose>
|
|
||||||
</where>
|
|
||||||
union all
|
|
||||||
SELECT
|
|
||||||
tmps.id,
|
|
||||||
tmp.project_name AS projectName,
|
|
||||||
su.realname as principalName,
|
|
||||||
tmps.company_name AS chargeCompanyTemporaryName,
|
|
||||||
tmps.amount_receivable as allMoney,
|
|
||||||
tmps.paid_amount as comeAllMoney,
|
|
||||||
tmps.charge_use as chargeUse,
|
|
||||||
sd.depart_name as depart,
|
|
||||||
tmps.pack as pack,
|
|
||||||
tmps.create_time as createTime
|
|
||||||
FROM tb_member_project tmp left join tb_member_project_subitem tmps on(tmp.id=tmps.project_id)
|
|
||||||
left JOIN sys_user su on(tmp.director_id=su.id) left join sys_depart sd on(su.org_code=sd.org_code)
|
|
||||||
<where>
|
|
||||||
<if test="idList != null and idList != ''">
|
|
||||||
tmp.director_id in
|
|
||||||
<foreach item="item" open="(" separator="," close=")" collection="idList">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
|
|
||||||
AND tmp.project_name LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
|
|
||||||
AND tmp.year LIKE
|
|
||||||
concat(#{allProjectStatisticsSearch.year},'%')
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
|
|
||||||
AND tmps.in_account LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.payStatue},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
|
|
||||||
AND tmp.director_id=#{allProjectStatisticsSearch.principalNameId}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
|
|
||||||
AND su.org_code =#{allProjectStatisticsSearch.departCode}
|
|
||||||
</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.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.amount_receivable >= #{allProjectStatisticsSearch.allMoney} and tmps.amount_receivable <![CDATA[<]]>=
|
|
||||||
#{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</when>
|
|
||||||
<otherwise>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
|
|
||||||
AND tmps.amount_receivable >= #{allProjectStatisticsSearch.allMoney}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
|
||||||
AND tmps.amount_receivable <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</if>
|
|
||||||
</otherwise>
|
|
||||||
</choose>
|
|
||||||
</where>
|
|
||||||
union all
|
|
||||||
SELECT
|
|
||||||
tcp.id,
|
|
||||||
tmp.project_name AS projectName,
|
|
||||||
su.realname as principalName,
|
|
||||||
tcp.company_name AS chargeCompanyTemporaryName,
|
|
||||||
tcp.amount_receivable as allMoney,
|
|
||||||
tcp.paid_amount as comeAllMoney,
|
|
||||||
tcp.charge_use as chargeUse,
|
|
||||||
sd.depart_name as depart,
|
|
||||||
tcp.pack as pack,
|
|
||||||
tcp.create_time as createTime
|
|
||||||
FROM tb_member_project tmp left join tb_certificate_payment tcp on(tmp.id=tcp.project_id)
|
|
||||||
left JOIN sys_user su on(tmp.director_id=su.id) left join sys_depart sd on(su.org_code=sd.org_code)
|
|
||||||
<where>
|
|
||||||
<if test="idList != null and idList != ''">
|
|
||||||
tmp.director_id in
|
|
||||||
<foreach item="item" open="(" separator="," close=")" collection="idList">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
|
|
||||||
AND tmp.project_name LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
|
|
||||||
AND tmp.year LIKE
|
|
||||||
concat(#{allProjectStatisticsSearch.year},'%')
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
|
|
||||||
AND tcp.in_account LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.payStatue},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
|
|
||||||
AND tmp.director_id=#{allProjectStatisticsSearch.principalNameId}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
|
|
||||||
AND su.org_code =#{allProjectStatisticsSearch.departCode}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
|
|
||||||
AND tcp.charge_use=#{allProjectStatisticsSearch.chargeUse}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
|
|
||||||
AND tcp.company_name LIKE
|
|
||||||
concat('%',concat(#{allProjectStatisticsSearch.chargeCompanyTemporaryName},'%'))
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
|
|
||||||
AND tcp.pack=#{allProjectStatisticsSearch.pack}
|
|
||||||
</if>
|
|
||||||
<choose>
|
|
||||||
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
|
||||||
AND tcp.amount_receivable >= #{allProjectStatisticsSearch.allMoney} and tcp.amount_receivable <![CDATA[<]]>=
|
|
||||||
#{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</when>
|
|
||||||
<otherwise>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
|
|
||||||
AND tcp.amount_receivable >= #{allProjectStatisticsSearch.allMoney}
|
|
||||||
</if>
|
|
||||||
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
|
|
||||||
AND tcp.amount_receivable <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
|
|
||||||
</if>
|
|
||||||
</otherwise>
|
|
||||||
</choose>
|
|
||||||
</where>) pp where pp.allMoney is not null and pp.allMoney !=0
|
|
||||||
<!-- pp left join-->
|
|
||||||
<!-- (-->
|
|
||||||
<!-- select pwgs.id as id,max(ppr.payment_date) as payment_date-->
|
|
||||||
<!-- from pay_working_group_subitem pwgs-->
|
|
||||||
<!-- inner join pay_payment_record ppr on(pwgs.id=ppr.project_id)-->
|
|
||||||
<!-- <if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">-->
|
|
||||||
<!-- WHERE ppr.payment_date like-->
|
|
||||||
<!-- concat('%',#{allProjectStatisticsSearch.year},'%')-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<!-- GROUP BY pwgs.id-->
|
|
||||||
<!-- union ALL-->
|
|
||||||
<!-- SELECT-->
|
|
||||||
<!-- pcp.id as id,max(ppr.payment_date) as payment_date-->
|
|
||||||
<!-- FROM pay_common_project pcp inner JOIN pay_payment_record ppr on(pcp.id=ppr.project_id)-->
|
|
||||||
<!-- <if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">-->
|
|
||||||
<!-- WHERE ppr.payment_date like-->
|
|
||||||
<!-- concat('%',#{allProjectStatisticsSearch.year},'%')-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<!-- group by pcp.id-->
|
|
||||||
<!-- union all-->
|
|
||||||
<!-- SELECT-->
|
|
||||||
<!-- pmps.id as id,max(ppr.payment_date) as payment_date from-->
|
|
||||||
<!-- pay_member_project_subitem pmps inner join pay_payment_record ppr on(pmps.id=ppr.project_id)-->
|
|
||||||
<!-- <if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">-->
|
|
||||||
<!-- WHERE ppr.payment_date like-->
|
|
||||||
<!-- concat('%',#{allProjectStatisticsSearch.year},'%')-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<!-- group by pmps.id-->
|
|
||||||
<!-- union all-->
|
|
||||||
<!-- SELECT-->
|
|
||||||
<!-- pms.id,max(ppr.payment_date) as payment_date from pay_meeting_situation pms inner join pay_payment_record ppr on(pms.id=ppr.project_id)-->
|
|
||||||
<!-- <if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">-->
|
|
||||||
<!-- WHERE ppr.payment_date like-->
|
|
||||||
<!-- concat('%',#{allProjectStatisticsSearch.year},'%')-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<!-- group by pms.id-->
|
|
||||||
<!-- union all-->
|
|
||||||
<!-- SELECT-->
|
|
||||||
<!-- tmps.id,max(ppr.payment_date) as payment_date from tb_member_project_subitem tmps inner join pay_payment_record ppr on(tmps.id=ppr.project_id)-->
|
|
||||||
<!-- <if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">-->
|
|
||||||
<!-- WHERE ppr.payment_date like-->
|
|
||||||
<!-- concat('%',#{allProjectStatisticsSearch.year},'%')-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<!-- group by tmps.id-->
|
|
||||||
<!-- union all-->
|
|
||||||
<!-- SELECT-->
|
|
||||||
<!-- tcp.id,max(ppr.payment_date) as payment_date from tb_certificate_payment tcp inner join pay_payment_record ppr on(tcp.id=ppr.project_id)-->
|
|
||||||
<!-- <if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">-->
|
|
||||||
<!-- WHERE ppr.payment_date like-->
|
|
||||||
<!-- concat('%',#{allProjectStatisticsSearch.year},'%')-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<!-- group by tcp.id-->
|
|
||||||
<!-- ) pprr on(pp.id=pprr.id) group by pp.id order by pprr.payment_date desc-->
|
|
||||||
</select>
|
</select>
|
||||||
<!-- 全所统计导出-->
|
<!-- 全所统计导出-->
|
||||||
<select id="queryPageListExcel" resultType="com.jero.statistics.entity.AllProjectStatistics">
|
<select id="queryPageListExcel" resultType="com.jero.statistics.entity.AllProjectStatistics">
|
||||||
|
|||||||
Reference in New Issue
Block a user