|
@@ -101,36 +101,47 @@
|
|
|
</select>
|
|
|
<select id="page3" resultType="org.springblade.meter.vo.MiddleMeterApplyVO">
|
|
|
SELECT a.*,b.period_number AS periodNumber ,
|
|
|
- CASE
|
|
|
- WHEN a.approve_status = 0 THEN
|
|
|
- '未上报'
|
|
|
- WHEN a.approve_status = 1 THEN
|
|
|
- CONCAT('待审批',(
|
|
|
- SELECT IFNULL(CONCAT( '(', group_concat( CONCAT( a.task_user_name, ',', DATEDIFF( CURDATE(), a.create_time ))), ')' ),"") AS taskUserInfo FROM u_task_parallel a,u_task b
|
|
|
- WHERE a.process_instance_id = b.process_instance_id AND b.form_data_id = b.id AND e_visa_status IS NULL AND (e_visa_content IS NULL or e_visa_content ='' ) AND b.STATUS != 3
|
|
|
- ) )
|
|
|
- WHEN a.approve_status = 2 THEN
|
|
|
- '已审批' ELSE '已废除'
|
|
|
- END AS approveStatusName ,
|
|
|
- (SELECT id from u_task c where b.id=c.form_data_id) as task_id,
|
|
|
- ( SELECT raw_url FROM s_interim_pay_certificate WHERE contract_id = #{apply.contractId} AND contract_period_id = a.contract_period_id AND is_deleted = 0 ) AS periodPdfUrl
|
|
|
- from
|
|
|
- s_middle_meter_apply a ,s_contract_meter_period b
|
|
|
+ CASE
|
|
|
+ WHEN a.approve_status = 0 THEN
|
|
|
+ '未上报'
|
|
|
+ WHEN a.approve_status = 1 THEN
|
|
|
+ CONCAT('待审批',(
|
|
|
+ SELECT
|
|
|
+ IFNULL( CONCAT( '(', group_concat( CONCAT( c.task_user_name, ',', DATEDIFF( CURDATE(), c.create_time ))), ')' ),
|
|
|
+ '' ) AS taskUserInfo
|
|
|
+ FROM
|
|
|
+ u_task_parallel c,
|
|
|
+ u_task d
|
|
|
+ WHERE
|
|
|
+ c.process_instance_id = d.process_instance_id
|
|
|
+ AND d.form_data_id = b.id
|
|
|
+ AND e_visa_status IS NULL
|
|
|
+ AND ( e_visa_content IS NULL OR e_visa_content = '' )
|
|
|
+ AND d.STATUS != 3
|
|
|
+ ) )
|
|
|
+ WHEN a.approve_status = 2 THEN
|
|
|
+ '已审批' ELSE '已废除'
|
|
|
+ END AS approveStatusName ,
|
|
|
+ (SELECT id from u_task c where b.id=c.form_data_id AND c.STATUS != 3 ) as task_id,
|
|
|
+ ( SELECT raw_url FROM s_interim_pay_certificate WHERE contract_id = #{apply.contractId} AND contract_period_id =
|
|
|
+ a.contract_period_id AND is_deleted = 0 ) AS periodPdfUrl
|
|
|
+ from
|
|
|
+ s_middle_meter_apply a ,s_contract_meter_period b
|
|
|
WHERE
|
|
|
- a.contract_period_id = b.id
|
|
|
+ a.contract_period_id = b.id
|
|
|
and a.contract_id = #{apply.contractId} and a.is_deleted = 0
|
|
|
<if test="apply.contractPeriodId != -1">
|
|
|
and a.contract_period_id = #{apply.contractPeriodId}
|
|
|
</if>
|
|
|
- and a.contract_unit_id in (
|
|
|
- <foreach collection="ids" item="id" separator=",">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- )
|
|
|
+ and a.contract_unit_id in (
|
|
|
+ <foreach collection="ids" item="id" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ )
|
|
|
order by FIELD(a.contract_unit_id,
|
|
|
- <foreach collection="ids" item="id" separator=",">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
+ <foreach collection="ids" item="id" separator=",">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
),a.create_time
|
|
|
|
|
|
</select>
|