皇家赌场游戏:后台从数据库查出一个结实集

皇家赌场游戏:后台从数据库查出一个结实集

皇家赌场游戏 1

<p>项目中相见叁个难点,项目中得到了<null>的再次来到值

GCD有三种queue

这个是Repository的用的JPA

皇家赌场游戏 2

main queue: 主线程队列。是多个串行队列。经常用来更新UI。

@Query(value="WITHcte1AS(selectto_char(created_time,'YYYY-MM')ASmonthsfrome_expenseformitemWHEREcreated_timeBETWEEN'2019-01-01'and'2019-07-31'groupbymonths),\n"+"cte2AS(\n"+"SELECT\n"+"\tto_char(created_time,'YYYY-MM')ASmonths,\n"+"\tsum(fill_figure)AStrain_amount\n"+"FROM\n"+"\te_expenseformitemi\n"+"WHERE\n"+"\tsubject_nameLIKE'%火车%'\n"+"GROUPBY\n"+"\tmonths\n"+"\t),\n"+"\tcte3AS(\n"+"SELECT\n"+"\tto_char(created_time,'YYYY-MM')ASmonths,\n"+"\tsum(fill_figure)ASplane_amount\n"+"FROM\n"+"\te_expenseformitemi\n"+"WHERE\n"+"\tsubject_nameLIKE'%飞机%'\n"+"GROUPBY\n"+"\tmonths\n"+"\t),\n"+"\tcte4AS(\n"+"SELECT\n"+"\tto_char(created_time,'YYYY-MM')ASmonths,\n"+"\tsum(fill_figure)AScar_amount\n"+"FROM\n"+"\te_expenseformitemi\n"+"WHERE\n"+"\tsubject_nameLIKE'%自驾%'\n"+"GROUPBY\n"+"\tmonths\n"+"\n"+"\t),\n"+"\tcte5AS(\n"+"SELECT\n"+"\tto_char(created_time,'YYYY-MM')ASmonths,\n"+"\tsum(fill_figure)AShotel_amount\n"+"FROM\n"+"\te_expenseformitemi\n"+"WHERE\n"+"\tsubject_nameLIKE'%住宿%'\n"+"GROUPBY\n"+"\tmonths\n"+"\n"+"\t),\n"+"\tcte6AS(\n"+"SELECT\n"+"\tto_char(created_time,'YYYY-MM')ASmonths,\n"+"\tsum(fill_figure)AScl_amount\n"+"FROM\n"+"\te_expenseformitemi\n"+"WHERE\n"+"\tsubject_nameLIKE'%材料%'\n"+"GROUPBY\n"+"\tmonths\n"+"\n"+"\t),\n"+"\tcte7AS(\n"+"SELECT\n"+"\tto_char(created_time,'YYYY-MM')ASmonths,\n"+"\tsum(fill_figure)ASkd_amount\n"+"FROM\n"+"\te_expenseformitemi\n"+"WHERE\n"+"\tsubject_nameLIKE'%快递%'\n"+"GROUPBY\n"+"\tmonths\n"+"\n"+"\t),\n"+"\tcte8AS(\n"+"SELECT\n"+"\tto_char(created_time,'YYYY-MM')ASmonths,\n"+"\tsum(fill_figure)ASzd_amount\n"+"FROM\n"+"\te_expenseformitemi\n"+"WHERE\n"+"\tsubject_nameLIKE'%招待费%'\n"+"GROUPBY\n"+"\tmonths\n"+"\n"+"\t),\n"+"\tcte9AS(\n"+"SELECT\n"+"\tto_char(created_time,'YYYY-MM')ASmonths,\n"+"\tsum(fill_figure)ASfz_amount\n"+"FROM\n"+"\te_expenseformitemi\n"+"WHERE\n"+"\tsubject_nameLIKE'%房租%'\n"+"GROUPBY\n"+"\tmonths\n"+"\n"+"\t),\n"+"\tcte10AS(\n"+"SELECT\n"+"\tto_char(created_time,'YYYY-MM')ASmonths,\n"+"\tsum(fill_figure)AStx_amount\n"+"FROM\n"+"\te_expenseformitemi\n"+"WHERE\n"+"\tsubject_nameLIKE'%通讯%'\n"+"GROUPBY\n"+"\tmonths\n"+"\n"+"\t),\n"+"\tcte11AS(\n"+"SELECT\n"+"\tto_char(created_time,'YYYY-MM')ASmonths,\n"+"\tsum(fill_figure)ASwater_amount\n"+"FROM\n"+"\te_expenseformitemi\n"+"WHERE\n"+"\tsubject_nameLIKE'%水费%'\n"+"GROUPBY\n"+"\tmonths\n"+"\n"+"\t),\n"+"\tcte12AS(\n"+"SELECT\n"+"\tto_char(created_time,'YYYY-MM')ASmonths,\n"+"\tsum(fill_figure)ASdf_amount\n"+"FROM\n"+"\te_expenseformitemi\n"+"WHERE\n"+"\tsubject_nameLIKE'%电费%'\n"+"GROUPBY\n"+"\tmonths\n"+"\n"+"\t),\n"+"\tcte13AS(\n"+"SELECT\n"+"\tto_char(created_time,'YYYY-MM')ASmonths,\n"+"\tsum(fill_figure)AScw_amount\n"+"FROM\n"+"\te_expenseformitemi\n"+"WHERE\n"+"\tsubject_nameLIKE'%财务%'\n"+"GROUPBY\n"+"\tmonths\n"+"\n"+"\t),\n"+"\tcte14AS(\n"+"SELECT\n"+"\tto_char(created_time,'YYYY-MM')ASmonths,\n"+"\tsum(fill_figure)ASbg_amount\n"+"FROM\n"+"\te_expenseformitemi\n"+"WHERE\n"+"\tsubject_nameLIKE'%办公%'\n"+"GROUPBY\n"+"\tmonths\n"+"\n"+"\t)SELECT\n"+"\ta.months,\n"+"\tb.train_amount,\n"+"\tc.plane_amount,\n"+"\td.car_amount,\n"+"\te.hotel_amount,\n"+"\tf.cl_amount,\n"+"\tg.kd_amount,\n"+"\th.zd_amount,\n"+"\ti.fz_amount,\n"+"\tj.tx_amount,\n"+"\tk.water_amount,\n"+"\tl.df_amount,\n"+"\tm.cw_amount,\n"+"\tn.bg_amount\n"+"FROM\n"+"\tcte1a\n"+"\tLEFTJOINcte2bONa.months=b.months\n"+"\tLEFTJOINcte3cONa.months=c.months\n"+"\tLEFTJOINcte4dONa.months=d.months\n"+"\tLEFTJOINcte5eONa.months=e.months\n"+"\tLEFTJOINcte6fONa.months=f.months\n"+"\tLEFTJOINcte7gONa.months=g.months\n"+"\tLEFTJOINcte8hONa.months=h.months\n"+"\tLEFTJOINcte9iONa.months=i.months\n"+"\tLEFTJOINcte10jONa.months=j.months\n"+"\tLEFTJOINcte11kONa.months=k.months\n"+"\tLEFTJOINcte12lONa.months=l.months\n"+"\tLEFTJOINcte13mONa.months=m.months\n"+"\tLEFTJOINcte14nONa.months=n.months\n"+"\t\n"+"ORDERBYmonths",nativeQuery=true)ListObject[]findTatalChart();这个是serviceImpl@OverridepublicListObject[]findTotalChart(){ListObject[]tatalChart=expenseFormItemRepository.findTatalChart();for(Object[]objects:tatalChart){System.out.println("");Objecto=JSON.toJSON(objects);System.out.println(o);}returntatalChart;}

