|
|
@@ -25,15 +25,39 @@
|
|
|
WHERE a.id = #{id}
|
|
|
</select>
|
|
|
|
|
|
- <select id="findList" resultType="org.jeecg.modules.hlwinvoice.entity.HlwInvoice" >
|
|
|
+ <select id="queryPageList" resultType="org.jeecg.modules.hlwinvoice.entity.HlwInvoice" >
|
|
|
SELECT
|
|
|
- <include refid="hlwInvoiceColumns"/>
|
|
|
+ a.id AS "id",
|
|
|
+ a.amount AS "amount",
|
|
|
+ a.invoice_number AS "invoiceNumber",
|
|
|
+ a.invoice AS "invoice",
|
|
|
+ a.sys_org_code AS "sysOrgCode",
|
|
|
+ a.upload_time AS "uploadTime",
|
|
|
+ a.upload_by AS "uploadBy",
|
|
|
+ case when hp.is_through_platform=1 then hce.cp_name else hc.company_name end as "companyName",
|
|
|
+ hp.is_through_platform AS "isThroughPlatform",
|
|
|
+ hs.name AS "subcontractorName",
|
|
|
+ ha.application_name AS "applicationName",
|
|
|
+ ha.file_path_prefix as "filePathPrefix",
|
|
|
+ hp.payment_code AS "paymentCode"
|
|
|
FROM hlw_invoice a
|
|
|
- <include refid="hlwInvoiceJoins"/>
|
|
|
+ left join hlw_payment hp on hp.invoice_id=a.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>
|
|
|
-
|
|
|
+ 1=1
|
|
|
+ <if test="hlwInvoice.invoiceNumber != null and hlwInvoice.invoiceNumber !=''">
|
|
|
+ and a.invoice_number like concat(concat('%',#{hlwPayment.invoiceNumber}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="hlwInvoice.companyName != null and hlwInvoice.companyName !=''">
|
|
|
+ and (hc.company_name like concat(concat('%',#{hlwInvoice.companyName}),'%') or hce.cp_name like concat(concat('%',#{hlwInvoice.companyName}),'%'))
|
|
|
+ </if>
|
|
|
|
|
|
</where>
|
|
|
+ group by a.id
|
|
|
+ order by a.upload_time desc ,a.id asc
|
|
|
</select>
|
|
|
|
|
|
<insert id="saveInvoice">
|