insert into c_service(
business_type_cd,method,provide_app_id,service_code,retry_count,messageQueueName,url,timeout,is_instance,name,service_id,seq
) values (
#{businessTypeCd},#{method},#{provideAppId},#{serviceCode},#{retryCount},#{messageQueueName},#{url},#{timeout},#{isInstance},#{name},#{serviceId},#{seq}
)
insert into c_service(
business_type_cd,method,provide_app_id,service_code,retry_count,status_cd,messageQueueName,url,timeout,is_instance,name,service_id,seq
) select
t.business_type_cd,t.method,t.provide_app_id,t.service_code,t.retry_count,'0',t.messageQueueName,t.url,t.timeout,t.is_instance,t.name,t.service_id,t.seq
from business_service t where 1=1
and t.business_type_cd= #{businessTypeCd}
and t.method= #{method}
and t.provide_app_id= #{provideAppId}
and t.service_code= #{serviceCode}
and t.retry_count= #{retryCount}
and t.messageQueueName= #{messageQueueName}
and t.url= #{url}
and t.timeout= #{timeout}
and t.is_instance= #{isInstance}
and t.operate= 'ADD'
and t.name= #{name}
and t.service_id= #{serviceId}
and t.seq= #{seq}
update c_service t set t.status_cd = #{statusCd}
, t.business_type_cd= #{businessTypeCd}
, t.method= #{method}
, t.provide_app_id= #{provideAppId}
, t.service_code= #{serviceCode}
, t.retry_count= #{retryCount}
, t.messageQueueName= #{messageQueueName}
, t.url= #{url}
, t.timeout= #{timeout}
, t.is_instance= #{isInstance}
, t.name= #{name}
, t.seq= #{seq}
where 1=1
and t.service_id= #{serviceId}
insert into c_service_sql
select null,#{serviceCode},#{name},#{params},#{queryModel},#{sql},#{proc},#{javaScript},#{template},#{remark},now(),'0'
update c_service_sql t set t.status_cd = #{statusCd}
, t.service_code= #{serviceCode}
, t.name= #{name}
, t.params= #{params}
, t.query_model= #{queryModel}
, t.`sql`= #{sql}
, t.proc= #{proc}
, t.java_script= #{javaScript}
, t.template= #{template}
, t.remark= #{remark}
where 1=1
and t.id= #{id}