时空系统里的系统函数:系统变参------P_caozy变参名称:P_caozy功能说明:自动取得系统软件登录的用户名注释:主要使用在查询中,查询条件中直接使用示例:根据系统登录用户查询方案中定义:select * from cwk where username = :p_caozy程序解释:select * from cwk where username = '系统管理员' ----系统以管理员登录系统变参------:p_bendian变参名称::p_bendian功能说明:读取软件ini中本店标识项设置的标识注释:示例:查询本店中的数据方案中定义:select * from cwk where bendian = :p_bendian程序解释:select * from cwk where bendian = 'ZDA'系统变参------:S_time变参名称::S_time功能说明:读取当前操作系统的时间注释:格式为hh:mm:ss示例:如图,在查询添加字段显示:变参名称::lastmodifytime功能说明:获取基本资料的最后更新时间注释:执行表de_timerec示例:连锁店通讯簿下载方案中定义:select * from lsdtxb where beactive='是' and lastmodifytime>=:lastmodifytime程序解释:select * from lsdtxb where beactive='是' and lastmodifytime>='2004-09-10 16:变参名称::billno功能说明:当前执行数据组织的单据编号注释:示例:直营配送出库单传输,执行前处理方案中定义:update cwk set y ishj='中' where djbh=:billno程序解释:update cwk set yishj='中' where djbh=' ZCKFDY00000030'变参名称::unitid功能说明:登录终端的分店标识注释:类同的变参::from_unit 功能为任务发送方的分店标识示例:加盟配送出库单传输,数据提取步骤方案中定义:select djbh,dwbh as duifbsh,rq,convert(char(10),getdate(),21) as jiesriqi, :unitid as fdbs from cwk where djbh=:billno程序解释:select djbh,dwbh as duifbsh,rq,convert(char(10),getdate(),21) as jiesriqi, 'fdy' as fdbs from cwk where djbh=:billno变参名称::task_sn功能说明:接收到任务的task_sn值注释:示例:连锁传输任务上报方案中定义:exec sbp_lsd_jxdj :task_sn程序解释:exec sbp_lsd_jxdj 'DEX00000003'变参名称:P_quyu功能说明:对当前登录的业务员所管辖的区域进行查询。
注释:必须对业务员进行区域设置示例:查询系统管理员所管辖的区域。
方案中定义:select a.*,b.* from mchk a,jxdjhz b where a.dwbh=b.dwbh and a.p_quyufl程序解释:select a.*,b. from mchk a,jxdjhz b where a.dwbh=b.dwbh and a.quyufl in ('北京')变参名称::P_zuzhi功能说明:对当前登录的业务员所属的组织进行查询。
注释:对当前登录的业务员所属的组织进行查询。
示例:查询系统管理员的人员组织层次中的查询。
(当前登录为系统管理员,系统管理员管理业务员刘孜)方案中定义:select * from cwk where p_zuzhi程序解释:select * from cwk where ywy in ('系统管理员','刘孜')变参名称::value功能说明:代表当前输入的值,为全匹配注释:左匹配:value% 右匹配%value 模糊查找%value%示例:方案中定义:select a.spid,a.spbh,a.spmch,a.shpgg,a.shpchd,a.lshj,a.zjm,a.sptm,a.is_tjsp, a.huiytj,a.is_hysp,a.zhdcbj,a.shlv from spkfk a where a.beactive<>'否' and a.sptm=:value程序解释:select a.spid,a.spbh,a.spmch,a.shpgg,a.shpchd,a.lshj,a.zjm,a.sptm,a.is_tjsp, a.huiytj,a.is_hysp,a.zhdcbj,a.shlv from spkfk a where a.beactive<>'否' and a.sptm=''变参名称:: mast.字段名功能说明:获取抬头项的字段注释:只限用于pos前台。
如果使用明细项作为参数,格式为:字段名示例:提取某货位的商品资料方案中定义:select b.spid,b.spbh,b.spmch,b.shpgg,b.shpchd,b.is_tjsp,b.is_hysp,b.huiytj, b.lshj,b.zjm,b.zhdcbj,b.shlv from hwsp a,spkfk b where b.beactive<>'否' and a.spid=b.spid and a.hw=:mast.hw and a.lsm<>'' and a.lsm=:value程序解释:select b.spid,b.spbh,b.spmch,b.shpgg,b.shpchd,b.is_tjsp,b.is_hysp,b.huiytj, b.lshj,b.zjm,b.zhdcbj,b.shlv from hwsp a,spkfk b where b.beactive<>'否' and a.spid=b.spid and a.hw='HWI00000001'系统变参------:v_get变参名称::v_get功能说明:左匹配查找注释:系统软件执行时,将其解释为::v_get = '%'示例:提取商品资料方案中定义:select spid,spbh,spmch,shpgg,shpchd,dw from spkfkwhere beactive='是' and spbh like :v_get order by 2 asc程序解释:select spid,spbh,spmch,shpgg,shpchd,dw from spkfkwhere beactive='是' and spbh like '%' order by 2 asc系统变参------:v_zjm变参名称::v_zjm功能说明:模糊查找字段,可使用在任何需要模糊查找的字段注释:系统软件执行时,将其解释为::v_zjm= '%%'示例:提取商品资料方案中定义:select spid,spbh,spmch,shpgg,shpchd,dw from spkfkwhere beactive='是' and spmch like :v_zjm order by 2 asc程序解释:select spid,spbh,spmch,shpgg,shpchd,dw from spkfkwhere beactive='是' and spmch like '% % ' order by 2 asc系统变参------:v_bh变参名称::v_bh功能说明:可使用在所有编号字段匹配,也是左匹配查找注释:系统软件执行时,将其解释为::v_bh = '%'示例:提取商品资料方案中定义:select spid,spbh,spmch,shpgg,shpchd,dw from spkfk where beactive='是' and spbh like :v_bh order by 2 asc程序解释:select spid,spbh,spmch,shpgg,shpchd,dw from spkfk where beactive='是' and spbh like '%' order by 2 asc系统变参------:hz.字段名变参名称::hz.字段名功能说明:引用当前单据中抬头项字段作为查找条件注释:示例:选择调出货位方案中定义:select hw as dchw,huowname as dchwname from huoweizl a,lsdtxb b where a.duifbsh=b.duifbshand b.duifbsh=:hz.s_fdbs and (a.huowname like :v_get or a.hwbh like :v_get) order by huowname程序解释:select hw as dchw,huowname as dchwname from huoweizl a,lsdtxb b where a.duifbsh=b.duifbsh and b.duifbsh= ‘fdy' and (a.huowname like :v_get or a.hwbh like :v_get) order by huowname系统变参------:mx.字段名变参名称::mx.字段名功能说明:引用当前单据中的明细项字段作为查找条件注释:示例:提取商品的货位方案中定义:select a.hwbh,a.huowname,b.hwshl from huoweizl a,hwsp b where a.hw=b.hw and b.spid=:mx.spid程序解释:select a.hwbh,a.huowname,b.hwshl from huoweizl a,hwsp b where a.hw=b.hw and b.spid = 'SPH00000062 ' ---- 具体执行一商品内码系统变参------:spid变参名称::spid功能说明:获取当前商品的商品内码。