|
@@ -623,27 +623,20 @@
|
|
|
|
|
|
<select id="selectInvoiceFlag" resultType="string">
|
|
|
select
|
|
|
- case
|
|
|
- when ff.status = '1' then '开票中'
|
|
|
- when ff.status = '2' then '开票中'
|
|
|
- when ff.status = '3' then '开票中'
|
|
|
- when ff.status = '4' then '开票中'
|
|
|
- when ff.status = '5' then '已开票'
|
|
|
- when ff.status = '6' then '已开票'
|
|
|
- when ff.status = '7' then '已开票'
|
|
|
- when ff.status = '8' then '已开票'
|
|
|
- else '' end
|
|
|
- from
|
|
|
- (select
|
|
|
- fib.program_name as program_name,
|
|
|
- fi.`status` as status,
|
|
|
- fib.program_id as program_id,
|
|
|
- fi.create_date as create_date
|
|
|
+ case
|
|
|
+ when fi.status = '1' then '开票中'
|
|
|
+ when fi.status = '2' then '开票中'
|
|
|
+ when fi.status = '3' then '开票中'
|
|
|
+ when fi.status = '4' then '开票中'
|
|
|
+ when fi.status = '5' then '已开票'
|
|
|
+ when fi.status = '6' then '已开票'
|
|
|
+ when fi.status = '7' then '已开票'
|
|
|
+ when fi.status = '8' then '已开票'
|
|
|
+ else '' end
|
|
|
from finance_invoice_base fib
|
|
|
inner join finance_invoice fi on fi.id = fib.invoice_id and fi.del_flag = '0'
|
|
|
- where fib.del_flag = '0' and fi.status != '9'
|
|
|
- order by fi.create_date desc) ff
|
|
|
- where ff.program_id = #{id}
|
|
|
+ where fib.del_flag = '0' and fi.status != '9' and fib.program_id = #{id}
|
|
|
+ order by fi.create_date desc
|
|
|
limit 1
|
|
|
</select>
|
|
|
|