<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-3-21 上午11:36:47  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
            SELECT t1.parameter_id,
			       t1.seq,
			       t1.parameter_name,
			       t1.parameter_type,
			       decode(t1.parameter_type,
			              'DATE',
			              sch_task_pkg.get_para_default_date(j.parameter_value),
			              j.parameter_value) as parameter_value,
			       (case
			         when j.parameter_value is null then
			          'N'
			         else
			          'Y'
			       end) as lov_has_default_value,
			       (case
			         when t1.edit_type = 'LOV' and t1.parameter_type = 'VARCHAR2' and
			              j.parameter_value is not null and
			              j.parameter_value not like
			              chr(36) || chr(123) || chr(47) || '%' then
			          chr(39) || j.parameter_value || chr(39)
			         else
			          j.parameter_value
			       end) as default_value_format,
			       t1.task_code,
			       t1.description,
			       t1.edit_type,
			       t1.display_flag,
			       t1.display_type,
			       t1.lov_sql
			  FROM SCH_TASK_PARAMETER t1, sch_job_parameter j
			 where j.parameter_id = t1.parameter_id
			   and j.job_id = ${@job_id}
			 ORDER BY t1.seq
            ]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
                begin
				    sch_concurrent_job_pkg.update_job_parameter(p_job_id				=> ${@job_id},
				    											p_user_id 				=> ${/session/@user_id},
				   												p_parameter_1 			=> ${@parameter_1},
							                                    p_parameter_2 			=> ${@parameter_2},
							                                    p_parameter_3 			=> ${@parameter_3},
							                                    p_parameter_4 			=> ${@parameter_4},
							                                    p_parameter_5 			=> ${@parameter_5},
							                                    p_parameter_6 			=> ${@parameter_6},
							                                    p_parameter_7 			=> ${@parameter_7},
							                                    p_parameter_8 			=> ${@parameter_8},
							                                    p_parameter_9 			=> ${@parameter_9},
							                                    p_parameter_10 			=> ${@parameter_10},
							                                    p_parameter_11       	=> ${@parameter_11},
		                                                    	p_parameter_12       	=> ${@parameter_12},
			                                                    p_parameter_13       	=> ${@parameter_13},
			                                                    p_parameter_14       	=> ${@parameter_14},
			                                                    p_parameter_15       	=> ${@parameter_15},
			                                                    p_parameter_16       	=> ${@parameter_16},
			                                                    p_parameter_17       	=> ${@parameter_17},
			                                                    p_parameter_18       	=> ${@parameter_18},
			                                                    p_parameter_19       	=> ${@parameter_19},
			                                                    p_parameter_20       	=> ${@parameter_20});
				end;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>