|
|
@@ -210,4 +210,70 @@
|
|
|
ORDER BY a.update_time DESC, a.id ASC
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ <!--预开票付款list(新)-->
|
|
|
+ <select id="invoicePaymentApplyList" resultType="org.jeecg.modules.hlwsubcontractor.entity.HlwSubcontractorAccountFlow" >
|
|
|
+ SELECT
|
|
|
+ a.id AS "id",
|
|
|
+ ha.application_name AS "applicationName",
|
|
|
+ hp.payment_code AS "paymentCode",
|
|
|
+ case when a.is_through_platform=1 then hce.cp_name else hc.company_name end as "companyName",
|
|
|
+ a.is_through_platform AS "isThroughPlatform",
|
|
|
+ hs.name AS "subcontractorName",
|
|
|
+ (a.amount+a.service_fee) AS "totalPayment",
|
|
|
+ a.invoice_id AS "invoiceId",
|
|
|
+ a.create_time AS "createTime"
|
|
|
+ FROM hlw_subcontractor_account_flow a
|
|
|
+ left join hlw_payment hp on a.payment_id=hp.id
|
|
|
+ left join hlw_application_setting ha on ha.id=hp.application_id
|
|
|
+ left join hlw_company hc on hc.id=hp.company_id
|
|
|
+ inner join hlw_cp_setting hce
|
|
|
+ left join hlw_subcontractor hs on hs.id=hp.subcontractor_id
|
|
|
+ <where>
|
|
|
+ a.type=0
|
|
|
+ <if test="hlwSubcontractorAccountFlow.paymentCode != null and hlwSubcontractorAccountFlow.paymentCode !=''">
|
|
|
+ and hp.payment_code like concat(concat('%',#{hlwSubcontractorAccountFlow.paymentCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="hlwSubcontractorAccountFlow.companyName != null and hlwSubcontractorAccountFlow.companyName !=''">
|
|
|
+ and case when a.is_through_platform=1 then hce.cp_name like concat('%',#{hlwSubcontractorAccountFlow.companyName},'%') else hc.company_name like concat('%',#{hlwSubcontractorAccountFlow.companyName},'%') end
|
|
|
+ </if>
|
|
|
+ <if test="hlwSubcontractorAccountFlow.invoiceStatus != null">
|
|
|
+ <if test="hlwSubcontractorAccountFlow.invoiceStatus ==1">
|
|
|
+ and a.invoice_id is null
|
|
|
+ </if>
|
|
|
+ <if test="hlwSubcontractorAccountFlow.invoiceStatus ==2">
|
|
|
+ and a.invoice_id is not null
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ group by a.id
|
|
|
+ ORDER BY a.update_time DESC, a.id ASC
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <select id="getHlwSubcontractorAccountFlowById" resultType="org.jeecg.modules.hlwsubcontractor.entity.HlwSubcontractorAccountFlow" >
|
|
|
+ SELECT
|
|
|
+ a.id AS "id",
|
|
|
+ ha.application_name AS "applicationName",
|
|
|
+ hp.payment_code AS "paymentCode",
|
|
|
+ case when a.is_through_platform=1 then hce.cp_name else hc.company_name end as "companyName",
|
|
|
+ a.is_through_platform AS "isThroughPlatform",
|
|
|
+ hs.name AS "subcontractorName",
|
|
|
+ (a.amount+a.service_fee) AS "totalPayment",
|
|
|
+ a.invoice_id AS "invoiceId",
|
|
|
+ a.create_time AS "createTime",
|
|
|
+ hc.id as "companyId",
|
|
|
+ hs.id as "subcontractorId",
|
|
|
+ a.amount as "amount",
|
|
|
+ a.service_fee as "serviceFee"
|
|
|
+ FROM hlw_subcontractor_account_flow a
|
|
|
+ left join hlw_payment hp on a.payment_id=hp.id
|
|
|
+ left join hlw_application_setting ha on ha.id=hp.application_id
|
|
|
+ left join hlw_company hc on hc.id=hp.company_id
|
|
|
+ inner join hlw_cp_setting hce
|
|
|
+ left join hlw_subcontractor hs on hs.id=hp.subcontractor_id
|
|
|
+ WHERE a.id = #{id}
|
|
|
+ </select>
|
|
|
</mapper>
|