Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
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
项目统一框架
amos-boot-biz
Commits
02c35853
Commit
02c35853
authored
Aug 11, 2021
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修改sql
parent
ac201701
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
90 deletions
+66
-90
PlanTaskController.java
...s/maintenance/business/controller/PlanTaskController.java
+3
-3
dbTemplate_plan_task.xml
...nce/src/main/resources/db/mapper/dbTemplate_plan_task.xml
+63
-87
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/controller/PlanTaskController.java
View file @
02c35853
...
@@ -481,8 +481,8 @@ public class PlanTaskController extends AbstractBaseController {
...
@@ -481,8 +481,8 @@ public class PlanTaskController extends AbstractBaseController {
@ApiParam
(
value
=
"维保状态"
)
@RequestParam
(
value
=
"finishStatus"
,
required
=
false
)
Integer
finishStatus
,
@ApiParam
(
value
=
"维保状态"
)
@RequestParam
(
value
=
"finishStatus"
,
required
=
false
)
Integer
finishStatus
,
@ApiParam
(
value
=
"排序条件"
)
@RequestParam
(
value
=
"orderBy"
)
String
orderBy
,
@ApiParam
(
value
=
"排序条件"
)
@RequestParam
(
value
=
"orderBy"
)
String
orderBy
,
@ApiParam
(
value
=
"业主单位"
)
@RequestParam
(
value
=
"companyId"
,
required
=
false
)
String
companyId
,
@ApiParam
(
value
=
"业主单位"
)
@RequestParam
(
value
=
"companyId"
,
required
=
false
)
String
companyId
,
@ApiParam
(
value
=
"当前页"
)
@RequestParam
(
value
=
"pageNumber"
)
int
current
,
@ApiParam
(
value
=
"当前页"
)
@RequestParam
(
value
=
"pageNumber"
)
int
pageNumber
,
@ApiParam
(
value
=
"页大小"
)
@RequestParam
(
value
=
"pageSize"
)
int
s
ize
)
throws
Exception
{
@ApiParam
(
value
=
"页大小"
)
@RequestParam
(
value
=
"pageSize"
)
int
pageS
ize
)
throws
Exception
{
HashMap
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
HashMap
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getLoginOrgCode
(
reginParams
);
String
loginOrgCode
=
getLoginOrgCode
(
reginParams
);
...
@@ -495,7 +495,7 @@ public class PlanTaskController extends AbstractBaseController {
...
@@ -495,7 +495,7 @@ public class PlanTaskController extends AbstractBaseController {
params
.
put
(
"endTime"
,
endTime
);
params
.
put
(
"endTime"
,
endTime
);
params
.
put
(
"finishStatus"
,
finishStatus
);
params
.
put
(
"finishStatus"
,
finishStatus
);
params
.
put
(
"orderBy"
,
OrderByEnum
.
getEumByCode
(
orderBy
).
getOderBy
());
params
.
put
(
"orderBy"
,
OrderByEnum
.
getEumByCode
(
orderBy
).
getOderBy
());
CommonPageable
pageable
=
new
CommonPageable
(
current
,
s
ize
);
CommonPageable
pageable
=
new
CommonPageable
(
pageNumber
,
pageS
ize
);
try
{
try
{
return
CommonResponseUtil
.
success
(
planTaskService
.
getPlanTasks
(
params
,
pageable
));
return
CommonResponseUtil
.
success
(
planTaskService
.
getPlanTasks
(
params
,
pageable
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
amos-boot-system-maintenance/src/main/resources/db/mapper/dbTemplate_plan_task.xml
View file @
02c35853
...
@@ -171,28 +171,14 @@
...
@@ -171,28 +171,14 @@
</select>
</select>
<select
id=
"getPlanTasks"
resultType=
"Map"
>
<select
id=
"getPlanTasks"
resultType=
"Map"
>
SELECT
SELECT
a.planTaskId,
*
a.OrgCode,
FROM
a.taskName,
(SELECT
a.userId,
a.beginTime,
a.endTime,
a.checkDate,
a.finishNum,
a.taskPlanNum,
a.finishStatus,
a.batchNo,
a.userId executiveName,
a.userName,
a.userDept
FROM
(
SELECT
pt.id planTaskId,
pt.id planTaskId,
pt.org_code
O
rgCode,
pt.org_code
o
rgCode,
p.
NAME
taskName,
p.
name
taskName,
pt.
STATUS
,
pt.
status
,
pt.user_id userId,
pt.user_id userId,
date_format(
date_format(
pt.begin_time,
pt.begin_time,
...
@@ -202,93 +188,83 @@
...
@@ -202,93 +188,83 @@
pt.end_time,
pt.end_time,
'%Y-%m-%d %H:%i:%s'
'%Y-%m-%d %H:%i:%s'
) endTime,
) endTime,
date_format(
date_format(
pt.check_date,
pt.check_date,
'%Y-%m-%d %H:%i:%s'
'%Y-%m-%d %H:%i:%s'
)checkDate,
) checkDate,
pt.point_num as taskPlanNum,
pt.finish_num finishNum,
pt.finish_num finishNum,
(pt.point_num - pt.finish_num) as waitNum,
pt.finish_status finishStatus,
pt.finish_status finishStatus,
pt.id batchNo,
pt.id batchNo,
pt.route_id,
pt.route_id,
pt.point_num taskPlanNum,
pt.user_name userName,
pt.user_name userName,
pt.user_dept userDept
r.owner_id,
R.owner_name as ownerName
FROM
FROM
p_plan_task pt
p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_route r on r.id = pt.route_id
) a
) a
<include
refid=
"mobile-plan-task-where"
/>
limit #{offset},#{pageSize}
</select>
<sql
id=
"mobile-plan-task-where"
>
<where>
<where>
<if
test=
"userId != null and userId > 0 "
>
and find_in_set(#{userId},a.userId)>0
</if>
<if
test=
"userId != null and userId > 0 "
>
and find_in_set(#{userId},a.userId)>0
</if>
<if
test=
"finishStatus != null"
>
and a.finishStatus = #{finishStatus}
</if>
<if
test=
"finishStatus != null"
>
and a.finishStatus = #{finishStatus}
</if>
<if
test=
"orgCode != null and orgCode !=''"
>
<if
test=
"startTime != null and startTime != '' and endTime != null and endTime != '' "
>
and (a.OrgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.OrgCode= #{orgCode} )
AND (
</if>
(
a.beginTime
<![CDATA[>=]]>
#{startTime}
<if
test=
"startTime != null and startTime != '' and endTime != null and endTime != '' "
>
AND a.endTime
<![CDATA[<=]]>
#{endTime}
AND (
(
a.beginTime
<![CDATA[>=]]>
#{startTime}
AND a.endTime
<![CDATA[<=]]>
#{endTime}
)
OR (
a.beginTime
<![CDATA[<=]]>
#{endTime}
AND a.endTime
<![CDATA[>=]]>
#{endTime}
)
OR (
a.beginTime
<![CDATA[<=]]>
#{startTime}
AND a.endTime
<![CDATA[>]]>
#{startTime}
)
OR (
a.beginTime
<![CDATA[<=]]>
#{startTime}
AND a.endTime
<![CDATA[>=]]>
#{endTime}
)
)
)
</if>
OR (
a.beginTime
<![CDATA[<=]]>
#{endTime}
AND a.endTime
<![CDATA[>=]]>
#{endTime}
)
OR (
a.beginTime
<![CDATA[<=]]>
#{startTime}
AND a.endTime
<![CDATA[>]]>
#{startTime}
)
OR (
a.beginTime
<![CDATA[<=]]>
#{startTime}
AND a.endTime
<![CDATA[>=]]>
#{endTime}
)
)
</if>
<choose>
<when
test=
"identityType==1"
>
And (a.orgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.orgCode= #{orgCode} )
<if
test=
"companyId != null"
>
and a.owner_id = #{companyId}
</if>
</when>
<when
test=
"identityType==2"
>
And a.owner_id = #{companyId}
</when>
</choose>
</where>
</where>
<if
test=
"orderBy != null and orderBy != '' "
>
order by ${orderBy}
</if>
<if
test=
"orderBy != null and orderBy != ''"
>
order by ${orderBy}
</if>
limit #{offset},#{pageSize}
</sql>
</select>
<select
id=
"getPlanTasksCount"
resultType=
"long"
>
<select
id=
"getPlanTasksCount"
resultType=
"long"
>
SELECT
SELECT
count(1) tasksCount
count(1) tasksCount
FROM
FROM
(
(
SELECT
SELECT
pt.id
pt.id,
FROM
pt.user_id as userId,
pt.finish_status as finishStatus,
pt.org_code as orgCode,
pt.begin_time as beginTime,
pt.end_time as endTime,
r.owner_id
FROM
p_plan_task pt
p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_route r on r.id = pt.route_id
) a
) a
<where>
<include
refid=
"mobile-plan-task-where"
/>
<if
test=
"userId != null and userId > 0 "
>
and find_in_set(#{userId},a.userId)>0
</if>
<if
test=
"finishStatus != null"
>
and a.finishStatus = #{finishStatus}
</if>
<if
test=
"orgCode != null and orgCode !=''"
>
and (a.OrgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.OrgCode= #{orgCode} )
</if>
<if
test=
"startTime != null and startTime != '' and endTime != null and endTime != '' "
>
AND (
(
a.beginTime
<![CDATA[>=]]>
#{startTime}
AND a.endTime
<![CDATA[<=]]>
#{endTime}
)
OR (
a.beginTime
<![CDATA[<=]]>
#{endTime}
AND a.endTime
<![CDATA[>=]]>
#{endTime}
)
OR (
a.beginTime
<![CDATA[<=]]>
#{startTime}
AND a.endTime
<![CDATA[>]]>
#{startTime}
)
OR (
a.beginTime
<![CDATA[<=]]>
#{startTime}
AND a.endTime
<![CDATA[>=]]>
#{endTime}
)
)
</if>
</where>
</select>
</select>
<select
id=
"queryPlanTaskById"
resultType=
"Map"
>
<select
id=
"queryPlanTaskById"
resultType=
"Map"
>
SELECT
SELECT
...
...
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