lzh
2025-06-24 13c4a636539584ab977fddacfae884b3ec250aee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
ÿþ--[[
    x: WMS-07-04
     Tðy: 8^ϑ-ågâ‹b—g-ågâ‹
    \O€ÿHAN  
    åegÿ2023-08-30
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
    
    ýQpeÿ Query
 
    ŸRý€:
        9hncågâ‹b—g̑„v“eQ ÿÄ~bSQL„vågâ‹agöN
    ôf9e°‹U_:
        V6.0 HAN 2023/9/6  -- lua.Error/lua.Debug ýQpeØSS          
--]]
 
json  = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require( "oi_base_mobox" )
 
function Query ( strLuaDEID ) 
    local nRet, strRetInfo
    local parameter = {}
    local attrs
    -- ·ƒÖSågâ‹b—g̑„v“eQ^\'`
    nRet, attrs = m3.GetSysInputParameter( strLuaDEID ) 
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "m3.GetSysInputParameter 1Y%! "..attrs ) end 
    parameter = m3.KeyValueAttrsToObjAttr( attrs )
 
    local group = lua.Get_StrAttrValue( parameter.S_GROUP )         -- RÄ~ Tðy
    local name = lua.Get_StrAttrValue( parameter.S_NAME )           -- 8^ϑ Tðy
    local is_sys = lua.Get_StrAttrValue( parameter.IsSys )          -- /f&T/fû|ß~
    local strSQL = ''
 
    if (group ~= '') then
        strSQL = "S_GROUP = '"..group.."'"
    end
    if (name ~= '' ) then
        if ( strSQL ~= '' ) then strSQL = strSQL.." AND " end
        strSQL = strSQL.."S_NAME like '%%"..name.."%%'"
    end
    if (is_sys ~= '' ) then
        if ( strSQL ~= '' ) then strSQL = strSQL.." AND " end
        strSQL = strSQL.."C_SYS = '"..is_sys.."'"
    end
    if (strSQL == '') then return end
    -- ¾‹någâ‹b—g
    local setAttr = '{"condition":"'..strSQL..'","order":"S_NAME"}'
    local strAction = '[{"action_type":"set_query_condition","value":'..setAttr..'}]'
    nRet, strRetInfo = mobox.setAction( strLuaDEID, strAction  )
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction1Y%! "..strRetInfo..' action = '..strAction ) end 
 
end