Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
44cd045c
Commit
44cd045c
authored
Aug 30, 2024
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
4b230b4a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
2 deletions
+41
-2
RB_Visitor_ReserveRepository.cs
Edu.Repository/Reserve/RB_Visitor_ReserveRepository.cs
+41
-2
No files found.
Edu.Repository/Reserve/RB_Visitor_ReserveRepository.cs
View file @
44cd045c
...
@@ -4,6 +4,7 @@ using Edu.Model.Entity.Reserve;
...
@@ -4,6 +4,7 @@ using Edu.Model.Entity.Reserve;
using
Edu.Model.ViewModel.Duty
;
using
Edu.Model.ViewModel.Duty
;
using
Edu.Model.ViewModel.Reserve
;
using
Edu.Model.ViewModel.Reserve
;
using
System
;
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
...
@@ -175,6 +176,11 @@ WHERE 1=1
...
@@ -175,6 +176,11 @@ WHERE 1=1
builder
.
AppendFormat
(
" AND B.{0} LIKE @StuName "
,
nameof
(
RB_Visitor_Reserve_Extend
.
StuName
));
builder
.
AppendFormat
(
" AND B.{0} LIKE @StuName "
,
nameof
(
RB_Visitor_Reserve_Extend
.
StuName
));
parameters
.
Add
(
"StuName"
,
"%"
+
query
.
StuName
.
Trim
()
+
"%"
);
parameters
.
Add
(
"StuName"
,
"%"
+
query
.
StuName
.
Trim
()
+
"%"
);
}
}
if
(
query
.
IsReserve
==
0
)
{
query
.
IsReserve
=
1
;
}
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Visitor_Reserve_Extend
.
IsReserve
),
query
.
IsReserve
);
}
}
return
Get
<
RB_Visitor_Reserve_Extend
>(
builder
.
ToString
(),
parameters
).
ToList
();
return
Get
<
RB_Visitor_Reserve_Extend
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
}
...
@@ -193,6 +199,11 @@ WHERE 1=1
...
@@ -193,6 +199,11 @@ WHERE 1=1
{
{
builder
.
AppendFormat
(
@" AND A.{0} IN ({1}) "
,
nameof
(
RB_Visitor_Reserve_Extend
.
ReserveClassId
),
query
.
Q_ReserveClassIds
);
builder
.
AppendFormat
(
@" AND A.{0} IN ({1}) "
,
nameof
(
RB_Visitor_Reserve_Extend
.
ReserveClassId
),
query
.
Q_ReserveClassIds
);
}
}
if
(
query
.
IsReserve
==
0
)
{
query
.
IsReserve
=
1
;
}
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Visitor_Reserve_Extend
.
IsReserve
),
query
.
IsReserve
);
string
sql
=
string
.
Format
(
@"
string
sql
=
string
.
Format
(
@"
SELECT A.*,IFNULL(B.StuName,'') AS VisitorName
SELECT A.*,IFNULL(B.StuName,'') AS VisitorName
FROM RB_Visitor_Reserve AS A LEFT JOIN rb_student AS B ON A.Visitor_Id=B.StuId
FROM RB_Visitor_Reserve AS A LEFT JOIN rb_student AS B ON A.Visitor_Id=B.StuId
...
@@ -226,6 +237,11 @@ WHERE 1=1
...
@@ -226,6 +237,11 @@ WHERE 1=1
{
{
builder
.
AppendFormat
(
" AND A.{0}>='{1}' "
,
nameof
(
RB_Visitor_Reserve_Extend
.
Id
),
query
.
Id
);
builder
.
AppendFormat
(
" AND A.{0}>='{1}' "
,
nameof
(
RB_Visitor_Reserve_Extend
.
Id
),
query
.
Id
);
}
}
if
(
query
.
IsReserve
==
0
)
{
query
.
IsReserve
=
1
;
}
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Visitor_Reserve_Extend
.
IsReserve
),
query
.
IsReserve
);
}
}
return
Get
<
RB_Visitor_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
return
Get
<
RB_Visitor_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
}
...
@@ -252,6 +268,12 @@ WHERE 1=1 AND A.Status=0
...
@@ -252,6 +268,12 @@ WHERE 1=1 AND A.Status=0
{
{
builder
.
AppendFormat
(
" AND A.ReserveClassId={0} "
,
query
.
ReserveClassId
);
builder
.
AppendFormat
(
" AND A.ReserveClassId={0} "
,
query
.
ReserveClassId
);
}
}
if
(
query
.
IsReserve
==
0
)
{
query
.
IsReserve
=
1
;
}
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Visitor_Reserve_Extend
.
IsReserve
),
query
.
IsReserve
);
if
(
query
.
Id
>
0
)
if
(
query
.
Id
>
0
)
{
{
builder
.
AppendFormat
(
" AND A.Id<>{0} "
,
query
.
Id
);
builder
.
AppendFormat
(
" AND A.Id<>{0} "
,
query
.
Id
);
...
@@ -285,6 +307,12 @@ WHERE 1=1
...
@@ -285,6 +307,12 @@ WHERE 1=1
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Visitor_Reserve_Extend
.
Visitor_Id
),
query
.
QVisitor_Ids
);
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Visitor_Reserve_Extend
.
Visitor_Id
),
query
.
QVisitor_Ids
);
}
}
}
}
if
((
query
?.
IsReserve
??
0
)
==
0
)
{
query
.
IsReserve
=
1
;
}
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Visitor_Reserve_Extend
.
IsReserve
),
query
.
IsReserve
);
builder
.
AppendFormat
(
" GROUP BY A.Visitor_Id "
);
builder
.
AppendFormat
(
" GROUP BY A.Visitor_Id "
);
return
Get
<
RB_Visitor_Reserve_Extend
>(
builder
.
ToString
(),
parameters
).
ToList
();
return
Get
<
RB_Visitor_Reserve_Extend
>(
builder
.
ToString
(),
parameters
).
ToList
();
...
@@ -331,6 +359,12 @@ WHERE 1=1
...
@@ -331,6 +359,12 @@ WHERE 1=1
{
{
builder
.
AppendFormat
(
" AND A.{0}<='{1} 23:59:59' "
,
nameof
(
RB_Visitor_Reserve_Extend
.
CreateTime
),
query
.
EndClassDate
);
builder
.
AppendFormat
(
" AND A.{0}<='{1} 23:59:59' "
,
nameof
(
RB_Visitor_Reserve_Extend
.
CreateTime
),
query
.
EndClassDate
);
}
}
if
(
query
.
IsReserve
==
0
)
{
query
.
IsReserve
=
1
;
}
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Visitor_Reserve_Extend
.
IsReserve
),
query
.
IsReserve
);
}
}
builder
.
AppendFormat
(
@" GROUP BY A.CreateBy,DATE_FORMAT(A.CreateTime,'%Y/%m/%d') "
);
builder
.
AppendFormat
(
@" GROUP BY A.CreateBy,DATE_FORMAT(A.CreateTime,'%Y/%m/%d') "
);
builder
.
AppendFormat
(
@" ORDER BY A.CreateBy,DATE_FORMAT(A.CreateTime,'%Y/%m/%d') "
);
builder
.
AppendFormat
(
@" ORDER BY A.CreateBy,DATE_FORMAT(A.CreateTime,'%Y/%m/%d') "
);
...
@@ -354,6 +388,12 @@ WHERE 1=1 AND A.Status=0 {0}
...
@@ -354,6 +388,12 @@ WHERE 1=1 AND A.Status=0 {0}
{
{
sql
+=
string
.
Format
(
@" AND A.CreateBy={0} "
,
query
.
CreateBy
);
sql
+=
string
.
Format
(
@" AND A.CreateBy={0} "
,
query
.
CreateBy
);
}
}
if
(
query
.
IsReserve
==
0
)
{
query
.
IsReserve
=
1
;
}
sql
+=
string
.
Format
(
" AND A.{0}={1} "
,
nameof
(
RB_Visitor_Reserve_Extend
.
IsReserve
),
query
.
IsReserve
);
sql
+=
" GROUP BY A.CreateBy "
;
sql
+=
" GROUP BY A.CreateBy "
;
string
todayWhere
=
""
;
string
todayWhere
=
""
;
if
(!
string
.
IsNullOrEmpty
(
query
.
StartClassDate
))
if
(!
string
.
IsNullOrEmpty
(
query
.
StartClassDate
))
...
@@ -446,9 +486,8 @@ WHERE 1=1 AND A.Status=0 {0}
...
@@ -446,9 +486,8 @@ WHERE 1=1 AND A.Status=0 {0}
{
{
string
sql
=
$@"SELECT c.TeacherId FROM rb_visitor_reserve r
string
sql
=
$@"SELECT c.TeacherId FROM rb_visitor_reserve r
INNER JOIN rb_reserve_class c on r.ReserveClassId = c.ReserveClassId
INNER JOIN rb_reserve_class c on r.ReserveClassId = c.ReserveClassId
WHERE r.Group_Id =
{
groupId
}
and r.`Status` =0 and c.`Status` =0 and r.Visitor_Id =
{
stuId
}
WHERE r.Group_Id =
{
groupId
}
and r.`Status` =0 and c.`Status` =0 and r.Visitor_Id =
{
stuId
}
AND A.IsReserve=1
ORDER BY c.ClassDate DESC LIMIT 1"
;
ORDER BY c.ClassDate DESC LIMIT 1"
;
var
obj
=
ExecuteScalar
(
sql
);
var
obj
=
ExecuteScalar
(
sql
);
return
obj
!=
null
?
Convert
.
ToInt32
(
obj
)
:
0
;
return
obj
!=
null
?
Convert
.
ToInt32
(
obj
)
:
0
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment