rushfee/resource/db/tick_sql.xml

57 lines
1.7 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="fklist">
<i id="getFkList"><![CDATA[
select * from RUSH_FEEDBACK_DIC where $like(name,qn) order by no
]]></i>
<i id="getjiaofei"><![CDATA[
select a.hushu ,b.boda ,c.jiaofei from ( select count(1) hushu from rush_record where create_date between
to_char( trunc(sysdate,'y'))
and to_char(sysdate,'yyyy-mm-dd '))a,
( select count(1) boda from rush_log where action='phone' and operate_date between
to_char( trunc(sysdate,'y'))
and to_char(sysdate,'yyyy-mm-dd '))b,
(select count(1) jiaofei from rush_record a inner join einvoice_fpkjxx_fptxx b
on a.customer_id=b.ghf_custid where kphjje='280' )c
]]></i>
</sql>
<sql group="operExlData">
<i id="queryExists"><![CDATA[
select CUSTOMER_ID from crm_customer_info where #equal(CUST_NAME,cust_name) and #equal(CUST_TAX_CODE,cust_tax_code)
]]></i>
<i id="querydelete"><![CDATA[
select * from v_contact where #equal(CUSTOMER_ID,customer_id) and #equal(MOBILE,phone)
]]></i>
<i id="impData"><![CDATA[
MERGE INTO RUSH_CONTACT T1
USING ( select CUSTOMER_ID, {phone} phone from crm_customer_info where cust_tax_code={cust_tax_code} ) T2
ON ( T1.CUSTOMER_ID=T2.CUSTOMER_ID and T1.MOBILE=T2.phone)
WHEN MATCHED THEN
UPDATE SET T1.VITAL='导入确认'
WHEN NOT MATCHED THEN
insert (
ID,
CUSTOMER_ID,
MOBILE,
SOURCE,
contact,
flag,
OPERATOR_CODE,
OPERATOR_NAME,
OPERATE_DATE
)
VALUES
({cguid},t2.CUSTOMER_ID,{phone},'branchorg','分公司导入','add',
{operator},{operatorName},{operDate})
]]></i>
</sql>
</sqls>