where t1.user_id = cr.created_by) created_by_n, --创建人
cr.creation_date,
cr.status,
(SELECT v.code_value_name value_name
FROM sys_code_values_v v
WHERE v.code = 'CASE_STATUS'
AND v.code_value = cr.status) status_n
FROM con_contract_case_record cr, con_contract_penalty_reduce t
WHERE cr.document_table = 'CON_CONTRACT_PENALTY_REDUCE'
and cr.record_id = t.record_id
)t
where (t.penalty_batch_number = ${/parameter/@penalty_batch_number} or ${/parameter/@penalty_batch_number} = 'undefined' or ${/parameter/@penalty_batch_number} is null)
and (t.created_by_n = ${/parameter/@created_by_n} or ${/parameter/@created_by_n} = 'undefined' or ${/parameter/@created_by_n} is null)
and (t.status = ${/parameter/@status} or ${/parameter/@status} = 'undefined' or ${/parameter/@status} is null)
and (trunc(t.creation_date) >= to_date(${/parameter/@creationdate_from}, 'yyyy-mm-dd') or ${/parameter/@creationdate_from} = 'undefined' or to_date(${/parameter/@creationdate_from},'yyyy-mm-dd') is null)
and (trunc(t.creation_date) <= to_date(${/parameter/@creationdate_to},'yyyy-mm-dd') or ${/parameter/@creationdate_to} = 'undefined' or to_date(${/parameter/@creationdate_to},'yyyy-mm-dd') is null)