付款进度代码同步
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.ruoyi.oa.mapper.OaPaymentProgressMapper">
|
||||
|
||||
<select id="selectVoPagePlus" resultType="com.ruoyi.oa.domain.vo.OaPaymentProgressVo">
|
||||
SELECT
|
||||
opp.*,
|
||||
sop.project_name,
|
||||
sop.project_code,
|
||||
sop.project_num,
|
||||
mf.min_end_time AS earliestEndTime,
|
||||
-- qualified = 1 当不存在 status=0 的 sof(即要么没有任何 sof,要么所有 sof.status=1)
|
||||
CASE
|
||||
WHEN NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM sys_oa_finance sof_zero
|
||||
WHERE sof_zero.payment_progress_id = opp.payment_progress_id
|
||||
AND sof_zero.status = 0
|
||||
)
|
||||
THEN 1
|
||||
ELSE 0
|
||||
END AS qualified
|
||||
FROM oa_payment_progress opp
|
||||
LEFT JOIN sys_oa_project sop
|
||||
ON opp.project_id = sop.project_id
|
||||
LEFT JOIN (
|
||||
-- 只拿 status=0 且最早的 end_time
|
||||
SELECT
|
||||
payment_progress_id,
|
||||
MIN(end_time) AS min_end_time
|
||||
FROM sys_oa_finance
|
||||
WHERE status = 0
|
||||
GROUP BY payment_progress_id
|
||||
) mf
|
||||
ON opp.payment_progress_id = mf.payment_progress_id
|
||||
${ew.getCustomSqlSegment}
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -27,6 +27,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="totalOut" column="total_out"/>
|
||||
<result property="totalIn" column="total_in"/>
|
||||
<result property="month" column="month"/>
|
||||
<result property="paymentProgressId" column="payment_progress_id"/>
|
||||
<result property="status" column="status"/>
|
||||
|
||||
<result property="receiveAccountId" column="receive_account_id"/>
|
||||
<result property="receiveAccountName" column="receive_account_name"/>
|
||||
@@ -35,6 +37,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
<select id="selectByPaymentProgressId" resultType="com.ruoyi.oa.domain.vo.SysOaFinanceVo">
|
||||
SELECT *
|
||||
FROM sys_oa_finance
|
||||
WHERE payment_progress_id = #{progressId}
|
||||
</select>
|
||||
|
||||
|
||||
<resultMap id="detailResult" type="SysOaDetail">
|
||||
<id property="detailId" column="detail_id"/>
|
||||
<result property="financeId" column="finance_id"/>
|
||||
@@ -51,31 +62,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFinanceVo">
|
||||
select a.finance_id,
|
||||
a.project_id,
|
||||
a.finance_title,
|
||||
a.finance_parties,
|
||||
a.pay_type,
|
||||
a.finance_type,
|
||||
a.finance_time,
|
||||
a.make_ratio,
|
||||
a.make_price,
|
||||
a.make_time,
|
||||
a.make_explain,
|
||||
a.accessory,
|
||||
a.remark as finance_remark,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
select sof.finance_id,
|
||||
sof.project_id,
|
||||
sof.finance_title,
|
||||
sof.finance_parties,
|
||||
sof.pay_type,
|
||||
sof.finance_type,
|
||||
sof.finance_time,
|
||||
sof.make_ratio,
|
||||
sof.make_price,
|
||||
sof.make_time,
|
||||
sof.make_explain,
|
||||
sof.accessory,
|
||||
sof.remark as finance_remark,
|
||||
sof.create_by,
|
||||
sof.create_time,
|
||||
sof.update_by,
|
||||
sof.update_time,
|
||||
b.detail_id,
|
||||
b.detail_title,
|
||||
a.out_type,
|
||||
sof.out_type,
|
||||
b.price,
|
||||
b.big_price,
|
||||
b.remark as detail_remark
|
||||
from sys_oa_finance a
|
||||
left join sys_oa_detail b on a.finance_id = b.finance_id
|
||||
from sys_oa_finance sof
|
||||
left join sys_oa_detail b on sof.finance_id = b.finance_id
|
||||
</sql>
|
||||
|
||||
<select id="selectPageFinanceList" resultMap="SysOaFinanceResult">
|
||||
@@ -110,7 +121,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
p.project_id,
|
||||
p.project_name,
|
||||
sora.receive_account_name,
|
||||
sora.receive_account_id
|
||||
sora.receive_account_id,
|
||||
sof.payment_progress_id,
|
||||
sof.status
|
||||
from sys_oa_finance sof
|
||||
left join sys_oa_detail b on sof.finance_id = b.finance_id
|
||||
left join sys_oa_project p on sof.project_id = p.project_id
|
||||
@@ -145,7 +158,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
p.project_id,
|
||||
p.project_name,
|
||||
sora.receive_account_name,
|
||||
sora.receive_account_id
|
||||
sora.receive_account_id,
|
||||
sof.status,
|
||||
sof.payment_progress_id
|
||||
from sys_oa_finance sof
|
||||
left join sys_oa_detail b on sof.finance_id = b.finance_id
|
||||
left join sys_oa_project p on sof.project_id = p.project_id
|
||||
@@ -155,7 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<!--进出账查询-->
|
||||
<select id="selectFinanceByProjectId" resultMap="SysOaFinanceResult">
|
||||
select a.finance_id, a.project_id, a.finance_title, a.finance_parties, a.pay_type, a.finance_type, a.finance_time, a.make_ratio, a.make_price, a.make_time, a.make_explain, a.accessory, a.remark as finance_remark, a.create_by, a.create_time, a.update_by, a.update_time,
|
||||
b.detail_id, b.detail_title, b.price, b.big_price, b.remark as detail_remark,a.out_type
|
||||
b.detail_id, b.detail_title, b.price, b.big_price, b.remark as detail_remark,a.out_type,a.payment_progress_id,a.status
|
||||
from sys_oa_finance a
|
||||
left join sys_oa_detail b on a.finance_id = b.finance_id
|
||||
where a.project_id = #{projectId} and a.finance_type = #{financeType}
|
||||
@@ -164,17 +179,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<!--进出账查询-->
|
||||
<select id="findFinanceByTime" resultMap="SysOaFinanceResult">
|
||||
<include refid="selectFinanceVo" />
|
||||
where a.finance_type = #{financeType}
|
||||
where sof.finance_type = #{financeType}
|
||||
<if test=" payType!=NULL and payType!=null and payType !='0' and payType!=0 ">
|
||||
and a.pay_type = #{payType}
|
||||
and sof.pay_type = #{payType}
|
||||
</if>
|
||||
|
||||
<if test=" receiveAccountId!=NULL and receiveAccountId!=null and receiveAccountId!='-1' ">
|
||||
and a.receive_account_id = #{receiveAccountId}
|
||||
and sof.receive_account_id = #{receiveAccountId}
|
||||
</if>
|
||||
and a.project_id = 0
|
||||
and date_format(a.finance_time,'%Y-%m-%d %H:%i:%s') >= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
|
||||
and date_format(a.finance_time,'%Y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
|
||||
and sof.project_id = 0
|
||||
and date_format(sof.finance_time,'%Y-%m-%d %H:%i:%s') >= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
|
||||
and date_format(sof.finance_time,'%Y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
|
||||
</select>
|
||||
|
||||
<select id="getBarData" resultMap="SysOaFinanceResult">
|
||||
@@ -192,13 +207,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
</select>
|
||||
|
||||
<!--项目进出账查询-->
|
||||
<!-- <select id="findFinanceByTimeAndProjectId" resultMap="SysOaFinanceResult">
|
||||
<include refid="selectFinanceVo" />
|
||||
where a.finance_type = #{financeType}
|
||||
and a.project_id > 0
|
||||
and date_format(a.create_time,'%Y-%m-%d %H:%i:%s') >= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
|
||||
and date_format(a.create_time,'%Y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
|
||||
</select>-->
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -22,6 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="createUserNickName" column="createUserNickName"/>
|
||||
<result property="workerNickName" column="workerNickName"/>
|
||||
<result property="postponements" column="postponements"/>
|
||||
<result property="accessory" column="accessory"/>
|
||||
|
||||
<collection property="taskItemVoList" ofType="com.ruoyi.oa.domain.vo.SysOaTaskItemVo" javaType="list">
|
||||
<result property="itemId" column="item_id"/>
|
||||
<result property="content" column="itemContent"/>
|
||||
@@ -31,6 +33,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="endTime" column="itemEndTime"/>
|
||||
<result property="remark" column="itemRemark"/>
|
||||
<result property="completedTime" column="itemCompletedTime"/>
|
||||
<result property="files" column="files"/>
|
||||
|
||||
|
||||
</collection>
|
||||
</resultMap>
|
||||
@@ -112,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
sot.task_title,
|
||||
sot.task_type,
|
||||
sot.task_grade,
|
||||
|
||||
sot.accessory,
|
||||
COALESCE(
|
||||
sot.finish_time,
|
||||
(SELECT a.end_time
|
||||
@@ -138,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
su1.nick_name AS createUserNickName,
|
||||
su2.nick_name AS workerNickName,
|
||||
|
||||
sot.accessory,
|
||||
|
||||
sot.rank_number,
|
||||
sot.remark,
|
||||
sot.task_rank,
|
||||
|
||||
Reference in New Issue
Block a user