^1639973621167
@
sname
ThingRegistUtils
slabel
ThingRegistUtils
sdescriptors
xworker.lang.MetaDescriptor3
smany
true
seditCols
2
sinitialization
false
smodifier
public
sid
ThingRegistUtils
  @/@actions
  sname
  actions
  sdescriptors
  xworker.lang.MetaDescriptor3/@actions
  sid
  actions
    @/@actions/@getNotes
    sname
    getRegistThings
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Global
    sdisableGlobalContext
    false
    Scode
#$@text#$@
def pst = null;
def rs = null;
def things = [];

try{
    def metaThing = world.getThing("xworker.lang.MetaThing");
    def pathstr = metaThing.doAction("getAllDEPaths", actionContext, ["thing":thing]);
    def paths = pathstr.split("[,]");
    def sql = "select * from tblThings where id in (select registThingId from tblThingRegists where registType=? and thingId in (select id from tblThings where ";
    for(int i=0; i<paths.length; i++){
        if(i != 0){
            sql = sql + " or ";
        }
        sql = sql + "path=?";
    }
    sql = sql + "))";
    log.info(sql);
    
    pst = con.prepareStatement(sql);
    def index = 2;
    pst.setString(1, registType);
    for(path in pahts){
        pst.setString(index, path);
        index++;
    }
    rs = pst.executeQuery();
    while(rs.next()){
        def path = rs.getString("path");
        def th = world.getThing(path);
        if(th != null){
            things.add(th);
        }
    }
    
    return things;
}finally{
    if(rs != null){
        rs.close();
    }
    
    if(pst != null){
        pst.close();
    }
}
#$@text#$@
    sdescription
    <p>获取注册到指定事物的事物列表。</p>
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    getNotes
      @/@actions/@getNotes/@contexts
      sname
      contexts
      sdescriptors
      xworker.lang.actions.Inout/@contexts
      sid
      contexts
        @/@actions/@getNotes/@contexts/@db
        sname
        dataSource
        sconnectionName
        con
        stransaction
        false
        sdataSourcePath
        xworker.ide.db.datasource.XWorkerDataSource
        sdisable
        false
        sonError
        ignore
        spreventError
        false
        sinherit
        true
        sdescriptors
        xworker.lang.db.jdbc.DataSouceActionContext,xworker.lang.actions.Inout/@contexts/@context
        sid
        db
      @/@actions/@getNotes/@ins
      sisValidate
      false
      sname
      ins
      sdescriptors
      xworker.lang.actions.Inout/@ins
      sid
      ins
        @/@actions/@getNotes/@ins/@thing
        sname
        thing
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sid
        thing
        @/@actions/@getNotes/@ins/@registType
        sname
        registType
        stypeCheck
        false
        soptional
        true
        scheck
        false
        scheckLevel
        exception
        sdescriptors
        xworker.lang.actions.Inout/@ins/@param
        sid
        registType
