-
Notifications
You must be signed in to change notification settings - Fork 15
/
mysql.xml
735 lines (663 loc) · 26.8 KB
/
mysql.xml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root [<!ELEMENT root ANY><!ELEMENT item ANY><!ATTLIST item ID ID #REQUIRED><!ATTLIST item Explanation CDATA #IMPLIED>]>
<root>
<item ID="basic_user">
<item ID="basic_user__session_update">
update basic_user_session set
session = '__r_session__'
,lastaction = 'session_update'
,lastactiontime = '__lastactiontime__'
,count_actions = count_actions + 1
where user_code = __user_code__ and
(
md5( concat( session, hour(now()) ) ) = __session__ or
md5( concat( session, hour(now())-1 ) ) = __session__
)
</item>
<item ID="basic_user__getSession">
select user_id,user_type,group_code,permissions,groups,session from basic_user_session where
user_code = '__user_code__'
</item>
<item ID="basic_user__logout">
delete from basic_user_session where user_code = __user_code__ and
(
md5( concat( session, hour(now()) ) ) = __session__ or
md5( concat( session, hour(now())-1 ) ) = __session__
)
</item>
<item ID="basic_user__login_session">
insert into basic_user_session
(
user_id
,user_code
,group_code
,groups
,user_type
,permissions
,session
,ip
,client
,gis_lat
,gis_lot
) values (
(select id from basic_user where username = '__username__')
,'__username__'
,(select group_code from basic_user where username = '__username__')
,(select group_all from basic_user where username = '__username__')
,(select type from basic_user where username = '__username__')
,'__permissions__'
,'__session__'
,'__ip__'
,'__client__'
,'__gis_lat__'
,'__gis_lot__'
);
</item>
<item ID="basic_user__login_check">
select
basic_user.username,
basic_user.password,
basic_user.money,
basic_user.credits,
basic_user.group_code,
basic_user.group_all,
basic_user.id,
basic_user.type,
basic_user.status,
basic_user_session.session,
basic_user_session.permissions,
basic_user_session.ip,
basic_user_session.client,
(select value from basic_parameter where reference = 'basic_user__type' and basic_parameter.code = basic_user.type) as type_,
(select value from basic_parameter where reference = 'basic_user__status' and basic_parameter.code = basic_user.status) as status_
from basic_user left join basic_user_session on basic_user.username = basic_user_session.user_code where basic_user.username = '__username__' and
EXISTS (select basic_group.code from basic_group where basic_group.code =
basic_user.group_code and basic_group.status = '10')
</item>
<item ID="basic_user__login_logout">
delete from basic_user_session where user_code = '__user_code__'
</item>
<item ID="basic_user__getPermission">
select * from
(
select permission_code,cost,credits from basic_group_2_permission where group_code in (
SELECT group_code from basic_group_2_user where user_code = '__username__'
)) temptable
left join basic_permission on temptable.permission_code = basic_permission.code
order by code
</item>
<item ID="basic_user__grid">
select
username
,money
,credits
,lastlogintime
,lastlogouttime
,(select name from basic_group where code = basic_user.group_code ) as
group_name
,group_code
,type
,id
,status
,time_created
,creater_id
,creater_group_code,
(select value from basic_parameter where code = basic_user.type and reference =
'basic_user__type') as type_,
(select value from basic_parameter where code = basic_user.status and reference
= 'basic_user__status') as status_
from basic_user
__where__
limit __offset__ , __limit__
</item>
<item ID="basic_user__view">
SELECT
basic_user.username,
basic_user.money,
basic_user.credits,
left(basic_user.lastlogintime,10) as lastlogintime,
left(basic_user.lastlogouttime,10) as lastlogouttime,
basic_user.count_login,
basic_user.count_actions_period,
basic_user_session.client,
basic_user_session.ip,
basic_user_session.session,
basic_user.count_actions,
basic_user.group_code,
basic_user.group_all,
basic_user.id,
left(basic_user.time_created,10) as time_created,
left(basic_user.time_lastupdated,10) as time_lastupdated,
basic_user.count_updated,
basic_user.`type`,
basic_user.`status`,
(select value from basic_parameter where code = basic_user.type and reference =
'basic_user__type') as type_,
(select value from basic_parameter where code = basic_user.status and reference
= 'basic_user__status') as status_,
basic_user.remark,
'nothing' as nothing
FROM
basic_user
Left Join basic_user_session ON basic_user.username =
basic_user_session.user_code
where basic_user.id = __id__
</item>
<item ID="basic_user__group_get">
SELECT
basic_group.name,
basic_group.code,
basic_group.type,
t.user_code
FROM
basic_group
Left Join (select user_code,group_code from basic_group_2_user where
user_code = '__username__') t ON basic_group.code = t.group_code
UNION
select basic_node.name,basic_node.code,'99' as type, null as user_code
FROM
basic_node where basic_node.tablename = 'basic_group'
order by code
</item>
</item>
<item ID="basic_group">
<item ID="basic_group__permission_get">
SELECT
basic_permission.name,
basic_permission.code,
basic_permission.icon,
basic_group_2_permission.cost,
basic_group_2_permission.credits
FROM
basic_permission
left Join ( select * from basic_group_2_permission where group_code =
__group_code__ ) basic_group_2_permission ON basic_permission.code =
basic_group_2_permission.permission_code
</item>
<item ID="basic_group__grid">
SELECT
basic_group.name,
basic_group.code,
basic_group.count_users,
type,id,status,
(select value from basic_parameter where code = basic_group.type and reference =
'basic_group__type') as type_,
(select value from basic_parameter where code = basic_group.status and reference
= 'basic_group__status') as status_
FROM
basic_group
__where__
limit __offset__ , __limit__
</item>
<item ID="basic_group__simulate_permission">
insert into basic_group_2_permission (permission_code,group_code)
SELECT
basic_permission.`code` as permission_code
,basic_group.`code` as group_code
FROM
basic_permission ,
basic_group
WHERE
((basic_permission.`code` >= '60' AND basic_permission.`code` not like '%1_' and basic_permission.`code` not like '%2_' and basic_permission.`code` not like '6005%' ) or basic_permission.code like '11%' )
AND basic_group.`code` like '%-%'
</item>
</item>
<item ID="basic_memory">
<item ID="basic_memory__init">
delete from basic_memory where type = 2;
insert into basic_memory (code,type,extend1) values ('basic_user','2',0);
update basic_memory set extend1 = (select max(id) from basic_user) where code = 'basic_user' and type = 2;
insert into basic_memory (code,type,extend1) values ('basic_group','2',0);
update basic_memory set extend1 = (select max(id) from basic_group) where code = 'basic_group' and type = 2;
insert into basic_memory (code,type,extend1) values ('exam_paper','2',0);
update basic_memory set extend1 = (select max(id) from exam_paper) where code = 'exam_paper' and type = 2 and (select max(id) from exam_paper) > 0;
insert into basic_memory (code,type,extend1) values ('exam_paper_log','2',0);
update basic_memory set extend1 = (select max(id) from exam_paper_log) where code = 'exam_paper_log' and type = 2 and (select count(id) from exam_paper_log) > 0;
insert into basic_memory (code,type,extend1) values ('exam_paper_multionline','2',0);
update basic_memory set extend1 = (select max(id) from exam_paper_multionline) where code = 'exam_paper_multionline' and
type = 2 and (select count(id) from exam_paper_multionline) > 0;
insert into basic_memory (code,type,extend1) values ('exam_question','2',0);
update basic_memory set extend1 = (select max(id) from exam_question) where code = 'exam_question' and type = 2 and (select count(id) from exam_question) > 0;
insert into basic_memory (code,type,extend1) values ('exam_question_log','2',0);
update basic_memory set extend1 = (select max(id) from exam_question_log) where code = 'exam_question_log' and type = 2 and (select count(id) from exam_question_log) > 0;
insert into basic_memory (code,type,extend1) values ('exam_question_log_wrongs','2',0);
update basic_memory set extend1 = (select max(id) from exam_question_log_wrongs) where code = 'exam_question_log_wrongs' and type = 2 and (select count(id) from exam_question_log_wrongs) > 0;
insert into basic_memory (code,type,extend1) values ('exam_subject_2_user_log','2',0);
update basic_memory set extend1 = (select max(id) from exam_subject_2_user_log) where code = 'exam_subject_2_user_log' and type = 2 and (select count(id) from exam_subject_2_user_log) > 0;
select 1
</item>
<item ID="basic_memory__id">
select extend1 as id from basic_memory where type = 2 and code = '__code__'
</item>
<item ID="basic_memory__id_add">
update basic_memory set extend1 = (extend1 + 1) where type = 2 and code = '__code__'
</item>
<item ID="basic_memory__id_update">
update basic_memory set extend1 = (select max(id) from
__code__) where type
= 2 and code =
'__code__'
</item>
</item>
<item ID="basic_parameter">
<item ID="basic_parameter__grid">
SELECT
*
FROM
basic_parameter
__where__
limit __offset__ , __limit__
</item>
<item ID="basic_parameter__json">
SELECT
basic_parameter.code,
basic_parameter.value,
basic_parameter.reference
FROM
basic_parameter
WHERE basic_parameter.reference like '%\_%\_\_%'
ORDER BY
basic_parameter.reference ASC
</item>
</item>
<item ID="exam_paper">
<item ID="exam_paper__grid">
SELECT
exam_paper.subject_code,
(select name from exam_subject where exam_subject.code =
exam_paper.subject_code ) as subject_name,
exam_paper.title,
exam_paper.cost,
exam_paper.count_used,
exam_paper.cent_all,
exam_paper.cent,
exam_paper.cent_subjective,
exam_paper.cent_objective,
exam_paper.count_question,
exam_paper.count_subjective,
exam_paper.count_objective,
exam_paper.cent_top,
exam_paper.id,
exam_paper.creater_code,
exam_paper.creater_group_code,
left(time_created,10) as time_created,
exam_paper.time_lastupdated,
exam_paper.count_updated,
exam_paper.`type`,
exam_paper.`status`,
(select value from basic_parameter where extend4 = exam_paper.type and reference = 'exam_paper__type') as type_,
(select value from basic_parameter where extend4 = exam_paper.status and reference = 'exam_paper__status') as status_,
exam_paper.remark,
'nothing' as nothing
FROM
exam_paper
__where__
limit __offset__ , __limit__
</item>
<item ID="exam_paper__questions">
SELECT
exam_question.id,
exam_question.id_parent,
exam_question.cent,
exam_question.`type`,
exam_question.title,
exam_question.option_length,
exam_question.option_1,
exam_question.option_2,
exam_question.option_3,
exam_question.option_4,
exam_question.option_5,
exam_question.option_6,
exam_question.option_7,
exam_question.knowledge,
exam_question.difficulty,
exam_question.layout,
exam_question.path_listen,
exam_question.path_img
FROM
exam_question
where paper_id = __paper_id__
order by id
</item>
<item ID="exam_paper__view">
SELECT
exam_paper.subject_code,
(select name from exam_subject where exam_subject.code = exam_paper.subject_code ) as subject_name,
exam_paper.title,
exam_paper.cost,
exam_paper.count_used,
exam_paper.cent_all,
exam_paper.cent,
exam_paper.cent_subjective,
exam_paper.cent_objective,
exam_paper.count_question,
exam_paper.count_subjective,
exam_paper.count_objective,
exam_paper.id,
exam_paper.creater_code,
exam_paper.creater_group_code,
(select name from basic_group where code = exam_paper.creater_group_code) as creater_group,
left(exam_paper.time_created,10) as time_created,
exam_paper.time_lastupdated,
exam_paper.count_updated,
exam_paper.`type`,
exam_paper.`status`,
(select value from basic_parameter where extend4 = exam_paper.type and reference = 'exam_paper__type') as type_,
(select value from basic_parameter where extend4 = exam_paper.status and reference = 'exam_paper__status') as status_,
exam_paper.remark,
'nothing' as nothing
FROM
exam_paper
where exam_paper.id = __id__
</item>
<item ID="exam_paper__submit_check">
SELECT
exam_question.id,
exam_question.cent,
exam_question.answer,
exam_question.description,
exam_question.knowledge,
exam_question.difficulty,
exam_question.type
FROM
exam_question
where exam_question.paper_id = __id__
order by exam_question.id
</item>
</item>
<item ID="exam_subject">
<item ID="exam_subject__grid">
select code,name,type,
(select value from basic_parameter where extend4 = exam_subject.type and reference = 'exam_subject__type') as type_
from exam_subject
</item>
<item ID="exam_subject__group_get">
select
code ,name,t.subject_code
from
basic_group
left join
(select * from exam_subject_2_group where subject_code = __code__ ) t on
t.group_code = basic_group.code
order by code
</item>
<item ID="exam_subject__getMy">
SELECT
exam_subject_2_group.subject_code,
(select name from exam_subject where exam_subject.code = exam_paper.subject_code ) as subject_name,
FROM
exam_subject_2_group,basic_user where exam_subject_2_group.group_code = basic_user.group_code
and basic_user.username = '__username__'
</item>
<item ID="exam_subject__view">
SELECT
exam_subject.`code`,
exam_subject.`name`,
exam_subject.directions,
exam_subject.weight,
exam_subject.id,
exam_subject.type,
exam_subject.`status`,
exam_subject.remark
FROM
exam_subject
where id = __id__
</item>
</item>
<item ID="exam_paper_log">
<item ID="exam_paper_log__grid">
SELECT
exam_paper_log.mycent,
exam_paper_log.count_right,
exam_paper_log.paper_id,
exam_paper_log.id,
exam_paper_log.creater_code,
exam_paper_log.creater_group_code,
exam_paper_log.type,
exam_paper_log.`status`,
exam_paper.subject_code,
exam_paper.title,
exam_paper.cent,
exam_paper.cent_top,
exam_paper.creater_code as teacher_code,
exam_paper_log.count_wrong,
exam_paper_log.time_created,
exam_paper.count_question,
(select value from basic_parameter where extend4 = exam_paper_log.type and reference = 'exam_paper_log__type') as type_,
(select value from basic_parameter where extend4 = exam_paper_log.status and reference = 'exam_paper_log__status') as status_,
(select name from exam_subject where exam_subject.code = exam_paper.subject_code ) as subject_name,
'x'
FROM
exam_paper_log
LEFT JOIN exam_paper ON exam_paper_log.paper_id = exam_paper.id
__where__
limit __offset__ , __limit__
</item>
<item ID="exam_paper_log__questions">
SELECT
exam_question.id,
exam_question_log.myanswer,
exam_question.id_parent,
exam_question.`type`,
exam_question.cent,
exam_question.title,
exam_question.option_length,
exam_question.option_1,
exam_question.option_2,
exam_question.option_3,
exam_question.option_4,
exam_question.option_5,
exam_question.option_6,
exam_question.option_7,
exam_question.answer,
exam_question.description,
exam_question.path_listen,
exam_question.path_img,
exam_question.layout
FROM
exam_question_log
Left Join exam_question ON exam_question_log.question_id =
exam_question.id
WHERE
exam_question_log.paper_log_id = __id__
ORDER BY
exam_question_log.question_id ASC
</item>
</item>
<item ID="exam_question_log_wrongs">
<item ID="exam_question_log_wrongs__grid">
SELECT
exam_question_log_wrongs.id,
exam_question_log_wrongs.question_id,
exam_question_log_wrongs.creater_code,
exam_question_log_wrongs.time_created,
exam_question.subject_code,
(select name from exam_subject where exam_subject.code = exam_question.subject_code ) as subject_name,
exam_question.title,
exam_question.difficulty,
(select value from basic_parameter where code = exam_question.type and reference = 'exam_question__type') as type_,
exam_question.`type`,
'what'
FROM
exam_question_log_wrongs
Left Join exam_question ON exam_question_log_wrongs.question_id = exam_question.id
__WHERE__
order by __ORDER__
limit __OFFSET__ , __PAGESIZE__
</item>
<item ID="exam_question_log_wrongs__questions">
<![CDATA[
SELECT
exam_question.id,
exam_question.type,
exam_question.id_parent,
exam_question.title,
exam_question.option_length,
exam_question.option_1,
exam_question.option_2,
exam_question.option_3,
exam_question.option_4,
exam_question.option_5,
exam_question.option_6,
exam_question.option_7,
exam_question.answer,
exam_question.description,
exam_question.layout,
exam_question.path_img,
exam_question.path_listen
FROM
exam_question_log_wrongs
,exam_question where exam_question_log_wrongs.question_id = exam_question.id
and
exam_question_log_wrongs.creater_code = __creater_code__
order by exam_question.id limit 50
]]>
</item>
</item>
<item ID="exam_paper_multionline">
<item ID="exam_paper_multionline__grid">
select
exam_paper_multionline.time_start,
exam_paper_multionline.time_stop,
exam_paper_multionline.passline,
exam_paper_multionline.count_total,
exam_paper_multionline.count_giveup,
exam_paper_multionline.count_passed,
exam_paper_multionline.count_failed,
exam_paper_multionline.proportion,
exam_paper_multionline.id as mid,
exam_paper_multionline.type,
exam_paper_multionline.status,
(select value from basic_parameter where extend4 = exam_paper_multionline.type and reference = 'exam_paper_multionline__type') as type_,
(select value from basic_parameter where extend4 = exam_paper_multionline.status and reference = 'exam_paper_multionline__status') as status_,
(select name from exam_subject where exam_subject.code = exam_paper.subject_code ) as subject_name,
exam_paper.id as pid,
exam_paper.subject_code,
exam_paper.title,
exam_paper.cent,
exam_paper.creater_code,
exam_paper.creater_group_code,
exam_paper.count_question
FROM
exam_paper_multionline,exam_paper where exam_paper_multionline.paper_id = exam_paper.id
__WHERE__
order by __ORDER__
limit __OFFSET__ , __PAGESIZE__
</item>
<item ID="exam_paper_multionline__grid_student">
<![CDATA[
SELECT
(case (exam_paper_multionline.status='20')
when true then exam_paper_log.mycent
else '-'
end) as mycent,
exam_paper_log.time_lastupdated,
exam_paper_log.rank,
exam_paper_log.creater_code,
exam_paper_log.id as lid,
exam_paper.id as pid,
exam_paper_multionline.id as mid,
exam_paper_multionline.passline,
exam_paper_multionline.time_start,
exam_paper_multionline.time_stop,
exam_paper_multionline.count_total,
exam_paper_log.type,
exam_paper_log.`status`,
exam_paper_multionline.count_giveup,
exam_paper_multionline.count_passed,
exam_paper_multionline.count_failed,
exam_paper.title,
exam_paper.subject_code,
exam_paper_multionline.creater_code as teacher_code,
(select value from basic_parameter where extend4 = exam_paper_log.type and reference = 'exam_paper_log__type') as type_,
(select value from basic_parameter where extend4 = exam_paper_log.status and reference = 'exam_paper_log__status') as status_,
exam_paper_multionline.status as status2,
(select value from basic_parameter where extend4 = exam_paper_multionline.status and reference = 'exam_paper_multionline__status') as status2_,
(select name from exam_subject where exam_subject.code = exam_paper.subject_code ) as subject_name,
'what'
FROM
exam_paper_log,exam_paper_multionline,exam_paper
where exam_paper_log.paper_id = exam_paper_multionline.paper_id
and exam_paper_log.paper_id = exam_paper.id
__WHERE__
order by __ORDER__
limit __OFFSET__ , __PAGESIZE__
]]>
</item>
<item ID="exam_paper_multionline__view">
SELECT
exam_paper.title,
exam_paper.subject_code,
(select name from exam_subject where exam_subject.code = exam_paper.subject_code ) as subject_name,
exam_paper.cent,
exam_paper.cent_all,
exam_paper.cent_subjective,
exam_paper.cent_objective,
exam_paper.count_question,
exam_paper.count_subjective,
exam_paper.count_objective,
exam_paper.count_used,
exam_paper.id,
exam_paper.creater_code,
exam_paper.creater_group_code,
exam_paper.time_created,
exam_paper.time_lastupdated,
exam_paper.count_updated,
exam_paper.`status`,
exam_paper.`type`,
exam_paper_multionline.time_start,
exam_paper_multionline.time_stop,
exam_paper_multionline.passline,
exam_paper_multionline.count_total,
exam_paper_multionline.count_giveup,
exam_paper_multionline.count_passed,
exam_paper_multionline.count_failed,
exam_paper_multionline.proportion,
exam_paper.remark
FROM
exam_paper_multionline
Left Join exam_paper ON exam_paper_multionline.paper_id = exam_paper.id
where exam_paper.id = __paper_id__
</item>
<item ID="exam_paper_multionline__order">
SELECT
exam_paper_log.mycent,
exam_paper_log.creater_code,
exam_paper_log.creater_group_code,
exam_paper_log.count_right,
exam_paper_log.count_wrong,
exam_paper_log.count_giveup
FROM
exam_paper_log
WHERE
exam_paper_log.paper_id = __paper_id__
ORDER BY
exam_paper_log.mycent DESC
</item>
</item>
<item ID="exam_subject_2_user_log">
<item ID="exam_subject_2_user_log__grid">
SELECT
(select name from exam_subject where code = __G2-SUBJECT__) as subject_name
,__G2-SUBJECT__ as subject_code
,__G1-TIME__ as time
,AVG(count_positive) as postive
,AVG(count_negative) as negative
,AVG(proportion) as proportion
,count(*) as count_log
FROM
(
SELECT
exam_subject_2_user_log.subject_code
,exam_subject_2_user_log.time_created
,exam_subject_2_user_log.count_positive
,exam_subject_2_user_log.count_negative
,exam_subject_2_user_log.proportion
FROM
exam_subject_2_user_log
__WHERE__
) temp_
group by __G1-TIME__,__G2-SUBJECT__
</item>
</item>
</root>