显示屏快速照相 二零一五-05-05 上午4.08.04.png

global queue: 全局队列,是多个并行队列。使用办法相信大家都知情。

打字与印刷出来的结果为[“2019-01”,null,null,30.0,4340.0,null,790.0,1921.0,null,149.0,null,44.64,null,449.17][“2019-02”,null,null,null,2510.0,null,1513.0,782.0,1000.0,647.5,null,71.75,null,4106.8099999999995][“2019-03”,null,null,null,8370.0,null,1559.0,4260.0,6883.0,149.7,null,206.64,null,2341.28][“2019-04”,null,null,5031.0,1080.0,null,118.0,855.0,null,null,null,null,null,204.76][“2019-05”,null,null,null,null,null,null,null,null,null,null,null,null,null][“2019-06”,null,null,286.8,180.0,null,37.0,null,1111.0,null,null,null,null,null][“2019-07”,null,null,12.0,null,null,10.0,null,500.0,null,null,null,null,null]唯独数量库查出来的是后台打字与印刷的数据少了不菲,比如7月份的都以null,求助~

单身打字与印刷出里面二个:

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0),^{

皇家赌场游戏 3

[self     test];

显示器快速照相 2014-05-05 凌晨4.08.16.png

}

起来没太以为怎么着,然后判定服务器重临的值是或不是为空,做不相同的操作,但是…不对。
然后互联网检索了下:发现重回值为<null>时,剖断方法为:

地点的情趣正是张开一个异步线程,在全局队列中进行。

if (![self.actionArray.firstObject isEqual:[NSNull null]]) {
        WebViewController *webVC = [[WebViewController alloc] init];
        webVC.urlStr = self.actionArray[index];
        [self.navigationController pushViewController:webVC animated:YES];
    }

custom queue:自定义队列。有二种自定义队列。”

也即是如此推断:

dispatch_queue_t serial_queue =
dispatch_queue_create(“com.reviewcode.www”, DISPATCH_QUEUE_SERIAL);

[yourData isEqual:[NSNull null]]

dispatch_queue_t concurrent_queue =
dispatch_queue_create(“com.concurrent.www”,
DISPATCH_QUEUE_CONCURRENT);

<p>另外,其他的

serial_queue就是小编自定义的二个串行队列。上边提到的主线程队列也是三个串行队列。

NSString *nilTest = nil;
NSString *nullTest = NULL;
NSString *nilTe = Nil;

concurrent_queue是自己自定义的多个并行队列。上边提到的global
queue便是二个相互队列。

本身打字与印刷出来结果是:
(null)—(null)—(null)
<p>判断

今昔我们来谈谈2个难题。

if (nilTest == nil) {
        NSLog(@"nil");
    }

    if (nullTest == nil) {
        NSLog(@"null");
    }

    if (nilTe == nil) {
        NSLog(@"nilTe");
    }

1.dispatch_async里接纳串行队列和相互队列的功能。

均能够打字与印刷出来

2.dispatch_sync里应用串行队列和相互队列的功用。

串行队列和相互队列的开创如下。

serial_queue = dispatch_queue_create(“com.reviewcode.www”,
DISPATCH_QUEUE_SERIAL);

concurrent_queue = dispatch_queue_create(“com.LiSiGuang.www”,
DISPATCH_QUEUE_CONCURRENT);

研商的标题:

“在dispatch_async使用串行队列”

代码如下:

-(void)testSerialQueueWithAsync

{

    for ( int index =0; index < 10; index++)

    {

        dispatch_async(serial_queue,^{

            NSLog(@”index =%d”,index);

            NSLog(@” current thread is %@”,[NSThread currentThread]);

        });

      }

          NSLog(@”Running on main Thread”);

}

接下来在viewDidLoad(卡塔尔国方法里打字与印刷,打字与印刷结果如下。

index =0

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图