rushfee/build/classes/db/task_detail_sql.xml

68 lines
3.1 KiB
XML
Raw Normal View History

2022-05-16 15:07:40 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqls SYSTEM "sql_definition.dtd">
<sqls>
<sql group="task_detail">
<i id="getRecordCount"><![CDATA[
select count(1)
from VIEW_RUSHFEE_LIST t
where t.end_date is not null
and t.end_date>=RUSH_GET_WhatYouWantDay(0,{expstate} ) and t.end_date<=RUSH_GET_WhatYouWantDay(1,{expstate} )
and $equal(t.org_id,company)
and t.customerid not in
(
select l.customer_id
from RUSH_RECORD l
where l.customer_id = t.customerid
and t.end_date <= add_months(trunc(sysdate, 'yyyy'), 12) - 1
union select c.customer_id from rush_task_center c where c.customer_id=t.customerid
)
and $equal(t.revenueid,revenue)
and $equal(t.end_datechr,service_end_date)
]]></i>
<i id="grouplist"><![CDATA[
select t.id ,t.memo text from RUSH_DICTIONARY t where t.codetype='willend' or t.codetype='alreadyend'
]]></i>
<i id="selectCenter"><![CDATA[
select SEQ_TASK_CENTER.nextval,{taskId},{detailId},{taskUserId},{userId},{userName},CUSTOMERID,END_DATE,REVENUEID
from VIEW_RUSHFEE_LIST t
where t.end_date is not null
and t.end_date>=RUSH_GET_WhatYouWantDay(0,{expstate} ) and t.end_date<=RUSH_GET_WhatYouWantDay(1,{expstate} )
and $equal(t.org_id,company)
and t.customerid not in
(
select l.customer_id
from RUSH_RECORD l
where l.customer_id = t.customerid
and t.end_date <= add_months(trunc(sysdate, 'yyyy'), 12) - 1
union select c.customer_id from rush_task_center c where c.customer_id=t.customerid
)
and $equal(t.revenueid,revenue)
and $equal(t.end_datechr,service_end_date)
and rownum<{num}
]]></i>
<i id="saveCenter"><![CDATA[
insert into rush_task_center (ID,TASK_ID,DETAIL_ID,TASK_USER_ID,USER_ID,USER_NAME,EXPECT_BEGIN_DATE, URGENT_DEGREE, TASK_CREATOR, TASK_CREATOR_NAME, ORG_NAME,ORG_ID,
CUSTOMER_ID, END_DATE,REVENUEID, CUST_TAX_CODE, CUSTOMER_NAME)
select SEQ_TASK_CENTER.nextval,'{taskId}','{detailId}','{taskUserId}','{userId}','{userName}','{expectBeginDate}','{urgentDegree}','{taskCreator}','{taskCreatorName}','{orgName}',{orgId},CUSTOMERID,to_char(END_DATE,'yyyy-mm-dd') end_date,REVENUEID,CUST_TAX_CODE,CUST_NAME
from VIEW_RUSHFEE_LIST t
where t.end_date is not null
and t.end_date>=RUSH_GET_WhatYouWantDay(0,{expstate} ) and t.end_date<=RUSH_GET_WhatYouWantDay(1,{expstate} )
and $equal(t.org_id,company)
and T.CUSTOMERID not in (select r.customer_id from RUSH_RECORD r
where r.id in (
select t.obj_id from RUSH_LOG t
where to_number(trunc(sysdate) -to_date(substr(t.operate_date,0,10),'yyyy-MM-dd')) <= {rushdaynum}
and t.action='rushfee') union select c.customer_id from rush_task_center c )
and $equal(t.revenueid,revenue)
and $equal(t.end_datechr,service_end_date)
and rownum<={num}
]]></i>
</sql>
</sqls>