FMResultSet的進行流程

2021-07-27 03:50:09 字數 2533 閱讀 1908

// 得到已經傳入的資料

//新建立的模型物件

sssgyomodel

*gyomodeltoselect = [

sssgyomodel

new];

//查詢時需要的引數

gyomodeltoselect.

kokocd

= testkokocd; //該賦值的testkokocd

gyomodeltoselect.

koshicd

= testkoshicd;

gyomodeltoselect.

sagymd

= testymd;

gyomodeltoselect.

gdseqno

= testgdseqno;

gyomodeltoselect.

kaishacd

= testkaishacd;

nsarray

*gyosyalist = [gyomodeltoselect

fetchwithparams

:[gyomodeltoselect

getrecordparams

] error

:&dberror];

其中:- (

nsdictionary

*)getrecordparams ;

}

其中://呼叫了下面的方法

- (nsarray

<

swkdatamodel

*> *)fetchwithparams:(

nsdictionary

*)params error:(

nserror

*__autoreleasing

*)error

//接著呼叫了下面的方法

- (nsarray

<

swkdatamodel

*> *)fetchwithparams:(

nsdictionary

*)params orderparams:(

nsarray

<

nsdictionary

*> *)orderparams error:(

nserror

*__autoreleasing

*)error

else

[values

addobject

:obj];

}];

if([where

length

] > 0)

for(

nsarray

*orderarray

inorderparams)

else }

if([order

length

] > 0)

[sql

:@";"];

// sql

fmdatabase

*db = [

swkdataaccessmanager

opendatabase];

nsarray

*models = [

swkdataaccessmanager

executequery

:sql

values

:values

loadtarget

:[self

class

] db

:db

error

:error];

[db

close];

return

models; }

其中:+ (

fmdatabase

*)opendatabase

return

nil; }

其中:

+ (fmdatabase

*)getdb }

//open database with fmdb. fmdb框架裡面的方法。

sdb = [

fmdatabase

databasewithpath

:dbpath]; }

return

sdb; }

其中:

+ (nsarray

*)executequery:(

nsstring

*)sql values:(

nsarray

*)values loadtarget:(class)loadtarget db:(

fmdatabase

*)db error:(

nserror

*__autoreleasing

*)error

} return

array; }

其中:- (void

)configurevalueswithresultset:(

fmresultset

*)resultset

}]; }

//

Stream流對集合進行排序

author 王文龍 date 2019 10 24 17 44 public class streamtest public streamtest integer id,integer age,string name 省略 getting,setting方法 public static void ...

用IO流對檔案進行操作

一 對檔案進行讀寫操作 1.使用fileinputstream讀取資料 從檔案中讀取資料 public static void fileinputstream throws ioexception system.out.println result in.close 2.把資料寫入檔案中 使用fil...

stream流根據集合中的元素的屬性進行去重的方法

public class streamlisttest 輸出結果 student stuno 1,name zhangsan student stuno 1,name 趙六 student stuno 2,name wangwu student stuno 3,name 超仔 以下是根據物件中的某個...