Commit 49ef8e3f authored by 李秀明's avatar 李秀明

feat(patrol): 兼容PostgreSQL

parent b51b18c5
...@@ -152,6 +152,11 @@ ...@@ -152,6 +152,11 @@
<version>15.8.0</version> <version>15.8.0</version>
<classifier>jdk16</classifier> <classifier>jdk16</classifier>
</dependency> </dependency>
<dependency>
<groupId>cn.com.vastdata</groupId>
<artifactId>vastbase-jdbc</artifactId>
<version>2.7v</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
eureka.client.serviceUrl.defaultZone=http://${spring.security.user.name}:${spring.security.user.password}@172.16.11.201:10001/eureka/ eureka.client.serviceUrl.defaultZone=http://${spring.security.user.name}:${spring.security.user.password}@172.16.10.210:10001/eureka/
eureka.client.registry-fetch-interval-seconds=5 eureka.client.registry-fetch-interval-seconds=5
spring.security.user.name=admin spring.security.user.name=admin
spring.security.user.password=a1234560 spring.security.user.password=a1234560
...@@ -20,10 +20,10 @@ ribbon.MaxAutoRetries = 1 ...@@ -20,10 +20,10 @@ ribbon.MaxAutoRetries = 1
xiy_amos_satety_business xiy_amos_satety_business
spring.reactor.debug-agent.enabled=true spring.reactor.debug-agent.enabled=true
#DB properties: #DB properties:
spring.datasource.url=jdbc:mysql://172.16.11.201:3306/dl_business_v3.0.1.3?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8 spring.datasource.url=jdbc:vastbase://36.46.137.116:5432/tzs_amos_tzs_biz_init?currentSchema=business&allowMultiQueries=true
spring.datasource.username=root spring.datasource.username=admin
spring.datasource.password=Yeejoin@2020 spring.datasource.password=Yeejoin@2023
spring.datasource.driver-class-name = com.mysql.jdbc.Driver spring.datasource.driver-class-name = cn.com.vastbase.Driver
spring.datasource.hikari.maxLifetime = 1765000 spring.datasource.hikari.maxLifetime = 1765000
spring.datasource.hikari.maximum-pool-size = 10 spring.datasource.hikari.maximum-pool-size = 10
spring.datasource.testWhileIdle = true spring.datasource.testWhileIdle = true
...@@ -37,7 +37,7 @@ security.appKey=studio_normalapp_3056965 ...@@ -37,7 +37,7 @@ security.appKey=studio_normalapp_3056965
#redis 配置 #redis 配置
spring.redis.database=1 spring.redis.database=1
spring.redis.host=172.16.11.201 spring.redis.host=172.16.10.210
spring.redis.port=6379 spring.redis.port=6379
spring.redis.password=yeejoin@2020 spring.redis.password=yeejoin@2020
spring.redis.jedis.pool.max-active=200 spring.redis.jedis.pool.max-active=200
...@@ -70,13 +70,13 @@ emq.patrol.sync.switch=true ...@@ -70,13 +70,13 @@ emq.patrol.sync.switch=true
params.work.flow.normalProcessDefinitionKey=normalHazardManagement params.work.flow.normalProcessDefinitionKey=normalHazardManagement
params.work.flow.processDefinitionKey=hazardManagement params.work.flow.processDefinitionKey=hazardManagement
params.work.flow.address=http://172.16.11.201:30040 params.work.flow.address=http://172.16.10.210:30040
params.spc.address=http://172.16.3.89:9001 params.spc.address=http://172.16.3.89:9001
#websocket #websocket
params.remoteWebsocketUrl=http://172.16.11.201:8080/ params.remoteWebsocketUrl=http://172.16.10.210:8080/
#websocket send message url #websocket send message url
params.remoteWebSocketSendMsgUrl=http://172.16.11.201:10601/ params.remoteWebSocketSendMsgUrl=http://172.16.10.210:10601/
#上传文件配置 #上传文件配置
spring.http.multipart.maxFileSize = 80480000 spring.http.multipart.maxFileSize = 80480000
...@@ -87,12 +87,12 @@ linux.img.path = / ...@@ -87,12 +87,12 @@ linux.img.path = /
## emqx ## emqx
emqx.clean-session=true emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}-3578 emqx.client-id=${spring.application.name}-${random.int[1024,65536]}-3578
emqx.broker=tcp://172.16.11.201:1883 emqx.broker=tcp://172.16.10.210:1883
emqx.user-name=admin emqx.user-name=admin
emqx.password=public emqx.password=public
emqx.max-inflight=1000 emqx.max-inflight=1000
file.url=http://172.16.11.201:9000/ file.url=http://172.16.10.210:9000/
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑 ##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false logic=false
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
c.point_id, c.point_id,
c.point_name, c.point_name,
c.check_time, c.check_time,
null AS `date`, null AS date,
c.plan_id, c.plan_id,
c.plan_name, c.plan_name,
c.route_id, c.route_id,
...@@ -91,11 +91,11 @@ ...@@ -91,11 +91,11 @@
c.dep_id, c.dep_id,
c.dep_name, c.dep_name,
es.id AS eq_id, es.id AS eq_id,
es.`name` eq_name, es.name eq_name,
es.`code` eq_code, es.code eq_code,
( (
SELECT SELECT
GROUP_CONCAT(ffs.`name`) GROUP_CONCAT(ffs.name)
FROM FROM
f_fire_fighting_system ffs f_fire_fighting_system ffs
WHERE WHERE
...@@ -103,11 +103,11 @@ ...@@ -103,11 +103,11 @@
) AS system_name, ) AS system_name,
CONCAT(pt.id, '') AS plan_task_id, CONCAT(pt.id, '') AS plan_task_id,
pt.end_time AS plan_completion_time, pt.end_time AS plan_completion_time,
cou.`code` AS company_code, cou.code AS company_code,
es.equipment_code AS equipment_type_code, es.equipment_code AS equipment_type_code,
pii.item_no AS input_code, pii.item_no AS input_code,
pp.point_no as pointCode, pp.point_no as pointCode,
wws.`code` as buildCode, wws.code as buildCode,
wws.full_name as buildName wws.full_name as buildName
FROM FROM
p_check_input ci p_check_input ci
...@@ -124,15 +124,15 @@ ...@@ -124,15 +124,15 @@
o.biz_org_code bzOrgCode, o.biz_org_code bzOrgCode,
o.amos_org_id, o.amos_org_id,
o.amos_org_code, o.amos_org_code,
o.`code` o.code
FROM FROM
cb_org_usr o, cb_org_usr o,
`idx_biz_station_info` s idx_biz_station_info s
WHERE WHERE
o.biz_org_type = 'COMPANY' o.biz_org_type = 'COMPANY'
and o.is_delete = 0 and o.is_delete = 0
and o.`code` = s.`code` and o.code = s.code
) cou ON LOCATE(cou.bzOrgCode, ci.org_code) > 0 ]]> ) cou ON ci.org_code LIKE concat('%', cou.bzOrgCode, '%') ]]>
<where> <where>
<if test="id != null"> <if test="id != null">
ci.id = #{id} ci.id = #{id}
......
...@@ -549,11 +549,11 @@ ...@@ -549,11 +549,11 @@
pld.infer_other_things inferOtherThings, pld.infer_other_things inferOtherThings,
pld.remark, pld.remark,
pp.plan_type planType, pp.plan_type planType,
pp.`name` planName, pp.name planName,
pr.`name` routeName, pr.name routeName,
pld.danger_type dangerType, pld.danger_type dangerType,
pc.check_time checkTimeDate, pc.check_time checkTimeDate,
pii.`name` checkContent, pii.name checkContent,
pc.user_id checkUser, pc.user_id checkUser,
pc.error checkResult, pc.error checkResult,
pc.is_ok checkStatus, pc.is_ok checkStatus,
...@@ -680,11 +680,11 @@ ...@@ -680,11 +680,11 @@
pld.danger_state dangerState, pld.danger_state dangerState,
pld.overtime_state overtimeState, pld.overtime_state overtimeState,
pp.plan_type planType, pp.plan_type planType,
pp.`name` planName, pp.name planName,
pr.`name` routeName, pr.name routeName,
pld.danger_type dangerType, pld.danger_type dangerType,
pc.check_time checkTimeDate, pc.check_time checkTimeDate,
pii.`name` checkContent, pii.name checkContent,
pc.user_id checkUser, pc.user_id checkUser,
pc.error checkResult, pc.error checkResult,
pc.is_ok checkStatus, pc.is_ok checkStatus,
......
...@@ -308,8 +308,8 @@ ...@@ -308,8 +308,8 @@
type = #{type} type = #{type}
and and
department_id = #{departmentId} department_id = #{departmentId}
and and
(a.`status` in (5,6) or (a.`status` = 7 and DATEDIFF(a.update_date,CURDATE()) =0 )) (a.status in (5,6) or (a.status = 7 and DATEDIFF(a.update_date,CURDATE()) =0 ))
and and
violate_state != 1 violate_state != 1
</select> </select>
......
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
d.point_id, d.point_id,
d.task_no, d.task_no,
d.is_finish, d.is_finish,
pp.`name` pointName pp.name pointName
FROM FROM
p_plan_task_detail d p_plan_task_detail d
LEFT JOIN p_point pp ON pp.id = d.point_id LEFT JOIN p_point pp ON pp.id = d.point_id
...@@ -1078,7 +1078,7 @@ ...@@ -1078,7 +1078,7 @@
d.point_id, d.point_id,
d.task_no, d.task_no,
pt.plan_id, pt.plan_id,
pp.`name` planName, pp.name planName,
d.is_finish d.is_finish
FROM FROM
p_plan_task_detail d p_plan_task_detail d
...@@ -1356,7 +1356,7 @@ ...@@ -1356,7 +1356,7 @@
d.point_id, d.point_id,
d.task_no, d.task_no,
pr.id route_id, pr.id route_id,
pr.`name` routeName, pr.name routeName,
d.is_finish d.is_finish
FROM FROM
p_plan_task_detail d p_plan_task_detail d
...@@ -1493,7 +1493,7 @@ FROM ...@@ -1493,7 +1493,7 @@ FROM
p_plan_task_detail pd p_plan_task_detail pd
WHERE WHERE
pd.task_no = pt.id pd.task_no = pt.id
AND pd.`status` != 1 AND pd.status != 1
)) notQualifiedPointCount, )) notQualifiedPointCount,
sum( sum(
CASE CASE
...@@ -1634,7 +1634,7 @@ FROM ...@@ -1634,7 +1634,7 @@ FROM
p_plan_task_detail pd p_plan_task_detail pd
WHERE WHERE
pd.task_no = pt.id pd.task_no = pt.id
AND pd.`status` != 1 AND pd.status != 1
)) notQualifiedPointCount, )) notQualifiedPointCount,
sum( sum(
CASE CASE
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
s_user b, s_user b,
s_company d --> s_company d -->
WHERE <!-- a.create_by = b.id and d.comp_code = a.org_code -->1=1 WHERE <!-- a.create_by = b.id and d.comp_code = a.org_code -->1=1
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%") </if> <if test="name!=null"> and a.name like concat('%',#{name},'%') </if>
<if test="parentId!=null"> and a.parent_id = #{parentId}</if> <if test="parentId!=null"> and a.parent_id = #{parentId}</if>
<if test="orgCode!=null"> and a.org_Code like #{orgCode}</if> <if test="orgCode!=null"> and a.org_Code like #{orgCode}</if>
</select> </select>
...@@ -21,27 +21,27 @@ ...@@ -21,27 +21,27 @@
a.id,a.org_Code,a.name,a.parent_id parentId,a.create_by as createBy, a.id,a.org_Code,a.name,a.parent_id parentId,a.create_by as createBy,
(select name from p_catalog_tree where id = a.parent_id) as parentName (select name from p_catalog_tree where id = a.parent_id) as parentName
FROM FROM
p_catalog_tree a p_catalog_tree a
where 1=1 where 1=1
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%") </if> <if test="name!=null"> and a.name like concat(concat('%',#{name}),'%') </if>
<if test="parentId!=null"> and a.parent_id = #{parentId} </if> <if test="parentId!=null"> and a.parent_id = #{parentId} </if>
<if test="orgCode!=null"> and a.org_Code like #{orgCode}</if> <if test="orgCode!=null"> and a.org_Code like #{orgCode}</if>
order by id desc order by id desc
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose> </choose>
</select> </select>
<select id="countCatalognum" resultType="java.util.HashMap"> <select id="countCatalognum" resultType="java.util.HashMap">
SELECT SELECT
a.id,a.name a.id,a.name
FROM FROM
p_catalog_tree a p_catalog_tree a
WHERE 1=1 WHERE 1=1
<if test="name!=null"> and a.name =#{name} </if> <if test="name!=null"> and a.name =#{name} </if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -27,20 +27,20 @@ ...@@ -27,20 +27,20 @@
SELECT SELECT
count(1) AS total_num count(1) AS total_num
FROM FROM
`p_check` `a` p_check a
<choose> <choose>
<when test="pointName!=null or pointNo!=null or isFixed!=null or catalogId!=null"> <when test="pointName!=null or pointNo!=null or isFixed!=null or catalogId!=null">
LEFT JOIN `p_point` `b` ON `a`.`point_id` = `b`.`id` LEFT JOIN p_point b ON a.point_id = b.id
</when> </when>
<when test="departmentId!=null "> <when test="departmentId!=null ">
LEFT JOIN `p_plan` `e` ON `a`.`plan_id` = `e`.`id` LEFT JOIN p_plan e ON a.plan_id = e.id
</when> </when>
</choose> </choose>
<trim prefix="WHERE" prefixOverrides="AND "> <trim prefix="WHERE" prefixOverrides="AND ">
<if test="beginDate!=null and endDate!=null">and a.check_time BETWEEN #{beginDate} and #{endDate}</if> <if test="beginDate!=null and endDate!=null">and a.check_time BETWEEN #{beginDate} and #{endDate}</if>
<!-- <if test="endDate!=null"> and #{endDate} <![CDATA[>=]]> a.check_time </if> --> <!-- <if test="endDate!=null"> and #{endDate} <![CDATA[>=]]> a.check_time </if> -->
<if test="userName!=null">and a.user_name like concat(concat("%",#{userName}),"%")</if> <if test="userName!=null">and a.user_name like concat(concat('%',#{userName}),'%')</if>
<if test="pointName!=null">and b.name like concat(concat("%",#{pointName}),"%")</if> <if test="pointName!=null">and b.name like concat(concat('%',#{pointName}),'%')</if>
<if test="pointNo!=null">and b.point_no like concat('%',#{pointNo},'%')</if> <if test="pointNo!=null">and b.point_no like concat('%',#{pointNo},'%')</if>
<if test="isFixed!=null">and b.is_fixed = #{isFixed}</if> <if test="isFixed!=null">and b.is_fixed = #{isFixed}</if>
<if test="isOK!=null">and a.is_OK = #{isOK}</if> <if test="isOK!=null">and a.is_OK = #{isOK}</if>
...@@ -53,11 +53,11 @@ ...@@ -53,11 +53,11 @@
<if test="pointId!=null">and a.point_id = #{pointId}</if> <if test="pointId!=null">and a.point_id = #{pointId}</if>
<if test="departmentId!=null and departmentId!='-1'"> and find_in_set(#{departmentId}, a.dep_id) > 0</if> <if test="departmentId!=null and departmentId!='-1'"> and find_in_set(#{departmentId}, a.dep_id) > 0</if>
<choose> <choose>
<when test="finishStatus == 0">and (`a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is <when test="finishStatus == 0">and (a.plan_task_detail_id = 0 OR a.plan_task_detail_id is
null) null)
</when> </when>
<when test="finishStatus == 1">and (`a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3)</when> <when test="finishStatus == 1">and (a.plan_task_detail_id != 0 AND a.is_ok != 3)</when>
<when test="finishStatus == 2">and `a`.`is_ok` = 3</when> <when test="finishStatus == 2">and a.is_ok = 3</when>
</choose> </choose>
</trim> </trim>
</select> </select>
...@@ -67,10 +67,10 @@ ...@@ -67,10 +67,10 @@
SELECT SELECT
count(a.id) count(a.id)
FROM FROM
`p_check` `a` p_check a
LEFT JOIN `p_point` `b` ON `a`.`point_id` = `b`.`id` LEFT JOIN p_point b ON a.point_id = b.id
LEFT JOIN `p_route` `d` ON `a`.`route_id` = `d`.`id` LEFT JOIN p_route d ON a.route_id = d.id
LEFT JOIN `p_plan` `e` ON `a`.`plan_id` = `e`.`id` LEFT JOIN p_plan e ON a.plan_id = e.id
<if test="dangerId != null and dangerId != ''"> <if test="dangerId != null and dangerId != ''">
LEFT JOIN ( SELECT check_id, GROUP_CONCAT( latent_danger_id ) dangerIds FROM p_latent_danger_patrol GROUP BY check_id ) t ON t.check_id = a.id LEFT JOIN ( SELECT check_id, GROUP_CONCAT( latent_danger_id ) dangerIds FROM p_latent_danger_patrol GROUP BY check_id ) t ON t.check_id = a.id
</if> </if>
...@@ -79,8 +79,8 @@ ...@@ -79,8 +79,8 @@
<if test="beginDate!=null and beginDate!= ''">and a.check_time >= #{beginDate} </if> <if test="beginDate!=null and beginDate!= ''">and a.check_time >= #{beginDate} </if>
<if test="endDate!=null and endDate!= ''">and #{endDate} >= a.check_time</if> <if test="endDate!=null and endDate!= ''">and #{endDate} >= a.check_time</if>
<!-- <if test="endDate!=null"> and #{endDate} <![CDATA[>=]]> a.check_time </if> --> <!-- <if test="endDate!=null"> and #{endDate} <![CDATA[>=]]> a.check_time </if> -->
<if test="userName!=null and userName!=''">and a.user_name like concat(concat("%",#{userName}),"%")</if> <if test="userName!=null and userName!=''">and a.user_name like concat(concat('%',#{userName}),'%')</if>
<if test="pointName!=null and pointName!=''">and a.point_name like concat(concat("%",#{pointName}),"%")</if> <if test="pointName!=null and pointName!=''">and a.point_name like concat(concat('%',#{pointName}),'%')</if>
<if test="pointNo!=null and pointNo!=''">and b.point_no like concat('%',#{pointNo},'%')</if> <if test="pointNo!=null and pointNo!=''">and b.point_no like concat('%',#{pointNo},'%')</if>
<if test="isFixed!=null and isFixed!=''">and b.is_fixed = #{isFixed}</if> <if test="isFixed!=null and isFixed!=''">and b.is_fixed = #{isFixed}</if>
<if test="isOK!=null and isOK!=''">and a.is_OK = #{isOK}</if> <if test="isOK!=null and isOK!=''">and a.is_OK = #{isOK}</if>
...@@ -96,11 +96,11 @@ ...@@ -96,11 +96,11 @@
<if test="checkType == '计划检查'">and a.plan_task_id &gt; 0</if> <if test="checkType == '计划检查'">and a.plan_task_id &gt; 0</if>
<if test="checkType == '无计划检查'">and a.plan_task_id &lt;= 0</if> <if test="checkType == '无计划检查'">and a.plan_task_id &lt;= 0</if>
<choose> <choose>
<when test="finishStatus == 0">and (`a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is <when test="finishStatus == 0">and (a.plan_task_detail_id = 0 OR a.plan_task_detail_id is
null) null)
</when> </when>
<when test="finishStatus == 1">and (`a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3)</when> <when test="finishStatus == 1">and (a.plan_task_detail_id != 0 AND a.is_ok != 3)</when>
<when test="finishStatus == 2">and `a`.`is_ok` = 3</when> <when test="finishStatus == 2">and a.is_ok = 3</when>
</choose> </choose>
<if test="dangerId != null and dangerId != ''"> <if test="dangerId != null and dangerId != ''">
and FIND_IN_SET(#{dangerId}, t.dangerIds) and FIND_IN_SET(#{dangerId}, t.dangerIds)
...@@ -131,47 +131,47 @@ ...@@ -131,47 +131,47 @@
a.dep_name department_name, a.dep_name department_name,
a.dep_id departmentId, a.dep_id departmentId,
date_format( date_format(
`a`.`check_time`, a.check_time,
'%Y-%m-%d %H:%i:%s' '%Y-%m-%d %H:%i:%s'
) AS `checkDate`, ) AS checkDate,
date_format( date_format(
`a`.`upload_time`, a.upload_time,
'%Y-%m-%d %H:%i:%s' '%Y-%m-%d %H:%i:%s'
) AS `upload_time`, ) AS upload_time,
( (
CASE CASE
WHEN `a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is null WHEN a.plan_task_detail_id = 0 OR a.plan_task_detail_id is null
THEN '0' THEN '0'
WHEN `a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3 WHEN a.plan_task_detail_id != 0 AND a.is_ok != 3
THEN '1' THEN '1'
WHEN `a`.`is_ok` = 3 WHEN a.is_ok = 3
THEN '2' THEN '2'
END END
) AS `Finish_Status`, ) AS Finish_Status,
a.is_ok is_ok, a.is_ok is_ok,
a.score, a.score,
d.`name` AS `route_name`, d.name AS route_name,
a.check_mode, a.check_mode,
e.`name` AS `plan_name`, e.name AS plan_name,
a.plan_task_id, a.plan_task_id,
a.plan_id, a.plan_id,
a.`route_id`, a.route_id,
b.`catalog_id`, b.catalog_id,
a.error, a.error,
a.remark a.remark
FROM FROM
`p_check` `a` p_check a
LEFT JOIN `p_point` `b` ON `a`.`point_id` = `b`.`id` LEFT JOIN p_point b ON a.point_id = b.id
LEFT JOIN `p_route` `d` ON `a`.`route_id` = `d`.`id` LEFT JOIN p_route d ON a.route_id = d.id
LEFT JOIN `p_plan` `e` ON `a`.`plan_id` = `e`.`id` LEFT JOIN p_plan e ON a.plan_id = e.id
<if test="dangerId != null and dangerId != ''"> <if test="dangerId != null and dangerId != ''">
LEFT JOIN ( SELECT check_id, GROUP_CONCAT( latent_danger_id ) dangerIds FROM p_latent_danger_patrol GROUP BY check_id ) t ON t.check_id = a.id LEFT JOIN ( SELECT check_id, GROUP_CONCAT( latent_danger_id ) dangerIds FROM p_latent_danger_patrol GROUP BY check_id ) t ON t.check_id = a.id
</if> </if>
<trim prefix="WHERE" prefixOverrides="AND "> <trim prefix="WHERE" prefixOverrides="AND ">
<if test="beginDate!=null and endDate!=null">and a.check_time BETWEEN #{beginDate} and #{endDate}</if> <if test="beginDate!=null and endDate!=null">and a.check_time BETWEEN #{beginDate} and #{endDate}</if>
<!-- <if test="endDate!=null"> and #{endDate} <![CDATA[>=]]> a.check_time </if> --> <!-- <if test="endDate!=null"> and #{endDate} <![CDATA[>=]]> a.check_time </if> -->
<if test="userName!=null">and a.user_name like concat(concat("%",#{userName}),"%")</if> <if test="userName!=null">and a.user_name like concat(concat('%',#{userName}),'%')</if>
<if test="pointName!=null">and b.name like concat(concat("%",#{pointName}),"%")</if> <if test="pointName!=null">and b.name like concat(concat('%',#{pointName}),'%')</if>
<if test="pointNo!=null">and b.point_no like concat('%',#{pointNo},'%')</if> <if test="pointNo!=null">and b.point_no like concat('%',#{pointNo},'%')</if>
<if test="isFixed!=null">and b.is_fixed = #{isFixed}</if> <if test="isFixed!=null">and b.is_fixed = #{isFixed}</if>
<if test="isOK!=null">and a.is_OK = #{isOK}</if> <if test="isOK!=null">and a.is_OK = #{isOK}</if>
...@@ -187,11 +187,11 @@ ...@@ -187,11 +187,11 @@
<if test="checkType == '计划检查'">and a.plan_task_id &gt; 0</if> <if test="checkType == '计划检查'">and a.plan_task_id &gt; 0</if>
<if test="checkType == '无计划检查'">and a.plan_task_id &lt;= 0</if> <if test="checkType == '无计划检查'">and a.plan_task_id &lt;= 0</if>
<choose> <choose>
<when test="finishStatus == 0">and (`a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is <when test="finishStatus == 0">and (a.plan_task_detail_id = 0 OR a.plan_task_detail_id is
null) null)
</when> </when>
<when test="finishStatus == 1">and (`a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3)</when> <when test="finishStatus == 1">and (a.plan_task_detail_id != 0 AND a.is_ok != 3)</when>
<when test="finishStatus == 2">and `a`.`is_ok` = 3</when> <when test="finishStatus == 2">and a.is_ok = 3</when>
</choose> </choose>
<if test="dangerId != null and dangerId != ''"> <if test="dangerId != null and dangerId != ''">
and FIND_IN_SET(#{dangerId}, t.dangerIds) and FIND_IN_SET(#{dangerId}, t.dangerIds)
...@@ -221,35 +221,35 @@ ...@@ -221,35 +221,35 @@
a.dep_id departmentId, a.dep_id departmentId,
wws.name address, wws.name address,
date_format( date_format(
`a`.`check_time`, a.check_time,
'%Y-%m-%d %H:%i:%s' '%Y-%m-%d %H:%i:%s'
) AS `checkDate`, ) AS checkDate,
date_format( date_format(
`a`.`upload_time`, a.upload_time,
'%Y-%m-%d %H:%i:%s' '%Y-%m-%d %H:%i:%s'
) AS `upload_time`, ) AS upload_time,
( (
CASE CASE
WHEN `a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is null WHEN a.plan_task_detail_id = 0 OR a.plan_task_detail_id is null
THEN '计划外完成' THEN '计划外完成'
WHEN `a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3 WHEN a.plan_task_detail_id != 0 AND a.is_ok != 3
THEN '按时完成' THEN '按时完成'
WHEN `a`.`is_ok` = 3 WHEN a.is_ok = 3
THEN '未执行' THEN '未执行'
END END
) AS `Finish_Status`, ) AS Finish_Status,
( (
CASE CASE
WHEN `a`.`is_ok` = 1 WHEN a.is_ok = 1
THEN '合格' THEN '合格'
WHEN `a`.`is_ok` = 2 WHEN a.is_ok = 2
THEN '不合格' THEN '不合格'
WHEN `a`.`is_ok` = 3 WHEN a.is_ok = 3
THEN '漏检' THEN '漏检'
END END
) as is_ok, ) as is_ok,
a.score, a.score,
a.`route_name`, a.route_name,
( (
CASE CASE
WHEN a.check_mode = 'QR' WHEN a.check_mode = 'QR'
...@@ -266,19 +266,19 @@ ...@@ -266,19 +266,19 @@
'系统自检' '系统自检'
END END
) as check_mode, ) as check_mode,
a.`plan_name` AS `plan_name`, a.plan_name AS plan_name,
a.plan_task_id, a.plan_task_id,
a.plan_id, a.plan_id,
a.`route_id`, a.route_id,
b.`catalog_id`, b.catalog_id,
a.error, a.error,
a.remark, a.remark,
b.biz_org_name AS bizOrgName b.biz_org_name AS bizOrgName
FROM FROM
`p_check` `a` p_check a
LEFT JOIN `p_point` `b` ON `a`.`point_id` = `b`.`id` LEFT JOIN p_point b ON a.point_id = b.id
LEFT JOIN `p_route` `d` ON `a`.`route_id` = `d`.`id` LEFT JOIN p_route d ON a.route_id = d.id
LEFT JOIN `p_plan` `e` ON `a`.`plan_id` = `e`.`id` LEFT JOIN p_plan e ON a.plan_id = e.id
LEFT JOIN wl_warehouse_structure wws on wws.id = b.risk_source_id LEFT JOIN wl_warehouse_structure wws on wws.id = b.risk_source_id
<if test="dangerId != null and dangerId != ''"> <if test="dangerId != null and dangerId != ''">
LEFT JOIN ( SELECT check_id, GROUP_CONCAT( latent_danger_id ) dangerIds FROM p_latent_danger_patrol GROUP BY check_id ) t ON t.check_id = a.id LEFT JOIN ( SELECT check_id, GROUP_CONCAT( latent_danger_id ) dangerIds FROM p_latent_danger_patrol GROUP BY check_id ) t ON t.check_id = a.id
...@@ -288,8 +288,8 @@ ...@@ -288,8 +288,8 @@
<if test="beginDate!=null and beginDate!= ''">and a.check_time >= #{beginDate} </if> <if test="beginDate!=null and beginDate!= ''">and a.check_time >= #{beginDate} </if>
<if test="endDate!=null and endDate!= ''">and #{endDate} >= a.check_time</if> <if test="endDate!=null and endDate!= ''">and #{endDate} >= a.check_time</if>
<!-- <if test="endDate!=null"> and #{endDate} <![CDATA[>=]]> a.check_time </if> --> <!-- <if test="endDate!=null"> and #{endDate} <![CDATA[>=]]> a.check_time </if> -->
<if test="userName!=null and userName!=''">and a.user_name like concat(concat("%",#{userName}),"%")</if> <if test="userName!=null and userName!=''">and a.user_name like concat(concat('%',#{userName}),'%')</if>
<if test="pointName!=null and pointName!= ''">and b.name like concat(concat("%",#{pointName}),"%")</if> <if test="pointName!=null and pointName!= ''">and b.name like concat(concat('%',#{pointName}),'%')</if>
<if test="pointNo!=null and pointNo!=''">and b.point_no like concat('%',#{pointNo},'%')</if> <if test="pointNo!=null and pointNo!=''">and b.point_no like concat('%',#{pointNo},'%')</if>
<if test="isFixed!=null and isFixed!=''">and b.is_fixed = #{isFixed}</if> <if test="isFixed!=null and isFixed!=''">and b.is_fixed = #{isFixed}</if>
<if test="isOK!=null and isOK!=''">and a.is_OK = #{isOK}</if> <if test="isOK!=null and isOK!=''">and a.is_OK = #{isOK}</if>
...@@ -305,11 +305,11 @@ ...@@ -305,11 +305,11 @@
<if test="checkType == '计划检查'">and a.plan_task_id &gt; 0</if> <if test="checkType == '计划检查'">and a.plan_task_id &gt; 0</if>
<if test="checkType == '无计划检查'">and a.plan_task_id &lt;= 0</if> <if test="checkType == '无计划检查'">and a.plan_task_id &lt;= 0</if>
<choose> <choose>
<when test="finishStatus == 0">and (`a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is <when test="finishStatus == 0">and (a.plan_task_detail_id = 0 OR a.plan_task_detail_id is
null) null)
</when> </when>
<when test="finishStatus == 1">and (`a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3)</when> <when test="finishStatus == 1">and (a.plan_task_detail_id != 0 AND a.is_ok != 3)</when>
<when test="finishStatus == 2">and `a`.`is_ok` = 3</when> <when test="finishStatus == 2">and a.is_ok = 3</when>
</choose> </choose>
<if test="dangerId != null and dangerId != ''"> <if test="dangerId != null and dangerId != ''">
and FIND_IN_SET(#{dangerId}, t.dangerIds) and FIND_IN_SET(#{dangerId}, t.dangerIds)
...@@ -336,7 +336,7 @@ ...@@ -336,7 +336,7 @@
SELECT SELECT
count(1) count(1)
FROM FROM
`p_check` `a` p_check a
<trim prefix="WHERE" prefixOverrides="AND "> <trim prefix="WHERE" prefixOverrides="AND ">
<if test="userId!=null and userId!=''">and find_in_set(#{userId}, a.user_id) > 0</if> <if test="userId!=null and userId!=''">and find_in_set(#{userId}, a.user_id) > 0</if>
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
...@@ -354,23 +354,23 @@ ...@@ -354,23 +354,23 @@
a.id, a.id,
a.user_id, a.user_id,
date_format( date_format(
`a`.`check_time`, a.check_time,
'%Y-%m-%d %H:%i:%s' '%Y-%m-%d %H:%i:%s'
) AS `checkDate`, ) AS checkDate,
( (
CASE CASE
WHEN `a`.`is_ok` = 1 WHEN a.is_ok = 1
THEN '合格' THEN '合格'
WHEN `a`.`is_ok` = 2 WHEN a.is_ok = 2
THEN '不合格' THEN '不合格'
WHEN `a`.`is_ok` = 3 WHEN a.is_ok = 3
THEN '漏检' THEN '漏检'
END END
) as is_ok ) as is_ok
FROM FROM
`p_check` `a` p_check a
<trim prefix="WHERE" prefixOverrides="AND "> <trim prefix="WHERE" prefixOverrides="AND ">
`a`.`is_ok` != 1 a.is_ok != 1
<if test="userId!=null and userId!=''">and find_in_set(#{userId}, a.user_id) > 0</if> <if test="userId!=null and userId!=''">and find_in_set(#{userId}, a.user_id) > 0</if>
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
and a.org_code LIKE CONCAT(#{bizOrgCode},'%') and a.org_code LIKE CONCAT(#{bizOrgCode},'%')
...@@ -420,7 +420,7 @@ ...@@ -420,7 +420,7 @@
pcs.photo_data photoDate, pcs.photo_data photoDate,
pcs.point_name pointName pcs.point_name pointName
FROM FROM
`p_check_shot` pcs p_check_shot pcs
LEFT JOIN p_check pc ON pc.id = pcs.check_id LEFT JOIN p_check pc ON pc.id = pcs.check_id
WHERE WHERE
pc.plan_task_id = #{planTaskId} pc.plan_task_id = #{planTaskId}
...@@ -531,7 +531,7 @@ ...@@ -531,7 +531,7 @@
<if test="userId!=null and userId!=0">AND FIND_IN_SET(#{userId}, user_id)>0</if> <if test="userId!=null and userId!=0">AND FIND_IN_SET(#{userId}, user_id)>0</if>
<if test="routeId!=null and routeId!=0">AND route_id = #{routeId}</if> <if test="routeId!=null and routeId!=0">AND route_id = #{routeId}</if>
<!-- <if test="orgCode!=null">AND org_code LIKE #{orgCode}</if>--> <!-- <if test="orgCode!=null">AND org_code LIKE #{orgCode}</if>-->
<if test="orgCode!=null">AND org_code LIKE concat(#{orgCode},"%")</if> <if test="orgCode!=null">AND org_code LIKE concat(#{orgCode},'%')</if>
</select> </select>
<select id="calendarData" resultType="Map"> <select id="calendarData" resultType="Map">
...@@ -546,7 +546,7 @@ ...@@ -546,7 +546,7 @@
<if test="userId!=null and userId!=0">AND FIND_IN_SET(#{userId}, user_id)>0</if> <if test="userId!=null and userId!=0">AND FIND_IN_SET(#{userId}, user_id)>0</if>
<if test="routeId!=null and routeId!=0">AND route_id = #{routeId}</if> <if test="routeId!=null and routeId!=0">AND route_id = #{routeId}</if>
<!-- <if test="orgCode!=null">AND org_code LIKE #{orgCode}</if>--> <!-- <if test="orgCode!=null">AND org_code LIKE #{orgCode}</if>-->
<if test="orgCode!=null">AND org_code LIKE concat(#{orgCode},"%") </if> <if test="orgCode!=null">AND org_code LIKE concat(#{orgCode},'%') </if>
GROUP BY is_ok,time GROUP BY is_ok,time
ORDER BY time ORDER BY time
</select> </select>
...@@ -571,7 +571,7 @@ ...@@ -571,7 +571,7 @@
WHERE 1 = 1 WHERE 1 = 1
<!-- <if test="orgCode!=null">AND (c.org_code LIKE concat(#{orgCode},"-%") or c.org_code = #{orgCode})</if>--> <!-- <if test="orgCode!=null">AND (c.org_code LIKE concat(#{orgCode},"-%") or c.org_code = #{orgCode})</if>-->
<if test="orgCode!=null">AND c.org_code LIKE concat(#{orgCode},"%") </if> <if test="orgCode!=null">AND c.org_code LIKE concat(#{orgCode},'%') </if>
<if test="departmentId!=null">AND FIND_IN_SET(#{departmentId}, c.dep_id) > 0</if> <if test="departmentId!=null">AND FIND_IN_SET(#{departmentId}, c.dep_id) > 0</if>
<if test="userId != null and userId != '' "> <if test="userId != null and userId != '' ">
...@@ -692,14 +692,14 @@ ...@@ -692,14 +692,14 @@
JOIN p_check_shot s ON s.check_id = a.id JOIN p_check_shot s ON s.check_id = a.id
<choose> <choose>
<when test="pointName!=null or pointNo!=null or isFixed!=null or catalogId!=null"> <when test="pointName!=null or pointNo!=null or isFixed!=null or catalogId!=null">
LEFT JOIN `p_point` `b` ON `a`.`point_id` = `b`.`id` LEFT JOIN p_point b ON a.point_id = b.id
</when> </when>
</choose> </choose>
<trim prefix="WHERE" prefixOverrides="AND "> <trim prefix="WHERE" prefixOverrides="AND ">
<if test="beginDate!=null and endDate!=null">and a.check_time BETWEEN #{beginDate} and #{endDate}</if> <if test="beginDate!=null and endDate!=null">and a.check_time BETWEEN #{beginDate} and #{endDate}</if>
<!-- <if test="endDate!=null"> and #{endDate} <![CDATA[>=]]> a.check_time </if> --> <!-- <if test="endDate!=null"> and #{endDate} <![CDATA[>=]]> a.check_time </if> -->
<if test="userName!=null">and a.user_name like concat(concat("%",#{userName}),"%")</if> <if test="userName!=null">and a.user_name like concat(concat('%',#{userName}),'%')</if>
<if test="pointName!=null">and a.point_name like concat(concat("%",#{pointName}),"%")</if> <if test="pointName!=null">and a.point_name like concat(concat('%',#{pointName}),'%')</if>
<if test="pointNo!=null">and b.point_no = #{pointNo}</if> <if test="pointNo!=null">and b.point_no = #{pointNo}</if>
<if test="isFixed!=null">and b.is_fixed = #{isFixed}</if> <if test="isFixed!=null">and b.is_fixed = #{isFixed}</if>
<if test="isOK!=null">and a.is_OK = #{isOK}</if> <if test="isOK!=null">and a.is_OK = #{isOK}</if>
...@@ -710,11 +710,11 @@ ...@@ -710,11 +710,11 @@
<if test="orgCode!=null">AND (a.org_code LIKE concat(#{orgCode},"-%") or a.org_code = #{orgCode})</if> <if test="orgCode!=null">AND (a.org_code LIKE concat(#{orgCode},"-%") or a.org_code = #{orgCode})</if>
<if test="pointId!=null">and a.point_id = #{pointId}</if> <if test="pointId!=null">and a.point_id = #{pointId}</if>
<choose> <choose>
<when test="finishStatus == 0">and (`a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is <when test="finishStatus == 0">and (a.plan_task_detail_id = 0 OR a.plan_task_detail_id is
null) null)
</when> </when>
<when test="finishStatus == 1">and (`a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3)</when> <when test="finishStatus == 1">and (a.plan_task_detail_id != 0 AND a.is_ok != 3)</when>
<when test="finishStatus == 2">and `a`.`is_ok` = 3</when> <when test="finishStatus == 2">and a.is_ok = 3</when>
</choose> </choose>
<if test="departmentId!=null"> and find_in_set(#{departmentId},a.dep_id)>0 </if> <if test="departmentId!=null"> and find_in_set(#{departmentId},a.dep_id)>0 </if>
</trim> </trim>
...@@ -747,23 +747,23 @@ ...@@ -747,23 +747,23 @@
a.user_name user_name, a.user_name user_name,
a.dep_name department_name, a.dep_name department_name,
date_format( date_format(
`a`.`check_time`, a.check_time,
'%Y-%m-%d %H:%i:%s' '%Y-%m-%d %H:%i:%s'
) AS `checkDate`, ) AS checkDate,
date_format( date_format(
`a`.`upload_time`, a.upload_time,
'%Y-%m-%d %H:%i:%s' '%Y-%m-%d %H:%i:%s'
) AS `upload_time`, ) AS upload_time,
( (
CASE CASE
WHEN `a`.`plan_task_detail_id` = 0 OR `a`.`plan_task_detail_id` is null WHEN a.plan_task_detail_id = 0 OR a.plan_task_detail_id is null
THEN '0' THEN '0'
WHEN `a`.`plan_task_detail_id` != 0 AND `a`.`is_ok` != 3 WHEN a.plan_task_detail_id != 0 AND a.is_ok != 3
THEN '1' THEN '1'
WHEN `a`.`is_ok` = 3 WHEN a.is_ok = 3
THEN '2' THEN '2'
END END
) AS `Finish_Status`, ) AS Finish_Status,
CASE CASE
WHEN a.is_ok = '1' THEN WHEN a.is_ok = '1' THEN
'合格' '合格'
...@@ -773,17 +773,17 @@ ...@@ -773,17 +773,17 @@
'漏检' '漏检'
END AS is_ok, END AS is_ok,
a.score, a.score,
d.`name` AS `route_name`, d.name AS route_name,
a.check_mode, a.check_mode,
e.`name` AS `plan_name`, e.name AS plan_name,
a.plan_task_id, a.plan_task_id,
a.error, a.error,
a.remark a.remark
from from
`p_check` `a` p_check a
LEFT JOIN `p_point` `b` ON `a`.`point_id` = `b`.`id` LEFT JOIN p_point b ON a.point_id = b.id
LEFT JOIN `p_route` `d` ON `a`.`route_id` = `d`.`id` LEFT JOIN p_route d ON a.route_id = d.id
LEFT JOIN `p_plan` `e` ON `a`.`plan_id` = `e`.`id` LEFT JOIN p_plan e ON a.plan_id = e.id
WHERE WHERE
a.id in a.id in
<foreach collection="checkIds" item="id" index="index" open="(" close=")" separator=",">#{id}</foreach> <foreach collection="checkIds" item="id" index="index" open="(" close=")" separator=",">#{id}</foreach>
...@@ -1123,7 +1123,7 @@ ...@@ -1123,7 +1123,7 @@
'漏检' '漏检'
END END
) AS IsOK, ) AS IsOK,
ii.`name` AS NAME, ii.name AS NAME,
c.upload_time AS UploadTime, c.upload_time AS UploadTime,
c.user_name AS RealName, c.user_name AS RealName,
ci.score AS Score, ci.score AS Score,
...@@ -1189,7 +1189,7 @@ ...@@ -1189,7 +1189,7 @@
'漏检' '漏检'
END END
) AS IsOK, ) AS IsOK,
ii.`name` AS NAME, ii.name AS NAME,
c.upload_time AS UploadTime, c.upload_time AS UploadTime,
c.user_name AS RealName, c.user_name AS RealName,
ci.score AS Score, ci.score AS Score,
...@@ -1257,7 +1257,7 @@ ...@@ -1257,7 +1257,7 @@
c.dep_id AS depId, c.dep_id AS depId,
c.check_time AS CheckTime, c.check_time AS CheckTime,
p.point_no AS PointNo, p.point_no AS PointNo,
p.`name` AS PointName, p.name AS PointName,
c.user_id AS RealName, c.user_id AS RealName,
c.dep_name AS groupName, c.dep_name AS groupName,
( (
...@@ -1268,8 +1268,8 @@ ...@@ -1268,8 +1268,8 @@
'固定点' '固定点'
END END
) AS IsFixed, ) AS IsFixed,
r.`name` AS RouteName, r.name AS RouteName,
p.`level` AS Level, p.level AS Level,
( (
CASE c.is_ok CASE c.is_ok
WHEN 1 THEN WHEN 1 THEN
...@@ -1280,7 +1280,7 @@ ...@@ -1280,7 +1280,7 @@
'漏检' '漏检'
END END
) AS IsOK, ) AS IsOK,
pl.`name` AS planName, pl.name AS planName,
pl.remark AS Remark, pl.remark AS Remark,
if(c.plan_id =0 AND p.is_score=0,0,c.score) as score, if(c.plan_id =0 AND p.is_score=0,0,c.score) as score,
c.remark checkRemark c.remark checkRemark
...@@ -1344,7 +1344,7 @@ ...@@ -1344,7 +1344,7 @@
a.point_id, a.point_id,
max(id) id max(id) id
FROM FROM
`p_check` a p_check a
<trim prefix="WHERE" prefixOverrides="AND "> <trim prefix="WHERE" prefixOverrides="AND ">
<if test="orgCode!=null">and a.org_code like #{orgCode}</if> <if test="orgCode!=null">and a.org_code like #{orgCode}</if>
<if test="pointId!=null">and a.point_id = #{pointId}</if> <if test="pointId!=null">and a.point_id = #{pointId}</if>
...@@ -1381,21 +1381,21 @@ ...@@ -1381,21 +1381,21 @@
pc.id checkId, pc.id checkId,
pc.point_id pointId, pc.point_id pointId,
pp.point_no pointNo, pp.point_no pointNo,
pp.`name` pointName, pp.name pointName,
ppl.`name` planName, ppl.name planName,
ppl.id planId, ppl.id planId,
pc.user_id userId, pc.user_id userId,
pc.`user_name` userName, pc.user_name userName,
pc.check_time checkTime, pc.check_time checkTime,
pp.address, pp.address,
pc.is_ok status, pc.is_ok status,
pci.is_ok inputStatus, pci.is_ok inputStatus,
pii.`name` inputItemName, pii.name inputItemName,
pci.input_value inputValue, pci.input_value inputValue,
pc.dep_name department, pc.dep_name department,
pii.level pii.level
FROM FROM
`p_check_input` pci p_check_input pci
LEFT JOIN p_check pc ON pc.id = pci.check_id LEFT JOIN p_check pc ON pc.id = pci.check_id
LEFT JOIN p_route pr ON pr.id = pc.route_id LEFT JOIN p_route pr ON pr.id = pc.route_id
LEFT JOIN p_plan ppl ON ppl.id = pc.plan_id LEFT JOIN p_plan ppl ON ppl.id = pc.plan_id
...@@ -1445,7 +1445,7 @@ ...@@ -1445,7 +1445,7 @@
END END
AS is_ok, AS is_ok,
c. NAME route_name, c. NAME route_name,
d.`name` plan_name, d.name plan_name,
b.dep_name dep_name, b.dep_name dep_name,
b.user_name user_name b.user_name user_name
FROM FROM
...@@ -1457,7 +1457,7 @@ ...@@ -1457,7 +1457,7 @@
a.point_id, a.point_id,
max(id) id max(id) id
FROM FROM
`p_check` a p_check a
<trim prefix="WHERE" prefixOverrides="AND "> <trim prefix="WHERE" prefixOverrides="AND ">
<if test="orgCode!=null">and a.org_code like #{orgCode}</if> <if test="orgCode!=null">and a.org_code like #{orgCode}</if>
<if test="pointId!=null">and a.point_id = #{pointId}</if> <if test="pointId!=null">and a.point_id = #{pointId}</if>
...@@ -1468,7 +1468,7 @@ ...@@ -1468,7 +1468,7 @@
a.user_id, a.user_id,
a.point_id a.point_id
) sa ) sa
LEFT JOIN `p_check` b ON sa.id = b.id LEFT JOIN p_check b ON sa.id = b.id
LEFT JOIN p_route c ON sa.route_id = c.id LEFT JOIN p_route c ON sa.route_id = c.id
LEFT JOIN p_plan d ON d.id = sa.plan_id LEFT JOIN p_plan d ON d.id = sa.plan_id
) ma ) ma
...@@ -1534,7 +1534,7 @@ ...@@ -1534,7 +1534,7 @@
b.name AS name, b.name AS name,
(SELECT (SELECT
GROUP_CONCAT( GROUP_CONCAT(
`name` name
) )
FROM FROM
s_user u s_user u
...@@ -1623,7 +1623,7 @@ ...@@ -1623,7 +1623,7 @@
p.Address, p.Address,
p.id PointID, p.id PointID,
p. STATUS RealTimeStatus, p. STATUS RealTimeStatus,
p.`level`, p.level,
p.org_code compCode, p.org_code compCode,
ptd.task_id taskId, ptd.task_id taskId,
temp.* temp.*
...@@ -1643,7 +1643,7 @@ ...@@ -1643,7 +1643,7 @@
u.id OpenID, u.id OpenID,
(SELECT (SELECT
GROUP_CONCAT( GROUP_CONCAT(
`name` name
) )
FROM FROM
s_user u s_user u
...@@ -1667,12 +1667,12 @@ ...@@ -1667,12 +1667,12 @@
SELECT SELECT
r.id RouteID, r.id RouteID,
r. NAME rName, r. NAME rName,
su.`name` boss, su.name boss,
r.tel, r.tel,
u.id OpenID, u.id OpenID,
(SELECT (SELECT
GROUP_CONCAT( GROUP_CONCAT(
`name` name
) )
FROM FROM
s_user u s_user u
...@@ -1689,7 +1689,7 @@ ...@@ -1689,7 +1689,7 @@
) B ON A.route_id = B.RouteID ) B ON A.route_id = B.RouteID
) temp ON temp.point_id = p.id ) temp ON temp.point_id = p.id
LEFT JOIN p_task_detail ptd ON ptd.point_id = p.id LEFT JOIN p_task_detail ptd ON ptd.point_id = p.id
AND ptd.`status` = 2 AND ptd.status = 2
</select> </select>
<select id="getCheckStatisticalAnalysis" resultType="com.yeejoin.amos.patrol.business.vo.CheckAnalysisVo"> <select id="getCheckStatisticalAnalysis" resultType="com.yeejoin.amos.patrol.business.vo.CheckAnalysisVo">
...@@ -2046,9 +2046,9 @@ ...@@ -2046,9 +2046,9 @@
<!-- <if test="checkTime!=null">AND DATE_FORMAT(a.CheckTime, '%Y%m%d') = #{checkTime}</if>--> <!-- <if test="checkTime!=null">AND DATE_FORMAT(a.CheckTime, '%Y%m%d') = #{checkTime}</if>-->
<!-- <if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, a.userID)>0 </if>--> <!-- <if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, a.userID)>0 </if>-->
<!-- <if test="status!=null">AND a.IsOK = #{status}</if>--> <!-- <if test="status!=null">AND a.IsOK = #{status}</if>-->
<!-- <if test="userName!=null">AND a.RealName LIKE concat(concat("%",#{userName}),"%")</if>--> <!-- <if test="userName!=null">AND a.RealName LIKE concat(concat('%',#{userName}),'%')</if>-->
<!-- <if test="groupId!=null">AND find_in_set(#{groupId}, a.GroupID)>0</if>--> <!-- <if test="groupId!=null">AND find_in_set(#{groupId}, a.GroupID)>0</if>-->
<!-- <if test="pointName!=null">AND a.pointName LIKE concat(concat("%",#{pointName}),"%")</if>--> <!-- <if test="pointName!=null">AND a.pointName LIKE concat(concat('%',#{pointName}),'%')</if>-->
<!-- <if test="orgCode!=null">AND a.orgCode LIKE #{orgCode}</if>--> <!-- <if test="orgCode!=null">AND a.orgCode LIKE #{orgCode}</if>-->
<!-- </trim>--> <!-- </trim>-->
...@@ -2080,16 +2080,16 @@ ...@@ -2080,16 +2080,16 @@
<if test="checkTime!=null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}</if> <if test="checkTime!=null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}</if>
<if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, c.user_id)>0 </if> <if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, c.user_id)>0 </if>
<if test="status!=null">AND c.is_ok = #{status}</if> <if test="status!=null">AND c.is_ok = #{status}</if>
<if test="userName!=null">AND c.error LIKE concat(concat("%",#{userName}),"%")</if> <if test="userName!=null">AND c.error LIKE concat(concat('%',#{userName}),'%')</if>
<if test="groupId!=null">AND find_in_set(#{groupId}, c.dep_id)>0</if> <if test="groupId!=null">AND find_in_set(#{groupId}, c.dep_id)>0</if>
<if test="pointName!=null">AND p.name LIKE concat(concat("%",#{pointName}),"%")</if> <if test="pointName!=null">AND p.name LIKE concat(concat('%',#{pointName}),'%')</if>
<if test="orgCode!=null">AND c.org_code LIKE #{orgCode}</if> <if test="orgCode!=null">AND c.org_code LIKE #{orgCode}</if>
order by c.create_date DESC order by c.create_date DESC
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose> </choose>
</select> </select>
...@@ -2105,9 +2105,9 @@ ...@@ -2105,9 +2105,9 @@
<if test="checkTime!=null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}</if> <if test="checkTime!=null">AND DATE_FORMAT(c.check_time, '%Y%m%d') = #{checkTime}</if>
<if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, c.user_id)>0 </if> <if test="userID!=null and userID!=-1 ">AND find_in_set(#{userID}, c.user_id)>0 </if>
<if test="status!=null">AND c.is_ok = #{status}</if> <if test="status!=null">AND c.is_ok = #{status}</if>
<if test="userName!=null">AND c.user_name LIKE concat(concat("%",#{userName}),"%")</if> <if test="userName!=null">AND c.user_name LIKE concat(concat('%',#{userName}),'%')</if>
<if test="groupId!=null">AND find_in_set(#{groupId}, c.dep_id)>0</if> <if test="groupId!=null">AND find_in_set(#{groupId}, c.dep_id)>0</if>
<if test="pointName!=null">AND p.name LIKE concat(concat("%",#{pointName}),"%")</if> <if test="pointName!=null">AND p.name LIKE concat(concat('%',#{pointName}),'%')</if>
<if test="orgCode!=null">AND c.org_code LIKE #{orgCode}</if> <if test="orgCode!=null">AND c.org_code LIKE #{orgCode}</if>
</select> </select>
...@@ -2128,7 +2128,7 @@ ...@@ -2128,7 +2128,7 @@
<select id="getCheckInfoBusinessById" resultMap="checkInfoResulBusinesstMap"> <select id="getCheckInfoBusinessById" resultMap="checkInfoResulBusinesstMap">
SELECT SELECT
pc.point_id pointId, pc.point_id pointId,
pp.`name` pointName, pp.name pointName,
pc.is_ok status, pc.is_ok status,
pc.id checkId, pc.id checkId,
pc.user_name as checkUser, pc.user_name as checkUser,
...@@ -2149,11 +2149,11 @@ ...@@ -2149,11 +2149,11 @@
<select id="queryPointInputBu" resultMap="CheckInputBuMap"> <select id="queryPointInputBu" resultMap="CheckInputBuMap">
SELECT SELECT
pci.is_ok inputStatus, pci.is_ok inputStatus,
pii.`name` pointInputitemName, pii.name pointInputitemName,
a.id pointInputitemId, a.id pointInputitemId,
pci.id checkInputitemId pci.id checkInputitemId
FROM FROM
`p_check_input` pci p_check_input pci
LEFT JOIN p_input_item pii ON pii.id = pci.input_id LEFT JOIN p_input_item pii ON pii.id = pci.input_id
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
...@@ -2171,7 +2171,7 @@ ...@@ -2171,7 +2171,7 @@
<select id="queryUserInfoByIds" resultType="Map"> <select id="queryUserInfoByIds" resultType="Map">
SELECT SELECT
GROUP_CONCAT(u.`name`) userName, GROUP_CONCAT(u.name) userName,
GROUP_CONCAT( distinct d.department_name) depName, GROUP_CONCAT( distinct d.department_name) depName,
GROUP_CONCAT( distinct d.id) depId GROUP_CONCAT( distinct d.id) depId
FROM FROM
......
...@@ -74,8 +74,8 @@ ...@@ -74,8 +74,8 @@
FROM FROM
p_input_item a p_input_item a
where a.is_delete = '0' and a.input_type!='1' where a.is_delete = '0' and a.input_type!='1'
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%")</if> <if test="name!=null"> and a.name like concat(concat('%',#{name}),'%')</if>
<if test="itemNo!=null"> and a.item_no like concat(concat("%",#{itemNo}),"%")</if> <if test="itemNo!=null"> and a.item_no like concat(concat('%',#{itemNo}),'%')</if>
<if test="isScore!=null"> and a.is_Score = #{isScore}</if> <if test="isScore!=null"> and a.is_Score = #{isScore}</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if> <if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<!-- <if test="level!=null"> and a.level = #{level} </if> --> <!-- <if test="level!=null"> and a.level = #{level} </if> -->
...@@ -108,8 +108,8 @@ ...@@ -108,8 +108,8 @@
p_input_item a left join p_catalog_tree b on a.catalog_id = b.id p_input_item a left join p_catalog_tree b on a.catalog_id = b.id
where a.is_delete = '0' where a.is_delete = '0'
and a.input_type!='1' and a.input_type!='1'
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%")</if> <if test="name!=null"> and a.name like concat(concat('%',#{name}),'%')</if>
<if test="itemNo!=null"> and a.item_no like concat(concat("%",#{itemNo}),"%")</if> <if test="itemNo!=null"> and a.item_no like concat(concat('%',#{itemNo}),'%')</if>
<if test="isScore!=null"> and a.is_Score = #{isScore}</if> <if test="isScore!=null"> and a.is_Score = #{isScore}</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if> <if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<!-- <if test="level!=null"> and a.level = #{level} </if> --> <!-- <if test="level!=null"> and a.level = #{level} </if> -->
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
and item_type = #{itemType} and item_type = #{itemType}
</if> </if>
<if test="nameOrItemNo!=null and nameOrItemNo !='' "> <if test="nameOrItemNo!=null and nameOrItemNo !='' ">
and (name like concat("%", #{nameOrItemNo}, "%") or item_no like concat("%", #{nameOrItemNo}, "%")) and (name like concat('%', #{nameOrItemNo}, '%') or item_no like concat('%', #{nameOrItemNo}, '%'))
</if> </if>
<if test="equipmentType!=null and equipmentType.size()>0"> <if test="equipmentType!=null and equipmentType.size()>0">
and equipment_type in and equipment_type in
...@@ -235,8 +235,8 @@ ...@@ -235,8 +235,8 @@
FROM FROM
p_input_item a p_input_item a
where a.is_delete = '0' and a.input_type!='1' where a.is_delete = '0' and a.input_type!='1'
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%")</if> <if test="name!=null"> and a.name like concat(concat('%',#{name}),'%')</if>
<if test="itemNo!=null"> and a.item_no like concat(concat("%",#{itemNo}),"%")</if> <if test="itemNo!=null"> and a.item_no like concat(concat('%',#{itemNo}),'%')</if>
<if test="isScore!=null"> and a.is_Score = #{isScore}</if> <if test="isScore!=null"> and a.is_Score = #{isScore}</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if> <if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<if test="orgCode!=null"> and a.org_Code = #{orgCode}</if> <if test="orgCode!=null"> and a.org_Code = #{orgCode}</if>
...@@ -315,8 +315,8 @@ ...@@ -315,8 +315,8 @@
p_input_item a left join p_catalog_tree b on a.catalog_id = b.id p_input_item a left join p_catalog_tree b on a.catalog_id = b.id
where a.is_delete = '0' where a.is_delete = '0'
and a.input_type!='1' and a.input_type!='1'
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%")</if> <if test="name!=null"> and a.name like concat(concat('%',#{name}),'%')</if>
<if test="itemNo!=null"> and a.item_no like concat(concat("%",#{itemNo}),"%")</if> <if test="itemNo!=null"> and a.item_no like concat(concat('%',#{itemNo}),'%')</if>
<if test="isScore!=null"> and a.is_Score = #{isScore}</if> <if test="isScore!=null"> and a.is_Score = #{isScore}</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if> <if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<if test="orgCode!=null"> and a.org_Code = #{orgCode}</if> <if test="orgCode!=null"> and a.org_Code = #{orgCode}</if>
...@@ -414,8 +414,8 @@ ...@@ -414,8 +414,8 @@
p_input_item a left join p_catalog_tree b on a.catalog_id = b.id p_input_item a left join p_catalog_tree b on a.catalog_id = b.id
where a.is_delete = '0' where a.is_delete = '0'
and a.input_type!='1' and a.input_type!='1'
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%")</if> <if test="name!=null"> and a.name like concat(concat('%',#{name}),'%')</if>
<if test="itemNo!=null"> and a.item_no like concat(concat("%",#{itemNo}),"%")</if> <if test="itemNo!=null"> and a.item_no like concat(concat('%',#{itemNo}),'%')</if>
<if test="isScore!=null"> and a.is_Score = #{isScore}</if> <if test="isScore!=null"> and a.is_Score = #{isScore}</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if> <if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<if test="orgCode!=null"> and a.org_Code = #{orgCode}</if> <if test="orgCode!=null"> and a.org_Code = #{orgCode}</if>
...@@ -516,7 +516,7 @@ ...@@ -516,7 +516,7 @@
</select> </select>
<select id="getAllCategoryName" resultType="java.util.Map"> <select id="getAllCategoryName" resultType="java.util.Map">
select code, `name` from wl_equipment_category select code, name from wl_equipment_category
</select> </select>
<delete id="delPointInputItemById"> <delete id="delPointInputItemById">
......
...@@ -5,95 +5,95 @@ ...@@ -5,95 +5,95 @@
<!-- 另存计划 --> <!-- 另存计划 -->
<insert id="saveAs" parameterType="String"> <insert id="saveAs" parameterType="String">
INSERT INTO p_plan ( INSERT INTO p_plan (
`name`, name,
`dept_id`, dept_id,
`org_code`, org_code,
`route_id`, route_id,
`plan_type`, plan_type,
`is_fixed_date`, is_fixed_date,
`in_order`, in_order,
`plan_begin`, plan_begin,
`plan_end`, plan_end,
`day_rate`, day_rate,
`day_time`, day_time,
`day_interval`, day_interval,
`day_interval_unit`, day_interval_unit,
`day_begin`, day_begin,
`day_end`, day_end,
`execute_interval`, execute_interval,
`month_type`, month_type,
`what_day`, what_day,
`what_week`, what_week,
`week_day`, week_day,
`duration`, duration,
`user_id`, user_id,
`execute_rate`, execute_rate,
`week_begin_num`, week_begin_num,
`week_end_num`, week_end_num,
`min_space`, min_space,
`is_score`, is_score,
`score_formula`, score_formula,
`status`, status,
`error`, error,
`next_gen_date`, next_gen_date,
`create_by`, create_by,
`create_date`, create_date,
`last_upd_by`, last_upd_by,
`last_upd_time`, last_upd_time,
`remark`, remark,
`remark1`, remark1,
`remark2`, remark2,
`is_single_execution`, is_single_execution,
`user_dept` user_dept
) SELECT ) SELECT
CONCAT(`name`, '复制'), CONCAT(name, '复制'),
`dept_id`, dept_id,
`org_code`, org_code,
`route_id`, route_id,
`plan_type`, plan_type,
`is_fixed_date`, is_fixed_date,
`in_order`, in_order,
`plan_begin`, plan_begin,
`plan_end`, plan_end,
`day_rate`, day_rate,
`day_time`, day_time,
`day_interval`, day_interval,
`day_interval_unit`, day_interval_unit,
`day_begin`, day_begin,
`day_end`, day_end,
`execute_interval`, execute_interval,
`month_type`, month_type,
`what_day`, what_day,
`what_week`, what_week,
`week_day`, week_day,
`duration`, duration,
`user_id`, user_id,
`execute_rate`, execute_rate,
`week_begin_num`, week_begin_num,
`week_end_num`, week_end_num,
`min_space`, min_space,
`is_score`, is_score,
`score_formula`, score_formula,
`status`, status,
`error`, error,
`next_gen_date`, next_gen_date,
`create_by`, create_by,
`create_date`, create_date,
`last_upd_by`, last_upd_by,
`last_upd_time`, last_upd_time,
`remark`, remark,
`remark1`, remark1,
`remark2`, remark2,
`is_single_execution`, is_single_execution,
`user_dept` user_dept
FROM FROM
`p_plan` p_plan
WHERE WHERE
id = #{id} id = #{id}
</insert> </insert>
<select id="getPlanByRouteId" resultType="com.yeejoin.amos.patrol.dao.entity.Plan"> <select id="getPlanByRouteId" resultType="com.yeejoin.amos.patrol.dao.entity.Plan">
SELECT * FROM `p_plan` SELECT * FROM p_plan
<where> <where>
is_delete = 0 is_delete = 0
<if test="routeId != null"> and route_id = #{routeId}</if> <if test="routeId != null"> and route_id = #{routeId}</if>
...@@ -118,21 +118,21 @@ ...@@ -118,21 +118,21 @@
p_route b p_route b
WHERE WHERE
a.route_Id = b.id and a.is_delete = 0 a.route_Id = b.id and a.is_delete = 0
<if test="planName!=null"> and a.name like concat(concat("%",#{planName}),"%")</if> <if test="planName!=null"> and a.name like concat(concat('%',#{planName}),'%')</if>
<if test="planType!=null"> and a.plan_Type = #{planType}</if> <if test="planType!=null"> and a.plan_Type = #{planType}</if>
<if test="routeId!=null"> and a.route_Id = #{routeId}</if> <if test="routeId!=null"> and a.route_Id = #{routeId}</if>
<if test="remark!=null"> and a.remark like concat(concat("%",#{remark}),"%")</if> <if test="remark!=null"> and a.remark like concat(concat('%',#{remark}),'%')</if>
<if test="deptId!=null"> and a.dept_id = #{deptId}</if> <if test="deptId!=null"> and a.dept_id = #{deptId}</if>
<if test="orgCode!=null"> and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if> <if test="orgCode!=null"> and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if>
<if test="userId!=null"> and FIND_IN_SET(#{userId},a.user_id)</if> <if test="userId!=null"> and FIND_IN_SET(#{userId},a.user_id)</if>
<if test="bizOrgCode!=null"> and b.biz_org_code like concat(concat("%",#{bizOrgCode}),"%")</if> <if test="bizOrgCode!=null"> and b.biz_org_code like concat(concat('%',#{bizOrgCode}),'%')</if>
</select> </select>
<!--巡检计划查询 --> <!--巡检计划查询 -->
<select id="getPlanInfo" resultType="java.util.HashMap"> <select id="getPlanInfo" resultType="java.util.HashMap">
SELECT SELECT
a.id,a.name , IFNULL(a.plan_begin,"") planBegin,a.`status`, a.id,a.name , IFNULL(a.plan_begin,"") planBegin,a.status,
(case a.plan_type (case a.plan_type
when 1 THEN '天' when 1 THEN '天'
when 2 THEN '周' when 2 THEN '周'
...@@ -150,13 +150,13 @@ ...@@ -150,13 +150,13 @@
p_route b p_route b
WHERE WHERE
a.route_Id = b.id and a.is_delete = 0 a.route_Id = b.id and a.is_delete = 0
<if test="planName!=null"> and a.name like concat(concat("%",#{planName}),"%")</if> <if test="planName!=null"> and a.name like concat(concat('%',#{planName}),'%')</if>
<if test="planType!=null"> and a.plan_Type = #{planType}</if> <if test="planType!=null"> and a.plan_Type = #{planType}</if>
<if test="routeId!=null"> and a.route_Id = #{routeId}</if> <if test="routeId!=null"> and a.route_Id = #{routeId}</if>
<if test="remark!=null"> and a.remark1 like concat(concat("%",#{remark}),"%")</if> <if test="remark!=null"> and a.remark1 like concat(concat('%',#{remark}),'%')</if>
<if test="orgCode!=null"> and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if> <if test="orgCode!=null"> and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if>
<if test="userId!=null"> and FIND_IN_SET(#{userId},a.user_id)</if> <if test="userId!=null"> and FIND_IN_SET(#{userId},a.user_id)</if>
<if test="bizOrgCode!=null"> and b.biz_org_code like concat(concat("%",#{bizOrgCode}),"%")</if> <if test="bizOrgCode!=null"> and b.biz_org_code like concat(concat('%',#{bizOrgCode}),'%')</if>
order by a.id desc order by a.id desc
<choose> <choose>
...@@ -176,25 +176,25 @@ ...@@ -176,25 +176,25 @@
p_route b p_route b
WHERE WHERE
a.is_delete = 0 and a.route_Id = b.id a.is_delete = 0 and a.route_Id = b.id
<if test="planName!=null"> and a.name like concat(concat("%",#{planName}),"%")</if> <if test="planName!=null"> and a.name like concat(concat('%',#{planName}),'%')</if>
<if test="planType!=null"> and a.plan_Type = #{planType}</if> <if test="planType!=null"> and a.plan_Type = #{planType}</if>
<if test="routeId!=null"> and a.route_Id = #{routeId}</if> <if test="routeId!=null"> and a.route_Id = #{routeId}</if>
<if test="remark!=null"> and a.remark like concat(concat("%",#{remark}),"%")</if> <if test="remark!=null"> and a.remark like concat(concat('%',#{remark}),'%')</if>
<if test="orgCode!=null"> and (a.org_code LIKE CONCAT( #{orgCode}, '-%' ) or a.org_code= #{orgCode} )</if> <if test="orgCode!=null"> and (a.org_code LIKE CONCAT( #{orgCode}, '-%' ) or a.org_code= #{orgCode} )</if>
<if test="userId!=null"> and FIND_IN_SET(#{userId},a.user_id)</if> <if test="userId!=null"> and FIND_IN_SET(#{userId},a.user_id)</if>
<if test="bizOrgCode!=null"> and b.biz_org_code like concat(#{bizOrgCode},"%")</if> <if test="bizOrgCode!=null"> and b.biz_org_code like concat(#{bizOrgCode},'%')</if>
order by a.id order by a.id
</select> </select>
<select id="queryPlanListByOrgCode" resultType="Map"> <select id="queryPlanListByOrgCode" resultType="Map">
select p.id, p.name from p_plan p where p.is_delete = 0 and and b.biz_org_code like concat(#{loginOrgCode},"%") select p.id, p.name from p_plan p where p.is_delete = 0 and and b.biz_org_code like concat(#{loginOrgCode},'%')
</select> </select>
<update id="initUpdatePlanStatus"> <update id="initUpdatePlanStatus">
UPDATE p_plan p SET p.`status` = 1 WHERE p.is_delete = 0 AND p.`status` = 0 AND p.plan_end <![CDATA[ < ]]> CURDATE(); UPDATE p_plan p SET p.status = 1 WHERE p.is_delete = 0 AND p.status = 0 AND p.plan_end <![CDATA[ < ]]> CURDATE();
</update> </update>
<update id="initUpdatePlanNextGenDate"> <update id="initUpdatePlanNextGenDate">
UPDATE p_plan p SET p.next_gen_date = CURDATE() WHERE p.is_delete = 0 AND p.`status` = 0 AND p.plan_end IS NULL AND p.next_gen_date <![CDATA[ < ]]> CURDATE(); UPDATE p_plan p SET p.next_gen_date = CURDATE() WHERE p.is_delete = 0 AND p.status = 0 AND p.plan_end IS NULL AND p.next_gen_date <![CDATA[ < ]]> CURDATE();
</update> </update>
</mapper> </mapper>
\ No newline at end of file
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode}) and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})
</if> </if>
<if test="searchDay!=null and searchDay != '' and searchDay == 1"> <if test="searchDay!=null and searchDay != '' and searchDay == 1">
and a.`check_date` = curdate() and a.check_date = curdate()
</if> </if>
</where> </where>
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
(case b.is_finish (case b.is_finish
when 0 THEN '尚未巡检' when 0 THEN '尚未巡检'
when 1 THEN '按时完成' when 1 THEN '按时完成'
else '超时漏检' END) as `statusName`, else '超时漏检' END) as statusName,
...@@ -88,52 +88,52 @@ ...@@ -88,52 +88,52 @@
</sql> </sql>
<!--计划执行查询 --> <!--计划执行查询 -->
<select id="getPlanTaskInfo" resultType="java.util.HashMap"> <select id="getPlanTaskInfo" resultType="java.util.HashMap">
<include refid="planTaskInfoSql" /> <include refid="planTaskInfoSql"/>
<where> <where>
<if test="pointNo!=null"> and d.point_no like concat('%',#{pointNo},'%')</if> <if test="pointNo!=null">and d.point_no like concat('%',#{pointNo},'%')</if>
<if test="pointName!=null"> and d.name like concat('%',#{pointName},'%')</if> <if test="pointName!=null">and d.name like concat('%',#{pointName},'%')</if>
<!-- AND--> <!-- AND-->
<!-- ((<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate}</if>)--> <!-- ((<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate}</if>)-->
<!-- OR--> <!-- OR-->
<!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{beginDate} AND a.end_Time <![CDATA[>=]]> #{beginDate}</if>)--> <!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{beginDate} AND a.end_Time <![CDATA[>=]]> #{beginDate}</if>)-->
<!-- OR--> <!-- OR-->
<!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{endDate} AND a.end_Time <![CDATA[>=]]> #{endDate}</if>)--> <!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{endDate} AND a.end_Time <![CDATA[>=]]> #{endDate}</if>)-->
<!-- OR--> <!-- OR-->
<!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{beginDate} AND a.end_Time <![CDATA[>=]]> #{endDate}</if>)--> <!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{beginDate} AND a.end_Time <![CDATA[>=]]> #{endDate}</if>)-->
<!-- )--> <!-- )-->
<if test="beginDate!=null and endDate!=null and endDate != '' and beginDate != ''"> <if test="beginDate!=null and endDate!=null and endDate != '' and beginDate != ''">
and a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate} and a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate}
</if> </if>
<if test="beginDate=='' and endDate != null and endDate != ''"> <if test="beginDate=='' and endDate != null and endDate != ''">
AND a.end_Time <![CDATA[<=]]> #{endDate} AND a.end_Time <![CDATA[<=]]> #{endDate}
</if> </if>
<if test="beginDate!=null and beginDate != '' and endDate == ''"> <if test="beginDate!=null and beginDate != '' and endDate == ''">
and a.begin_Time <![CDATA[>=]]> #{beginDate} and a.begin_Time <![CDATA[>=]]> #{beginDate}
</if> </if>
<if test="status!=null"> and b.is_finish = #{status}</if> <if test="status!=null">and b.is_finish = #{status}</if>
<if test="routeId!=null"> and a.route_id = #{routeId}</if> <if test="routeId!=null">and a.route_id = #{routeId}</if>
<if test="planId!=null"> and a.plan_id = #{planId}</if> <if test="planId!=null">and a.plan_id = #{planId}</if>
<if test="bizOrgCode!=null"> and a.org_Code like concat (#{bizOrgCode},"%")</if> <if test="bizOrgCode!=null">and a.org_Code like concat (#{bizOrgCode},'%')</if>
<if test="orgCode!=null"> <if test="orgCode!=null">
and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode}) and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})
</if> </if>
<if test="searchDay!=null and searchDay != '' and searchDay == 1"> <if test="searchDay!=null and searchDay != '' and searchDay == 1">
and a.`check_date` = curdate() and a.check_date = curdate()
</if> </if>
</where> </where>
order by b.id order by b.id
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose> </choose>
</select> </select>
<select id="getPlanTaskInfoList" resultType="com.yeejoin.amos.patrol.business.vo.PlanTaskVo"> <select id="getPlanTaskInfoList" resultType="com.yeejoin.amos.patrol.business.vo.PlanTaskVo">
<include refid="planTaskInfoSql" /> <include refid="planTaskInfoSql" />
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
</select> </select>
<select id="getPlanTaskByRouteId" resultType="com.yeejoin.amos.patrol.dao.entity.PlanTask"> <select id="getPlanTaskByRouteId" resultType="com.yeejoin.amos.patrol.dao.entity.PlanTask">
SELECT * FROM `p_plan_task` SELECT * FROM p_plan_task
<where> <where>
<if test="routeId != null">route_id = #{routeId}</if> <if test="routeId != null">route_id = #{routeId}</if>
</where> </where>
...@@ -263,7 +263,7 @@ ...@@ -263,7 +263,7 @@
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
) a ) a
<include refid="plan-task-app-where"/> <include refid="plan-task-app-where"/>
<if test="orderBy != null and orderBy != ''"> order by ${orderBy} </if> <if test="orderBy != null and orderBy != ''"> order by ${orderBy} </if>
...@@ -403,25 +403,25 @@ ...@@ -403,25 +403,25 @@
pt.finish_num finishNum, pt.finish_num finishNum,
pt.finish_status finishStatus, pt.finish_status finishStatus,
pt.batch_no batchNo, pt.batch_no batchNo,
CASE ptd.`status` CASE ptd.status
WHEN 1 THEN WHEN 1 THEN
1 1
ELSE ELSE
0 0
END finish, END finish,
CASE ptd.`status` CASE ptd.status
WHEN 3 THEN WHEN 3 THEN
1 1
ELSE ELSE
0 0
END omission, END omission,
CASE ptd.`status` CASE ptd.status
WHEN 2 THEN WHEN 2 THEN
1 1
ELSE ELSE
0 0
END unqualified, END unqualified,
CASE ptd.`status` CASE ptd.status
WHEN 0 THEN WHEN 0 THEN
1 1
ELSE ELSE
...@@ -480,11 +480,11 @@ ...@@ -480,11 +480,11 @@
temp1.routePointItemId, temp1.routePointItemId,
temp1.classifyId, temp1.classifyId,
temp1.classifyName, temp1.classifyName,
pii.`name` inputName, pii.name inputName,
(select p_point.`name` from p_point where p_point.id= temp2.pointId) pointName, (select p_point.name from p_point where p_point.id= temp2.pointId) pointName,
(select p_plan.`name` from p_plan where p_plan.id= temp2.planId) planName, (select p_plan.name from p_plan where p_plan.id= temp2.planId) planName,
(select p_route.`name` from p_route where p_route.id= temp2.routeId) routeName, (select p_route.name from p_route where p_route.id= temp2.routeId) routeName,
(select p_route.`biz_org_code` from p_route where p_route.id= temp2.routeId) orgCode, (select p_route.biz_org_code from p_route where p_route.id= temp2.routeId) orgCode,
temp2.* temp2.*
FROM FROM
...@@ -499,7 +499,7 @@ ...@@ -499,7 +499,7 @@
prp.route_id, prp.route_id,
prpi.id routePointItemId, prpi.id routePointItemId,
ppc.id classifyId, ppc.id classifyId,
ppc.`name` classifyName ppc.name classifyName
FROM FROM
p_route_point_item prpi p_route_point_item prpi
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id
...@@ -514,7 +514,7 @@ ...@@ -514,7 +514,7 @@
ptd.route_id routeId, ptd.route_id routeId,
ptd.plan_id planId, ptd.plan_id planId,
ptd.user_id AS userId, ptd.user_id AS userId,
ptd.end_time AS endTime, ptd.end_time AS endTime,
pptd.id as planTaskDetailId, pptd.id as planTaskDetailId,
(select p_plan.dept_id from p_plan where p_plan.id=ptd.plan_id) depId (select p_plan.dept_id from p_plan where p_plan.id=ptd.plan_id) depId
...@@ -523,7 +523,7 @@ ...@@ -523,7 +523,7 @@
p_plan_task ptd p_plan_task ptd
WHERE WHERE
pptd.task_no = ptd.id pptd.task_no = ptd.id
AND ptd.id = #{planTaskId} and pptd.`status` = #{planTaskDetailStatus} AND ptd.id = #{planTaskId} and pptd.status = #{planTaskDetailStatus}
) temp2 on(temp1.point_id = temp2.pointId ) temp2 on(temp1.point_id = temp2.pointId
AND temp1.route_id = temp2.routeId) AND temp1.route_id = temp2.routeId)
...@@ -687,15 +687,15 @@ ...@@ -687,15 +687,15 @@
<select id="getPointPlanTaskInfo" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.PointCheckDetailBo" parameterType="long"> <select id="getPointPlanTaskInfo" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.PointCheckDetailBo" parameterType="long">
SELECT SELECT
pp.id pointId, pp.id pointId,
pp.`name` pointName, pp.name pointName,
pp.point_no pointNo, pp.point_no pointNo,
ppt.route_id routeId, ppt.route_id routeId,
ppl.`name` planName, ppl.name planName,
ppt.begin_time checkTime, ppt.begin_time checkTime,
ppl.dept_id checkDepartmentId, ppl.dept_id checkDepartmentId,
ppt.user_id userId, ppt.user_id userId,
ppt.user_name userName, ppt.user_name userName,
pptd.`status` pointStatus pptd.status pointStatus
FROM FROM
p_plan_task_detail pptd p_plan_task_detail pptd
LEFT JOIN p_plan_task ppt ON pptd.task_no = ppt.id LEFT JOIN p_plan_task ppt ON pptd.task_no = ppt.id
...@@ -713,7 +713,7 @@ ...@@ -713,7 +713,7 @@
<select id="getPointInputByRouteIdAndPointId" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.PointCheckDetailBo" parameterType="long"> <select id="getPointInputByRouteIdAndPointId" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.PointCheckDetailBo" parameterType="long">
SELECT SELECT
pii.`name` inputName, pii.name inputName,
pii.id checkInputId, pii.id checkInputId,
ppc.id classifyId, ppc.id classifyId,
ppc.name classifyName, ppc.name classifyName,
...@@ -739,7 +739,7 @@ ...@@ -739,7 +739,7 @@
<!-- <!--
SELECT SELECT
pii.`name` inputName, pii.name inputName,
pii.id checkInputId pii.id checkInputId
FROM FROM
p_route_point_item prpi, p_route_point_item prpi,
...@@ -860,7 +860,7 @@ ...@@ -860,7 +860,7 @@
</resultMap> </resultMap>
<select id="getRoutePointInputItem" resultType="com.yeejoin.amos.patrol.business.vo.PointInputItemVo"> <select id="getRoutePointInputItem" resultType="com.yeejoin.amos.patrol.business.vo.PointInputItemVo">
SELECT SELECT
pii.*, ppc.id classifyIds, ppc.`name` classifyNames pii.*, ppc.id classifyIds, ppc.name classifyNames
FROM FROM
p_route_point_item prpi p_route_point_item prpi
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id
...@@ -952,10 +952,10 @@ ...@@ -952,10 +952,10 @@
SELECT SELECT
ppc.id, ppc.id,
ppc.point_id pointId, ppc.point_id pointId,
ppc.`name`, ppc.name,
ppc.order_no orderNo ppc.order_no orderNo
FROM FROM
`p_route_point_item` prpi p_route_point_item prpi
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id
LEFT JOIN p_point_classify ppc ON ppc.id = prpi.point_classify_id LEFT JOIN p_point_classify ppc ON ppc.id = prpi.point_classify_id
WHERE WHERE
...@@ -964,7 +964,7 @@ ...@@ -964,7 +964,7 @@
GROUP BY GROUP BY
ppc.id, ppc.id,
ppc.point_id, ppc.point_id,
ppc.`name`, ppc.name,
ppc.order_no ppc.order_no
</select> </select>
...@@ -1041,7 +1041,7 @@ ...@@ -1041,7 +1041,7 @@
ppk.user_id AS userId, ppk.user_id AS userId,
( CASE pptd.STATUS WHEN 0 THEN '未执行' WHEN 1 THEN '正常' WHEN 2 THEN '异常' WHEN 3 THEN '漏检' END ) AS STATUS ( CASE pptd.STATUS WHEN 0 THEN '未执行' WHEN 1 THEN '正常' WHEN 2 THEN '异常' WHEN 3 THEN '漏检' END ) AS STATUS
FROM FROM
`p_plan_task` ppk p_plan_task ppk
LEFT JOIN p_plan pp ON pp.id = ppk.plan_id LEFT JOIN p_plan pp ON pp.id = ppk.plan_id
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
<where> <where>
...@@ -1068,7 +1068,7 @@ ...@@ -1068,7 +1068,7 @@
point.risk_source_id, point.risk_source_id,
( CASE pptd.STATUS WHEN 0 THEN '未执行' WHEN 1 THEN '正常' WHEN 2 THEN '异常' WHEN 3 THEN '漏检' END ) AS STATUS ( CASE pptd.STATUS WHEN 0 THEN '未执行' WHEN 1 THEN '正常' WHEN 2 THEN '异常' WHEN 3 THEN '漏检' END ) AS STATUS
FROM FROM
`p_plan_task` ppk p_plan_task ppk
LEFT JOIN p_plan pp ON pp.id = ppk.plan_id LEFT JOIN p_plan pp ON pp.id = ppk.plan_id
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
LEFT JOIN p_point point ON point.id = pptd.point_id LEFT JOIN p_point point ON point.id = pptd.point_id
...@@ -1111,14 +1111,14 @@ ...@@ -1111,14 +1111,14 @@
<select id="firePatrolStatics" resultType="java.util.Map"> <select id="firePatrolStatics" resultType="java.util.Map">
SELECT SELECT
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) AS `value`, ifnull( sum( p_plan_task.point_num ), 0 ) AS value,
'个' AS unit, '个' AS unit,
'今日应巡查点' AS `name`, '今日应巡查点' AS name,
'currentDayTotal' AS `indexKey`, 'currentDayTotal' AS indexKey,
'xfxc' AS type, 'xfxc' AS type,
'1' AS `key` '1' AS key
FROM FROM
`p_plan_task` p_plan_task
WHERE WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
...@@ -1126,30 +1126,30 @@ ...@@ -1126,30 +1126,30 @@
</if> </if>
UNION ALL UNION ALL
SELECT SELECT
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) AS `value`, ifnull( sum( p_plan_task.point_num ), 0 ) AS value,
'个' AS unit, '个' AS unit,
'今日漏查点位' AS `name`, '今日漏查点位' AS name,
'currentDayMiss' AS `indexKey`, 'currentDayMiss' AS indexKey,
'xfxc' AS type, 'xfxc' AS type,
'2' AS `key` '2' AS key
FROM FROM
`p_plan_task` p_plan_task
WHERE WHERE
`finish_status` = 3 finish_status = 3
AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%') AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if> </if>
UNION ALL UNION ALL
SELECT SELECT
ifnull( sum( `p_plan_task`.`finish_num` ), 0 ) AS `value`, ifnull( sum( p_plan_task.finish_num ), 0 ) AS value,
'个' AS unit, '个' AS unit,
'今日已巡查点' AS `name`, '今日已巡查点' AS name,
'currentDayPass' AS `indexKey`, 'currentDayPass' AS indexKey,
'xfxc' AS type, 'xfxc' AS type,
'3' AS `key` '3' AS key
FROM FROM
`p_plan_task` p_plan_task
WHERE WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
...@@ -1161,7 +1161,7 @@ ...@@ -1161,7 +1161,7 @@
SELECT SELECT
count(1) count(1)
FROM FROM
`p_plan_task` ppk p_plan_task ppk
LEFT JOIN p_plan pp ON pp.id = ppk.plan_id LEFT JOIN p_plan pp ON pp.id = ppk.plan_id
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
LEFT JOIN p_route pr ON pr.id = ppk.route_id LEFT JOIN p_route pr ON pr.id = ppk.route_id
...@@ -1181,7 +1181,7 @@ ...@@ -1181,7 +1181,7 @@
ppk.id AS planTaskId, ppk.id AS planTaskId,
pptd.id AS taskDetailId, pptd.id AS taskDetailId,
pp.NAME AS taskName, pp.NAME AS taskName,
pr.`name` AS routeName, pr.name AS routeName,
DATE_FORMAT(ppk.begin_time, '%Y-%m-%d %H:%i:%s') AS beginTime, DATE_FORMAT(ppk.begin_time, '%Y-%m-%d %H:%i:%s') AS beginTime,
DATE_FORMAT(ppk.end_time, '%Y-%m-%d %H:%i:%s') AS endTime, DATE_FORMAT(ppk.end_time, '%Y-%m-%d %H:%i:%s') AS endTime,
ppk.point_num AS checkedNum, ppk.point_num AS checkedNum,
...@@ -1190,7 +1190,7 @@ ...@@ -1190,7 +1190,7 @@
ppk.user_id AS userId, ppk.user_id AS userId,
ppk.user_name AS executor ppk.user_name AS executor
FROM FROM
`p_plan_task` ppk p_plan_task ppk
LEFT JOIN p_plan pp ON pp.id = ppk.plan_id LEFT JOIN p_plan pp ON pp.id = ppk.plan_id
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
LEFT JOIN p_route pr ON pr.id = ppk.route_id LEFT JOIN p_route pr ON pr.id = ppk.route_id
...@@ -1221,7 +1221,7 @@ ...@@ -1221,7 +1221,7 @@
(UNIX_TIMESTAMP(ppk.end_time) - UNIX_TIMESTAMP(ppk.begin_time)) AS difSecond, (UNIX_TIMESTAMP(ppk.end_time) - UNIX_TIMESTAMP(ppk.begin_time)) AS difSecond,
( CASE pptd.is_finish WHEN 0 THEN '未完成' WHEN 1 THEN '已完成' WHEN 2 THEN '超时漏检' END ) AS taskStatus ( CASE pptd.is_finish WHEN 0 THEN '未完成' WHEN 1 THEN '已完成' WHEN 2 THEN '超时漏检' END ) AS taskStatus
FROM FROM
`p_plan_task` ppk p_plan_task ppk
LEFT JOIN p_plan pp ON pp.id = ppk.plan_id LEFT JOIN p_plan pp ON pp.id = ppk.plan_id
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
<where> <where>
...@@ -1277,13 +1277,13 @@ ...@@ -1277,13 +1277,13 @@
<select id="getDefinitionObjCode" resultType="String"> <select id="getDefinitionObjCode" resultType="String">
SELECT SELECT
cl.`code` cl.code
FROM FROM
p_plan_task_detail de p_plan_task_detail de
LEFT JOIN p_point_classify cl ON cl.point_id = de.point_id LEFT JOIN p_point_classify cl ON cl.point_id = de.point_id
LEFT JOIN p_plan_task task ON task.id = de.task_no LEFT JOIN p_plan_task task ON task.id = de.task_no
WHERE WHERE
de.id = #{taskDetailId} AND cl.`code` IS NOT NULL de.id = #{taskDetailId} AND cl.code IS NOT NULL
</select> </select>
<select id="getDefectEquipInfo" resultType="Map"> <select id="getDefectEquipInfo" resultType="Map">
...@@ -1300,7 +1300,7 @@ ...@@ -1300,7 +1300,7 @@
<select id="getCheckMissedEquipInfo" resultType="Map"> <select id="getCheckMissedEquipInfo" resultType="Map">
SELECT SELECT
cl.`name` AS equipName, cl.name AS equipName,
cl.address AS equipPosition, cl.address AS equipPosition,
'漏检' AS result, '漏检' AS result,
cl.data_source_name AS remark cl.data_source_name AS remark
...@@ -1316,7 +1316,7 @@ ...@@ -1316,7 +1316,7 @@
<select id="getCheckQualifiedEquipInfo" resultType="Map"> <select id="getCheckQualifiedEquipInfo" resultType="Map">
SELECT SELECT
cl.`name` AS equipName, cl.name AS equipName,
cl.address AS equipPosition, cl.address AS equipPosition,
pii.name AS checkItem, pii.name AS checkItem,
'合格' AS result, '合格' AS result,
...@@ -1335,13 +1335,13 @@ ...@@ -1335,13 +1335,13 @@
<select id="getCheckNotQualifiedEquipInfo" resultType="Map"> <select id="getCheckNotQualifiedEquipInfo" resultType="Map">
SELECT SELECT
cl.`name` AS equipName, cl.name AS equipName,
cl.address AS equipPosition, cl.address AS equipPosition,
pii.name AS checkItem, pii.name AS checkItem,
'不合格' AS result, '不合格' AS result,
pc.check_time AS checkDate, pc.check_time AS checkDate,
pc.user_name AS checkUserName, pc.user_name AS checkUserName,
cl.`code` AS objCode cl.code AS objCode
FROM FROM
p_point_classify cl p_point_classify cl
LEFT JOIN p_check_input pci ON pci.point_classify_id = cl.id LEFT JOIN p_check_input pci ON pci.point_classify_id = cl.id
...@@ -1359,13 +1359,13 @@ ...@@ -1359,13 +1359,13 @@
<select id="getStatics" resultType="java.util.Map"> <select id="getStatics" resultType="java.util.Map">
SELECT SELECT
'0' AS `key`, '0' AS key,
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) AS `value`, ifnull( sum( p_plan_task.point_num ), 0 ) AS value,
'' AS unit, '' AS unit,
'今日总巡查点位' AS `name`, '今日总巡查点位' AS name,
'xfxcjrzxcdw' AS code 'xfxcjrzxcdw' AS code
FROM FROM
`p_plan_task` p_plan_task
WHERE WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
...@@ -1373,13 +1373,13 @@ ...@@ -1373,13 +1373,13 @@
</if> </if>
UNION ALL UNION ALL
SELECT SELECT
'1' AS `key`, '1' AS key,
ifnull( sum( `p_plan_task`.`finish_num` ), 0 ) AS `value`, ifnull( sum( p_plan_task.finish_num ), 0 ) AS value,
'' AS unit, '' AS unit,
'今日累计巡查点位' AS `name`, '今日累计巡查点位' AS name,
'xfxcjrljxcdw' AS code 'xfxcjrljxcdw' AS code
FROM FROM
`p_plan_task` p_plan_task
WHERE WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
...@@ -1387,13 +1387,13 @@ ...@@ -1387,13 +1387,13 @@
</if> </if>
UNION ALL UNION ALL
SELECT SELECT
'2' AS `key`, '2' AS key,
count(1) AS `value`, count(1) AS value,
'' AS unit, '' AS unit,
'合格' AS `name`, '合格' AS name,
'xfxchg' AS code 'xfxchg' AS code
FROM FROM
`p_plan_task` ppk p_plan_task ppk
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
WHERE WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND pptd.STATUS = 1 DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND pptd.STATUS = 1
...@@ -1402,20 +1402,20 @@ ...@@ -1402,20 +1402,20 @@
</if> </if>
UNION ALL UNION ALL
SELECT SELECT
'3' AS `key`, '3' AS key,
'' AS `value`, '' AS value,
'%' AS unit, '%' AS unit,
'合格占比' AS `name`, '合格占比' AS name,
'xfxchgzb' AS code 'xfxchgzb' AS code
UNION ALL UNION ALL
SELECT SELECT
'4' AS `key`, '4' AS key,
count(1) AS `value`, count(1) AS value,
'' AS unit, '' AS unit,
'不合格' AS `name`, '不合格' AS name,
'xfxcbhg' AS code 'xfxcbhg' AS code
FROM FROM
`p_plan_task` ppk p_plan_task ppk
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
WHERE WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND pptd.STATUS = 2 DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND pptd.STATUS = 2
...@@ -1424,25 +1424,25 @@ ...@@ -1424,25 +1424,25 @@
</if> </if>
UNION ALL UNION ALL
SELECT SELECT
'5' AS `key`, '5' AS key,
count(1) AS `value`, count(1) AS value,
'' AS unit, '' AS unit,
'今日漏查点位' AS `name`, '今日漏查点位' AS name,
'xfxcjrlcdw' AS code 'xfxcjrlcdw' AS code
FROM FROM
`p_plan_task` p_plan_task
WHERE WHERE
`finish_status` = 3 finish_status = 3
AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%') AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if> </if>
UNION ALL UNION ALL
SELECT SELECT
'6' AS `key`, '6' AS key,
'' AS `value`, '' AS value,
'%' AS unit, '%' AS unit,
'漏查率' AS `name`, '漏查率' AS name,
'xfxclcl' AS code 'xfxclcl' AS code
</select> </select>
...@@ -1467,9 +1467,9 @@ ...@@ -1467,9 +1467,9 @@
( (
SELECT SELECT
pt.id AS task_id, pt.id AS task_id,
r.`name` route_name, r.name route_name,
pt.route_id, pt.route_id,
p.`name` plan_name, p.name plan_name,
pt.plan_id, pt.plan_id,
pt.id AS plan_task_id, pt.id AS plan_task_id,
pt.begin_time, pt.begin_time,
...@@ -1492,7 +1492,7 @@ ...@@ -1492,7 +1492,7 @@
0, 0,
SUM( is_certificate )) SUM( is_certificate ))
FROM FROM
`cb_org_usr` cb_org_usr
WHERE WHERE
FIND_IN_SET( amos_org_id, pt.user_id ) > 0 FIND_IN_SET( amos_org_id, pt.user_id ) > 0
) AS certified_person_count, ) AS certified_person_count,
...@@ -1502,9 +1502,9 @@ ...@@ -1502,9 +1502,9 @@
p.org_code, p.org_code,
p.biz_org_code AS biz_org_code, p.biz_org_code AS biz_org_code,
p.biz_org_name AS biz_org_name, p.biz_org_name AS biz_org_name,
pt.end_time AS `date` pt.end_time AS date
FROM FROM
`p_plan_task` pt p_plan_task pt
LEFT JOIN p_plan p ON p.id = pt.plan_id LEFT JOIN p_plan p ON p.id = pt.plan_id
LEFT JOIN p_route r ON r.id = pt.route_id LEFT JOIN p_route r ON r.id = pt.route_id
<where> <where>
...@@ -1538,7 +1538,7 @@ ...@@ -1538,7 +1538,7 @@
ci.input_name, ci.input_name,
ci.input_value, ci.input_value,
c.check_time, c.check_time,
pt.end_time AS `date`, pt.end_time AS date,
c.plan_id, c.plan_id,
c.plan_name, c.plan_name,
c.route_id, c.route_id,
...@@ -1550,17 +1550,17 @@ ...@@ -1550,17 +1550,17 @@
c.dep_name, c.dep_name,
es.id AS eq_id, es.id AS eq_id,
es.NAME eq_name, es.NAME eq_name,
es.`code` eq_code, es.code eq_code,
( SELECT GROUP_CONCAT( ffs.NAME ) FROM f_fire_fighting_system ffs WHERE find_in_set( ffs.id, es.system_id ) ) AS system_name, ( SELECT GROUP_CONCAT( ffs.NAME ) FROM f_fire_fighting_system ffs WHERE find_in_set( ffs.id, es.system_id ) ) AS system_name,
CONCAT( pt.id, '' ) AS plan_task_id, CONCAT( pt.id, '' ) AS plan_task_id,
pt.end_time AS plan_completion_time, pt.end_time AS plan_completion_time,
c.id AS check_id, c.id AS check_id,
p.point_no, p.point_no,
cou.`code` AS company_code, cou.code AS company_code,
es.equipment_code AS equipment_type_code, es.equipment_code AS equipment_type_code,
pii.item_no AS input_code, pii.item_no AS input_code,
p.point_no AS pointCode, p.point_no AS pointCode,
wws.`code` AS buildCode, wws.code AS buildCode,
wws.full_name AS buildName wws.full_name AS buildName
FROM FROM
p_check_input ci p_check_input ci
......
...@@ -151,18 +151,18 @@ ...@@ -151,18 +151,18 @@
FROM FROM
p_task a p_task a
<!-- <trim prefix="WHERE" prefixOverrides="AND "> <!-- <trim prefix="WHERE" prefixOverrides="AND ">
<if test="remark!=null"> and a.remark like concat(concat("%",#{remark}),"%")</if> <if test="remark!=null"> and a.remark like concat(concat('%',#{remark}),'%')</if>
<if test="status!=null"> and a.status = #{status}</if> <if test="status!=null"> and a.status = #{status}</if>
<if test="title!=null"> and a.title like concat(concat("%",#{title}),"%")</if> <if test="title!=null"> and a.title like concat(concat('%',#{title}),'%')</if>
<if test="userId!=null"> and (a.publisher = #{userId} or a.executor_id = #{userId})</if> <if test="userId!=null"> and (a.publisher = #{userId} or a.executor_id = #{userId})</if>
<if test="orgCode!=null"> and a.org_Code like #{orgCode}</if> <if test="orgCode!=null"> and a.org_Code like #{orgCode}</if>
<if test="pointId!=null"> and a.point_id = #{pointId}</if> <if test="pointId!=null"> and a.point_id = #{pointId}</if>
</trim> --> </trim> -->
<trim prefix="WHERE" prefixOverrides="AND "> <trim prefix="WHERE" prefixOverrides="AND ">
<if test="remark!=null"> and a.remark like concat(concat("%",#{remark}),"%")</if> <if test="remark!=null"> and a.remark like concat(concat('%',#{remark}),'%')</if>
<if test="status!=null"> and a.status = #{status}</if> <if test="status!=null"> and a.status = #{status}</if>
<if test="title!=null"> and a.title like concat(concat("%",#{title}),"%")</if> <if test="title!=null"> and a.title like concat(concat('%',#{title}),'%')</if>
<if test="userId!=null"> and (a.publisher = #{userId} or a.executor_id = #{userId})</if> <if test="userId!=null"> and (a.publisher = #{userId} or a.executor_id = #{userId})</if>
<if test="orgCode!=null"> and a.org_Code = #{orgCode}</if> <if test="orgCode!=null"> and a.org_Code = #{orgCode}</if>
<if test="deptId!=null"> and a.dep_id = #{deptId}</if> <if test="deptId!=null"> and a.dep_id = #{deptId}</if>
...@@ -191,17 +191,17 @@ ...@@ -191,17 +191,17 @@
<!-- IFNULL(case when u.mobile = '' or u.mobile is null then null else u.mobile END,u.telephone) as telep, <!-- IFNULL(case when u.mobile = '' or u.mobile is null then null else u.mobile END,u.telephone) as telep,
--> a.remark, --> a.remark,
a.feedback_num AS feedbackNum, a.feedback_num AS feedbackNum,
( SELECT CONCAT(pp.`name`,'(',GROUP_CONCAT(pii.`name`),')') FROM p_task_detail ptd ( SELECT CONCAT(pp.name,'(',GROUP_CONCAT(pii.name),')') FROM p_task_detail ptd
LEFT JOIN p_input_item pii ON pii.id = ptd.item_id LEFT JOIN p_input_item pii ON pii.id = ptd.item_id
LEFT JOIN p_point pp ON pp.id = ptd.point_id LEFT JOIN p_point pp ON pp.id = ptd.point_id
WHERE ptd.task_id = a.id WHERE ptd.task_id = a.id
GROUP BY pp.`name`) as pointItemName GROUP BY pp.name) as pointItemName
from p_task a from p_task a
<!-- LEFT JOIN s_user u on u.id = a.executor_id --> <!-- LEFT JOIN s_user u on u.id = a.executor_id -->
<trim prefix="WHERE" prefixOverrides="AND "> <trim prefix="WHERE" prefixOverrides="AND ">
<if test="remark!=null"> and a.remark like concat(concat("%",#{remark}),"%")</if> <if test="remark!=null"> and a.remark like concat(concat('%',#{remark}),'%')</if>
<if test="status!=null"> and a.status = #{status}</if> <if test="status!=null"> and a.status = #{status}</if>
<if test="title!=null"> and a.title like concat(concat("%",#{title}),"%")</if> <if test="title!=null"> and a.title like concat(concat('%',#{title}),'%')</if>
<if test="userId!=null"> and (a.publisher = #{userId} or a.executor_id = #{userId})</if> <if test="userId!=null"> and (a.publisher = #{userId} or a.executor_id = #{userId})</if>
<if test="orgCode!=null"> and a.org_Code = #{orgCode}</if> <if test="orgCode!=null"> and a.org_Code = #{orgCode}</if>
<if test="deptId!=null"> and a.dep_id = #{deptId}</if> <if test="deptId!=null"> and a.dep_id = #{deptId}</if>
...@@ -224,14 +224,14 @@ ...@@ -224,14 +224,14 @@
FROM FROM
( (
SELECT SELECT
@s :=@s - 1 AS `index`, @s :=@s - 1 AS index,
LEFT ( LEFT (
DATE_SUB( DATE_SUB(
CURRENT_DATE, CURRENT_DATE,
INTERVAL @s MONTH INTERVAL @s MONTH
), ),
7 7
) AS `date` ) AS date
FROM FROM
mysql.help_topic, mysql.help_topic,
( (
...@@ -256,11 +256,11 @@ ...@@ -256,11 +256,11 @@
case when t.status = 2 then 1 else 0 end canelNum, case when t.status = 2 then 1 else 0 end canelNum,
case when t.status = 1 then 1 else 0 end finishNum case when t.status = 1 then 1 else 0 end finishNum
from ( from (
SELECT @a :=@a + 1 as `index`, DATE(ADDDATE(CURRENT_DATE, INTERVAL @a DAY)) AS `date` SELECT @a :=@a + 1 as index, DATE(ADDDATE(CURRENT_DATE, INTERVAL @a DAY)) AS date
FROM mysql.help_topic,(SELECT @a := 0) temp FROM mysql.help_topic,(SELECT @a := 0) temp
WHERE @a <![CDATA[<]]> DAY(LAST_DAY(CURRENT_DATE)) - DAY(CURRENT_DATE) WHERE @a <![CDATA[<]]> DAY(LAST_DAY(CURRENT_DATE)) - DAY(CURRENT_DATE)
UNION UNION
SELECT @s :=@s - 1 as `index`, DATE(DATE_SUB(CURRENT_DATE, INTERVAL @s DAY)) AS `date` SELECT @s :=@s - 1 as index, DATE(DATE_SUB(CURRENT_DATE, INTERVAL @s DAY)) AS date
FROM mysql.help_topic,(SELECT @s := day(CURRENT_DATE)) temp FROM mysql.help_topic,(SELECT @s := day(CURRENT_DATE)) temp
WHERE @s > 0 WHERE @s > 0
) date LEFT JOIN p_task t on date.date = DATE_FORMAT(t.publish_time,'%Y%m%d') and t.org_code = #{orgCode} ) date LEFT JOIN p_task t on date.date = DATE_FORMAT(t.publish_time,'%Y%m%d') and t.org_code = #{orgCode}
...@@ -330,15 +330,15 @@ ...@@ -330,15 +330,15 @@
SELECT SELECT
pt.id taskID, pt.id taskID,
pt.title taskName, pt.title taskName,
pt.`status`, pt.status,
pt.publisher_name arranger, pt.publisher_name arranger,
pt.executor, pt.executor,
pt.finish_time AS planTime, pt.finish_time AS planTime,
pt.fact_finish_time AS fishTime, pt.fact_finish_time AS fishTime,
pt.remark AS content, pt.remark AS content,
ptd.point_id AS pointId, ptd.point_id AS pointId,
pp.`name` pointName, pp.name pointName,
pii.`name` AS inputItemName, pii.name AS inputItemName,
pci.input_value AS inputValue, pci.input_value AS inputValue,
pci.is_ok AS inputStatus pci.is_ok AS inputStatus
FROM FROM
...@@ -362,25 +362,25 @@ ...@@ -362,25 +362,25 @@
( (
SELECT SELECT
t.id, t.id,
CASE t.`status` CASE t.status
WHEN 0 THEN WHEN 0 THEN
1 1
ELSE ELSE
0 0
END proccesed, END proccesed,
CASE t.`status` CASE t.status
WHEN 1 THEN WHEN 1 THEN
1 1
ELSE ELSE
0 0
END finished, END finished,
CASE t.`status` CASE t.status
WHEN 2 THEN WHEN 2 THEN
1 1
ELSE ELSE
0 0
END cancel, END cancel,
CASE t.`status` CASE t.status
WHEN 3 THEN WHEN 3 THEN
1 1
ELSE ELSE
...@@ -464,7 +464,7 @@ ...@@ -464,7 +464,7 @@
r.NAME routeName, r.NAME routeName,
</when > </when >
<when test=" statisticsTyle == 3 "> <when test=" statisticsTyle == 3 ">
pt.`name` pointName, pt.name pointName,
</when > </when >
<when test=" statisticsTyle == 4 "> <when test=" statisticsTyle == 4 ">
d.department_name departmentName, d.department_name departmentName,
...@@ -473,25 +473,25 @@ ...@@ -473,25 +473,25 @@
pn.NAME planName, pn.NAME planName,
</when > </when >
</choose> </choose>
CASE t.`status` CASE t.status
WHEN 0 THEN WHEN 0 THEN
1 1
ELSE ELSE
0 0
END proccesed, END proccesed,
CASE t.`status` CASE t.status
WHEN 1 THEN WHEN 1 THEN
1 1
ELSE ELSE
0 0
END finished, END finished,
CASE t.`status` CASE t.status
WHEN 2 THEN WHEN 2 THEN
1 1
ELSE ELSE
0 0
END cancel, END cancel,
CASE t.`status` CASE t.status
WHEN 3 THEN WHEN 3 THEN
1 1
ELSE ELSE
...@@ -639,7 +639,7 @@ ...@@ -639,7 +639,7 @@
r.NAME routeName, r.NAME routeName,
</when> </when>
<when test=" statisticsTyle == 3 "> <when test=" statisticsTyle == 3 ">
pt.`name` pointName, pt.name pointName,
</when> </when>
<when test=" statisticsTyle == 4 "> <when test=" statisticsTyle == 4 ">
t.dep_id departmentName, t.dep_id departmentName,
...@@ -648,25 +648,25 @@ ...@@ -648,25 +648,25 @@
pn.NAME planName, pn.NAME planName,
</when> </when>
</choose> </choose>
CASE t.`status` CASE t.status
WHEN 0 THEN WHEN 0 THEN
1 1
ELSE ELSE
0 0
END proccesed, END proccesed,
CASE t.`status` CASE t.status
WHEN 1 THEN WHEN 1 THEN
1 1
ELSE ELSE
0 0
END finished, END finished,
CASE t.`status` CASE t.status
WHEN 2 THEN WHEN 2 THEN
1 1
ELSE ELSE
0 0
END cancel, END cancel,
CASE t.`status` CASE t.status
WHEN 3 THEN WHEN 3 THEN
1 1
ELSE ELSE
...@@ -785,8 +785,8 @@ ...@@ -785,8 +785,8 @@
td. STATUS, td. STATUS,
td.remark, td.remark,
td.point_id pointId, td.point_id pointId,
CASE WHEN pci.point_classify_name is NULL THEN ii.`name` CASE WHEN pci.point_classify_name is NULL THEN ii.name
ELSE CONCAT(pci.point_classify_name,'-',ii.`name`) ELSE CONCAT(pci.point_classify_name,'-',ii.name)
END itemName, END itemName,
t. NAME pointName, t. NAME pointName,
t.point_no pointNo, t.point_no pointNo,
......
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
<select id="getTaskMsgBos" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.TaskMsgBo"> <select id="getTaskMsgBos" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.TaskMsgBo">
SELECT SELECT
pt.id taskId, pt.id taskId,
pt.`status`, pt.status,
<![CDATA[ <![CDATA[
CONCAT( CONCAT(
'您好,您有一条名称为:', '您好,您有一条名称为:',
...@@ -205,11 +205,11 @@ ...@@ -205,11 +205,11 @@
SELECT SELECT
COUNT(1) AS total COUNT(1) AS total
FROM FROM
`p_msg` m p_msg m
<where> <where>
<if test="orgCode!=null"> and (org_Code like concat (#{orgCode},"-%")or org_Code= #{orgCode})</if> <if test="orgCode!=null"> and (org_Code like concat (#{orgCode},"-%")or org_Code= #{orgCode})</if>
<if test="userId != null">AND m.user_id = #{userId}</if> <if test="userId != null">AND m.user_id = #{userId}</if>
<if test="userName != null and userName != '' ">AND m.`reciver_name` LIKE concat('%', #{userName}, '%')</if> <if test="userName != null and userName != '' ">AND m.reciver_name LIKE concat('%', #{userName}, '%')</if>
<if test="msgType != null">AND m.msg_type = #{msgType}</if> <if test="msgType != null">AND m.msg_type = #{msgType}</if>
<if test="beginDate != null and beginDate != '' ">AND m.create_date <![CDATA[>=]]> #{beginDate}</if> <if test="beginDate != null and beginDate != '' ">AND m.create_date <![CDATA[>=]]> #{beginDate}</if>
<if test="endDate != null and endDate != '' ">AND m.create_date <![CDATA[<=]]> #{endDate}</if> <if test="endDate != null and endDate != '' ">AND m.create_date <![CDATA[<=]]> #{endDate}</if>
...@@ -221,7 +221,7 @@ ...@@ -221,7 +221,7 @@
<select id="getMsgVoData" resultType="com.yeejoin.amos.patrol.business.vo.MsgVo"> <select id="getMsgVoData" resultType="com.yeejoin.amos.patrol.business.vo.MsgVo">
SELECT SELECT
m.id, m.id,
m.`reciver_name` AS userName, m.reciver_name AS userName,
m.body AS msgBody, m.body AS msgBody,
m.msg_type AS msgType, m.msg_type AS msgType,
m.send_time AS sendTime, m.send_time AS sendTime,
...@@ -233,11 +233,11 @@ ...@@ -233,11 +233,11 @@
END AS isImmediately, END AS isImmediately,
m.fixed_time AS fixedTime m.fixed_time AS fixedTime
FROM FROM
`p_msg` m p_msg m
<where> <where>
<if test="orgCode!=null"> and (org_Code like concat (#{orgCode},"-%")or org_Code= #{orgCode})</if> <if test="orgCode!=null"> and (org_Code like concat (#{orgCode},"-%")or org_Code= #{orgCode})</if>
<if test="userId != null">AND m.user_id = #{userId}</if> <if test="userId != null">AND m.user_id = #{userId}</if>
<if test="userName != null and userName != '' ">AND m.`reciver_name` LIKE concat('%', #{userName}, '%')</if> <if test="userName != null and userName != '' ">AND m.reciver_name LIKE concat('%', #{userName}, '%')</if>
<if test="msgType != null">AND m.msg_type = #{msgType}</if> <if test="msgType != null">AND m.msg_type = #{msgType}</if>
<if test="beginDate != null and beginDate != '' ">AND m.create_date <![CDATA[>=]]> #{beginDate}</if> <if test="beginDate != null and beginDate != '' ">AND m.create_date <![CDATA[>=]]> #{beginDate}</if>
<if test="endDate != null and endDate != '' ">AND m.create_date <![CDATA[<=]]> #{endDate}</if> <if test="endDate != null and endDate != '' ">AND m.create_date <![CDATA[<=]]> #{endDate}</if>
...@@ -266,10 +266,10 @@ ...@@ -266,10 +266,10 @@
pms.msg_type msgType, pms.msg_type msgType,
pms.attribute1, pms.attribute1,
pms.attribute2 pms.attribute2
<!-- su.`name`, <!-- su.name,
su.user_name username --> su.user_name username -->
FROM FROM
`p_msg_subscribe` pms p_msg_subscribe pms
<!-- LEFT JOIN s_user su ON su.id = pms.user_id --> <!-- LEFT JOIN s_user su ON su.id = pms.user_id -->
WHERE WHERE
...@@ -292,9 +292,9 @@ ...@@ -292,9 +292,9 @@
<![CDATA[ <![CDATA[
CONCAT( CONCAT(
'您好,巡检工作即将开始!<br />计划名称:', '您好,巡检工作即将开始!<br />计划名称:',
pp.`name`, pp.name,
' <br />巡检路线:', ' <br />巡检路线:',
pr.`name`, pr.name,
' <br />开始时间:', ' <br />开始时间:',
ppt.begin_time, ppt.begin_time,
' <br />结束时间:', ' <br />结束时间:',
...@@ -302,9 +302,9 @@ ...@@ -302,9 +302,9 @@
]]> ]]>
CONCAT( CONCAT(
'您好,巡检工作即将开始!计划名称:', '您好,巡检工作即将开始!计划名称:',
pp.`name`, pp.name,
' 巡检路线:', ' 巡检路线:',
pr.`name`, pr.name,
' 开始时间:', ' 开始时间:',
ppt.begin_time, ppt.begin_time,
' 结束时间:', ' 结束时间:',
...@@ -329,9 +329,9 @@ ...@@ -329,9 +329,9 @@
<![CDATA[ <![CDATA[
CONCAT( CONCAT(
'您好,巡检工作未按计划开始!<br />计划名称:', '您好,巡检工作未按计划开始!<br />计划名称:',
pp.`name`, pp.name,
' <br />巡检路线:', ' <br />巡检路线:',
pr.`name`, pr.name,
' <br />开始时间:', ' <br />开始时间:',
ppt.begin_time, ppt.begin_time,
' <br />结束时间:', ' <br />结束时间:',
...@@ -340,9 +340,9 @@ ...@@ -340,9 +340,9 @@
]]> ]]>
CONCAT( CONCAT(
'您好,巡检工作未按计划开始!计划名称:', '您好,巡检工作未按计划开始!计划名称:',
pp.`name`, pp.name,
'; 巡检路线:', '; 巡检路线:',
pr.`name`, pr.name,
'; 开始时间:', '; 开始时间:',
ppt.begin_time, ppt.begin_time,
'; 结束时间:', '; 结束时间:',
...@@ -367,11 +367,11 @@ ...@@ -367,11 +367,11 @@
<![CDATA[ <![CDATA[
CONCAT( CONCAT(
'您好,巡检工作已结束!<br />以下地点尚未巡检:', '您好,巡检工作已结束!<br />以下地点尚未巡检:',
GROUP_CONCAT(p.`name`), GROUP_CONCAT(p.name),
'<br />计划名称:', '<br />计划名称:',
pp.`name`, pp.name,
' <br />巡检路线:', ' <br />巡检路线:',
pr.`name`, pr.name,
' <br />开始时间:', ' <br />开始时间:',
ppt.begin_time, ppt.begin_time,
' <br />结束时间:', ' <br />结束时间:',
...@@ -380,11 +380,11 @@ ...@@ -380,11 +380,11 @@
]]> ]]>
CONCAT( CONCAT(
'您好,巡检工作已结束!以下地点尚未巡检:', '您好,巡检工作已结束!以下地点尚未巡检:',
GROUP_CONCAT(p.`name`), GROUP_CONCAT(p.name),
';计划名称:', ';计划名称:',
pp.`name`, pp.name,
'; 巡检路线:', '; 巡检路线:',
pr.`name`, pr.name,
'; 开始时间:', '; 开始时间:',
ppt.begin_time, ppt.begin_time,
'; 结束时间:', '; 结束时间:',
...@@ -416,7 +416,7 @@ ...@@ -416,7 +416,7 @@
SELECT SELECT
point_id point_id
FROM FROM
`p_check` p_check
WHERE WHERE
id = #{checkId} id = #{checkId}
) t ) t
...@@ -434,7 +434,7 @@ ...@@ -434,7 +434,7 @@
SELECT SELECT
point_id point_id
FROM FROM
`p_check` p_check
WHERE WHERE
id = #{checkId} id = #{checkId}
) t ) t
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</select> </select>
<select id="getPointClassInputItemById" resultType="com.yeejoin.amos.patrol.business.vo.PointInputItemVo"> <select id="getPointClassInputItemById" resultType="com.yeejoin.amos.patrol.business.vo.PointInputItemVo">
SELECT SELECT
pc.`name` classifyNames, pc.name classifyNames,
pc.id classifyIds, pc.id classifyIds,
pi.order_no pOrderNo, pi.order_no pOrderNo,
pi.id AS pointItemId, pi.id AS pointItemId,
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
p_point_inputitem pi p_point_inputitem pi
LEFT JOIN p_input_item ii ON ii.id = pi.input_item_id LEFT JOIN p_input_item ii ON ii.id = pi.input_item_id
LEFT JOIN p_point_classify pc ON FIND_IN_SET(pc.id, pi.classify_ids) > 0 LEFT JOIN p_point_classify pc ON FIND_IN_SET(pc.id, pi.classify_ids) > 0
LEFT JOIN p_route_point prp ON prp.point_id = pi.point_id LEFT JOIN p_route_point prp ON prp.point_id = pi.point_id
WHERE WHERE
pi.point_id = #{pointId} pi.point_id = #{pointId}
...@@ -411,10 +411,10 @@ ...@@ -411,10 +411,10 @@
SELECT SELECT
ppi.order_no pOrderNo, ppi.order_no pOrderNo,
ppi.id pointItemId, ppi.id pointItemId,
ppc.`name` classifyNames, ppc.name classifyNames,
ppc.id classifyIds, ppc.id classifyIds,
pii.id, pii.id,
pii.`name`, pii.name,
pii.risk_desc riskDesc, pii.risk_desc riskDesc,
pii.order_no orderNo, pii.order_no orderNo,
pii.item_type itemType, pii.item_type itemType,
...@@ -430,13 +430,13 @@ ...@@ -430,13 +430,13 @@
pii.create_by createBy, pii.create_by createBy,
pii.create_date createDate, pii.create_date createDate,
pii.is_delete isDelete, pii.is_delete isDelete,
pii.`level`, pii.level,
pii.item_no itemNo, pii.item_no itemNo,
pii.original_id originalId, pii.original_id originalId,
pii.basis_json basisJson, pii.basis_json basisJson,
pii.org_code orgCode pii.org_code orgCode
FROM FROM
`p_point_inputitem` ppi p_point_inputitem ppi
LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id
LEFT JOIN p_point_classify ppc ON FIND_IN_SET(ppc.id, ppi.classify_ids) > 0 LEFT JOIN p_point_classify ppc ON FIND_IN_SET(ppc.id, ppi.classify_ids) > 0
WHERE WHERE
...@@ -450,13 +450,13 @@ ...@@ -450,13 +450,13 @@
SELECT SELECT
ppc.id, ppc.id,
ppc.point_id pointId, ppc.point_id pointId,
ppc.`name`, ppc.name,
ppc.order_no orderNo, ppc.order_no orderNo,
ppc.equipment_id equipmentId, ppc.equipment_id equipmentId,
ppc.code, ppc.code,
ppc.data_source_code dataSourceCode ppc.data_source_code dataSourceCode
FROM FROM
`p_route_point_item` prpi p_route_point_item prpi
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id
LEFT JOIN p_point_classify ppc ON ppc.id = prpi.point_classify_id LEFT JOIN p_point_classify ppc ON ppc.id = prpi.point_classify_id
WHERE WHERE
...@@ -465,7 +465,7 @@ ...@@ -465,7 +465,7 @@
GROUP BY GROUP BY
ppc.id, ppc.id,
ppc.point_id, ppc.point_id,
ppc.`name`, ppc.name,
ppc.order_no ppc.order_no
</select> </select>
...@@ -498,49 +498,49 @@ ...@@ -498,49 +498,49 @@
SELECT SELECT
IFNULL( count( * ), 0 ) IFNULL( count( * ), 0 )
FROM FROM
`p_check` p_check
WHERE WHERE
check_time LIKE CONCAT( DATE_FORMAT( now( ), '%Y-%m-%d' ), '%' ) check_time LIKE CONCAT( DATE_FORMAT( now( ), '%Y-%m-%d' ), '%' )
<if test="orgCode!=null"> <if test="orgCode!=null">
and (org_code LIKE CONCAT('%',#{orgCode},'%' )) and (org_code LIKE CONCAT('%',#{orgCode},'%' ))
</if> </if>
AND is_ok = 1 AND is_ok = 1
) AS `over_num`, ) AS over_num,
( (
SELECT SELECT
IFNULL( count( * ), 0 ) IFNULL( count( * ), 0 )
FROM FROM
`p_check` p_check
WHERE WHERE
check_time LIKE CONCAT( DATE_FORMAT( now( ), '%Y-%m-%d' ), '%' ) check_time LIKE CONCAT( DATE_FORMAT( now( ), '%Y-%m-%d' ), '%' )
<if test="orgCode!=null"> <if test="orgCode!=null">
and (org_code LIKE CONCAT('%',#{orgCode},'%' )) and (org_code LIKE CONCAT('%',#{orgCode},'%' ))
</if> </if>
AND is_ok = 2 AND is_ok = 2
) AS `unfinish_num`, ) AS unfinish_num,
( (
SELECT SELECT
IFNULL( count( * ), 0 ) IFNULL( count( * ), 0 )
FROM FROM
`p_check` p_check
WHERE WHERE
check_time LIKE CONCAT( DATE_FORMAT( now( ), '%Y-%m-%d' ), '%' ) check_time LIKE CONCAT( DATE_FORMAT( now( ), '%Y-%m-%d' ), '%' )
<if test="orgCode!=null"> <if test="orgCode!=null">
and (org_code LIKE CONCAT('%',#{orgCode},'%' )) and (org_code LIKE CONCAT('%',#{orgCode},'%' ))
</if> </if>
AND is_ok = 3 AND is_ok = 3
) AS `miss_num`, ) AS miss_num,
( (
SELECT SELECT
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) ifnull( sum( p_plan_task.point_num ), 0 )
FROM FROM
`p_plan_task` p_plan_task
WHERE WHERE
( `p_plan_task`.`check_date` LIKE concat( curdate( ), '%' ) ) ( p_plan_task.check_date LIKE concat( curdate( ), '%' ) )
<if test="orgCode!=null"> <if test="orgCode!=null">
and (org_code LIKE CONCAT('%',#{orgCode},'%' )) and (org_code LIKE CONCAT('%',#{orgCode},'%' ))
</if> </if>
) AS `today_num` ) AS today_num
</select> </select>
<!-- 巡检点统计 --> <!-- 巡检点统计 -->
<select id="getSumPtForDept" resultType="java.util.HashMap"> <select id="getSumPtForDept" resultType="java.util.HashMap">
...@@ -807,25 +807,25 @@ ...@@ -807,25 +807,25 @@
( (
SELECT SELECT
pt.id, pt.id,
CASE pt.`status` CASE pt.status
WHEN '1' THEN WHEN '1' THEN
1 1
ELSE ELSE
0 0
END QUALIFIED, END QUALIFIED,
CASE pt.`status` CASE pt.status
WHEN '0' THEN WHEN '0' THEN
1 1
ELSE ELSE
0 0
END UNPLAN, END UNPLAN,
CASE pt.`status` CASE pt.status
WHEN '2' THEN WHEN '2' THEN
1 1
ELSE ELSE
0 0
END UNQUALIFIED, END UNQUALIFIED,
CASE pt.`status` CASE pt.status
WHEN '3' THEN WHEN '3' THEN
1 1
ELSE ELSE
...@@ -856,25 +856,25 @@ ...@@ -856,25 +856,25 @@
pt.id, pt.id,
pt.charge_dept_id, pt.charge_dept_id,
case when pt.charge_dept_id = ''|| pt.charge_dept_id is null then '其他' else pt.charge_dept_id end department_name, case when pt.charge_dept_id = ''|| pt.charge_dept_id is null then '其他' else pt.charge_dept_id end department_name,
CASE pt.`status` CASE pt.status
WHEN '1' THEN WHEN '1' THEN
1 1
ELSE ELSE
0 0
END QUALIFIED, END QUALIFIED,
CASE pt.`status` CASE pt.status
WHEN '0' THEN WHEN '0' THEN
1 1
ELSE ELSE
0 0
END UNPLAN, END UNPLAN,
CASE pt.`status` CASE pt.status
WHEN '2' THEN WHEN '2' THEN
1 1
ELSE ELSE
0 0
END UNQUALIFIED, END UNQUALIFIED,
CASE pt.`status` CASE pt.status
WHEN '3' THEN WHEN '3' THEN
1 1
ELSE ELSE
...@@ -902,12 +902,12 @@ ...@@ -902,12 +902,12 @@
pp.id pointId, pp.id pointId,
pp.floor, pp.floor,
pp.is_indoor isIndoor, pp.is_indoor isIndoor,
pp.`name` pointName, pp.name pointName,
pp.coordinates, pp.coordinates,
pp.`level` pointLevel, pp.level pointLevel,
pp.`status`, pp.status,
pp.address, pp.address,
ppl.`name` pplName, ppl.name pplName,
ppl.user_id userName, ppl.user_id userName,
ppl.user_id userId, ppl.user_id userId,
pp.org_code orgCode, pp.org_code orgCode,
...@@ -972,7 +972,7 @@ ...@@ -972,7 +972,7 @@
<select id="queryLeavelPoint" resultMap="leavelPoint"> <select id="queryLeavelPoint" resultMap="leavelPoint">
SELECT SELECT
p.id, p.id,
p.`status`, p.status,
p.offline, p.offline,
p.NAME pointName, p.NAME pointName,
point_no pointNo, point_no pointNo,
...@@ -993,14 +993,14 @@ ...@@ -993,14 +993,14 @@
WHERE p.is_delete = 0 WHERE p.is_delete = 0
AND p.offline = 1 AND p.offline = 1
AND ( select COUNT(p_point_inputitem.id) FROM p_point_inputitem where p_point_inputitem.point_id =p.id) >0 AND ( select COUNT(p_point_inputitem.id) FROM p_point_inputitem where p_point_inputitem.point_id =p.id) >0
<if test="orgCode != null and orgCode != ''">AND p.biz_org_code LIKE concat("%", #{orgCode}, "%")</if> <if test="orgCode != null and orgCode != ''">AND p.biz_org_code LIKE concat('%', #{orgCode}, '%')</if>
<!-- <if test="startTime !=null and startTime != ''">AND p.last_update_time <![CDATA[>= ]]> STR_TO_DATE(#{startTime}, '%Y-%m-%d')</if>--> <!-- <if test="startTime !=null and startTime != ''">AND p.last_update_time <![CDATA[>= ]]> STR_TO_DATE(#{startTime}, '%Y-%m-%d')</if>-->
</select> </select>
<select id="getPoints" resultType="Map"> <select id="getPoints" resultType="Map">
SELECT SELECT
p.point_no pointNo, p.point_no pointNo,
p.`name` pointName, p.name pointName,
CASE p.`status` CASE p.status
WHEN '0' THEN WHEN '0' THEN
'未纳入巡检' '未纳入巡检'
WHEN '1' THEN WHEN '1' THEN
...@@ -1010,7 +1010,7 @@ ...@@ -1010,7 +1010,7 @@
ELSE ELSE
'漏检' '漏检'
END status , END status ,
pct.`name` catalogName, pct.name catalogName,
p.address, p.address,
sd.department_name depName, sd.department_name depName,
su. NAME username, su. NAME username,
...@@ -1042,7 +1042,7 @@ ...@@ -1042,7 +1042,7 @@
<select id="getPointConfigDom" resultMap="pointConfigResultMap"> <select id="getPointConfigDom" resultMap="pointConfigResultMap">
SELECT SELECT
p.id pointId, p.id pointId,
p.`status` status, p.status status,
p.NAME pointName, p.NAME pointName,
p.point_no pointNo, p.point_no pointNo,
p.is_fixed isFixed, p.is_fixed isFixed,
...@@ -1122,12 +1122,12 @@ ...@@ -1122,12 +1122,12 @@
SELECT SELECT
p.id, p.id,
p.point_no pointNo, p.point_no pointNo,
p.`name`, p.name,
p.is_fixed isFixed, p.is_fixed isFixed,
CONCAT(p.shot_min_number,'-',p.shot_max_number) shotNumber, CONCAT(p.shot_min_number,'-',p.shot_max_number) shotNumber,
p.route_name routeName, p.route_name routeName,
ppc.id classifyId, ppc.id classifyId,
ppc.`name` classifyName, ppc.name classifyName,
p.biz_org_name p.biz_org_name
FROM FROM
p_point p p_point p
...@@ -1138,10 +1138,10 @@ ...@@ -1138,10 +1138,10 @@
and p.biz_org_code like CONCAT(#{bizOrgCode},'%') and p.biz_org_code like CONCAT(#{bizOrgCode},'%')
</if> </if>
<if test="pointNo !=null and pointNo !=''"> <if test="pointNo !=null and pointNo !=''">
and p.point_no like concat(concat("%",#{pointNo}),"%") and p.point_no like concat(concat('%',#{pointNo}),'%')
</if> </if>
<if test="name !=null and name !=''"> <if test="name !=null and name !=''">
and p.name like concat(concat("%",#{name}),"%") and p.name like concat(concat('%',#{name}),'%')
</if> </if>
<if test="isFixed !=null and isFixed !=''"> <if test="isFixed !=null and isFixed !=''">
and p.is_fixed = #{isFixed} and p.is_fixed = #{isFixed}
...@@ -1167,12 +1167,12 @@ ...@@ -1167,12 +1167,12 @@
p_point p p_point p
where p.is_delete = 0 where p.is_delete = 0
<if test="orgCode!=null and orgCode !=''">and p.org_code= #{orgCode} </if> <if test="orgCode!=null and orgCode !=''">and p.org_code= #{orgCode} </if>
<if test="name!=null and name !=''">and p.name like concat(concat("%",#{name}),"%")</if> <if test="name!=null and name !=''">and p.name like concat(concat('%',#{name}),'%')</if>
<if test="code !=null and code !=''"> and p.point_no like concat(concat("%",#{code}),"%")</if> <if test="code !=null and code !=''"> and p.point_no like concat(concat('%',#{code}),'%')</if>
</select> </select>
<select id="queryAllPointConfig" resultType="java.util.Map"> <select id="queryAllPointConfig" resultType="java.util.Map">
SELECT SELECT
c.`name`, c.name,
c.point_code pointCode c.point_code pointCode
FROM FROM
p_point_config c, p_point_config c,
...@@ -1250,10 +1250,10 @@ ...@@ -1250,10 +1250,10 @@
</foreach> </foreach>
</if> </if>
<if test="name != null and name.length > 0"> <if test="name != null and name.length > 0">
AND pp.name LIKE concat("%", #{name}, "%") AND pp.name LIKE concat('%', #{name}, '%')
</if> </if>
<if test="pointNo != null and pointNo.length > 0"> <if test="pointNo != null and pointNo.length > 0">
AND pp.point_no LIKE concat("%", #{pointNo}, "%") AND pp.point_no LIKE concat('%', #{pointNo}, '%')
</if> </if>
<if test="nullRiskSourceId == true"> <if test="nullRiskSourceId == true">
AND ( pp.risk_source_id is NULL OR trim(pp.risk_source_id)='') AND ( pp.risk_source_id is NULL OR trim(pp.risk_source_id)='')
...@@ -1277,10 +1277,10 @@ ...@@ -1277,10 +1277,10 @@
</foreach> </foreach>
</if> </if>
<if test="name != null and name.length > 0"> <if test="name != null and name.length > 0">
AND pp.name LIKE concat("%", #{name}, "%") AND pp.name LIKE concat('%', #{name}, '%')
</if> </if>
<if test="pointNo != null and pointNo.length > 0"> <if test="pointNo != null and pointNo.length > 0">
AND pp.point_no LIKE concat("%", #{pointNo}, "%") AND pp.point_no LIKE concat('%', #{pointNo}, '%')
</if> </if>
<if test="nullRiskSourceId == true"> <if test="nullRiskSourceId == true">
AND ( pp.risk_source_id is NULL OR trim(pp.risk_source_id)='') AND ( pp.risk_source_id is NULL OR trim(pp.risk_source_id)='')
...@@ -1317,10 +1317,10 @@ ...@@ -1317,10 +1317,10 @@
</foreach> </foreach>
</if> </if>
<if test="name != null and name.length > 0"> <if test="name != null and name.length > 0">
AND pp.name LIKE concat("%", #{name}, "%") AND pp.name LIKE concat('%', #{name}, '%')
</if> </if>
<if test="pointNo != null and pointNo.length > 0"> <if test="pointNo != null and pointNo.length > 0">
AND pp.point_no LIKE concat("%", #{pointNo}, "%") AND pp.point_no LIKE concat('%', #{pointNo}, '%')
</if> </if>
<if test="nullRiskSourceId == true"> <if test="nullRiskSourceId == true">
AND ( pp.risk_source_id is NULL OR trim(pp.risk_source_id)='' ) AND ( pp.risk_source_id is NULL OR trim(pp.risk_source_id)='' )
...@@ -1351,10 +1351,10 @@ ...@@ -1351,10 +1351,10 @@
</foreach> </foreach>
</if> </if>
<if test="name != null and name.length > 0"> <if test="name != null and name.length > 0">
AND pp.name LIKE concat("%", #{name}, "%") AND pp.name LIKE concat('%', #{name}, '%')
</if> </if>
<if test="pointNo != null and pointNo.length > 0"> <if test="pointNo != null and pointNo.length > 0">
AND pp.point_no LIKE concat("%", #{pointNo}, "%") AND pp.point_no LIKE concat('%', #{pointNo}, '%')
</if> </if>
<if test="nullRiskSourceId == true"> <if test="nullRiskSourceId == true">
AND ( pp.risk_source_id is NULL OR trim(pp.risk_source_id)='' ) AND ( pp.risk_source_id is NULL OR trim(pp.risk_source_id)='' )
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
( (
SELECT SELECT
p.id AS pointId, p.id AS pointId,
p.`name` AS pointName p.name AS pointName
FROM FROM
p_point p p_point p
LEFT JOIN p_plan_task_detail ptd ON ptd.point_id = p.id LEFT JOIN p_plan_task_detail ptd ON ptd.point_id = p.id
...@@ -47,5 +47,5 @@ ...@@ -47,5 +47,5 @@
LEFT JOIN p_check c ON c.point_id = t1.pointId LEFT JOIN p_check c ON c.point_id = t1.pointId
GROUP BY t1.pointId; GROUP BY t1.pointId;
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.patrol.business.dao.mapper.RouteMapper"> <mapper namespace="com.yeejoin.amos.patrol.business.dao.mapper.RouteMapper">
<!-- 根据ID获取路线点的项信息 --> <!-- 根据ID获取路线点的项信息 -->
<select id="getInputItemById" resultType="com.yeejoin.amos.patrol.business.vo.PointInputItemVo"> <select id="getInputItemById" resultType="com.yeejoin.amos.patrol.business.vo.PointInputItemVo">
SELECT SELECT
ii.*, prpi.point_classify_id as 'classifyIds',prpi.id routePointItemId ii.*, prpi.point_classify_id as 'classifyIds',prpi.id routePointItemId
FROM FROM
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
prp.route_point_id = prpi.route_point_id prp.route_point_id = prpi.route_point_id
and !FIND_IN_SET(pii.id, ifnull(prp.exclude_items, 0)) and !FIND_IN_SET(pii.id, ifnull(prp.exclude_items, 0))
</select> </select>
<resultMap id="routePointInputItemMap" type="com.yeejoin.amos.patrol.dao.entity.PointInputItem"> <resultMap id="routePointInputItemMap" type="com.yeejoin.amos.patrol.dao.entity.PointInputItem">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="pointId" column="point_id" /> <result property="pointId" column="point_id" />
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
prp.route_point_id = prpi.route_point_id prp.route_point_id = prpi.route_point_id
) )
</select> </select>
<select id="getRouteNameByPointId" resultType="String"> <select id="getRouteNameByPointId" resultType="String">
SELECT SELECT
name name
...@@ -71,24 +71,24 @@ ...@@ -71,24 +71,24 @@
SELECT DISTINCT SELECT DISTINCT
route_id route_id
FROM FROM
`p_route_point` p_route_point
<where> <where>
<if test="pointId != null">point_id = #{pointId}</if> <if test="pointId != null">point_id = #{pointId}</if>
</where> </where>
); );
</select> </select>
<!--统计路线个数--> <!--统计路线个数-->
<select id="countRoute" resultType="long"> <select id="countRoute" resultType="long">
SELECT SELECT
COUNT(1) AS total_sum COUNT(1) AS total_sum
FROM FROM
`p_route` r p_route r
<!-- LEFT JOIN s_department d ON r.dept_id = d.id <!-- LEFT JOIN s_department d ON r.dept_id = d.id
LEFT JOIN s_user u ON r.user_id = u.id --> LEFT JOIN s_user u ON r.user_id = u.id -->
WHERE WHERE
r.is_delete = 0 r.is_delete = 0
<if test="name!=null">AND r.`name` LIKE CONCAT('%', #{name}, '%')</if> <if test="name!=null">AND r.name LIKE CONCAT('%', #{name}, '%')</if>
<if test="remark!=null">AND r.remark LIKE CONCAT('%', #{remark}, '%')</if> <if test="remark!=null">AND r.remark LIKE CONCAT('%', #{remark}, '%')</if>
<if test="orgCode!=null">AND r.org_Code = #{orgCode}</if> <if test="orgCode!=null">AND r.org_Code = #{orgCode}</if>
<if test="bizOrgCode!=null">AND r.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%') </if> <if test="bizOrgCode!=null">AND r.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%') </if>
...@@ -99,11 +99,11 @@ ...@@ -99,11 +99,11 @@
<when test="deptId == -1 " > AND r.dept_id in(0,-1)</when> <when test="deptId == -1 " > AND r.dept_id in(0,-1)</when>
</choose> </choose>
</select> </select>
<!--返回路线信息--> <!--返回路线信息-->
<select id="getRouteInfo" resultType="java.util.HashMap"> <select id="getRouteInfo" resultType="java.util.HashMap">
SELECT SELECT
r.`name`, r.name,
r.id, r.id,
r.boss, r.boss,
r.tel, r.tel,
...@@ -112,10 +112,10 @@ ...@@ -112,10 +112,10 @@
r.boss_name bossName, r.boss_name bossName,
ifnull(r.biz_org_code, "") as bizOrgCode ifnull(r.biz_org_code, "") as bizOrgCode
FROM FROM
`p_route` r p_route r
WHERE WHERE
r.is_delete = 0 r.is_delete = 0
<if test="name!=null">AND r.`name` LIKE CONCAT('%', #{name}, '%')</if> <if test="name!=null">AND r.name LIKE CONCAT('%', #{name}, '%')</if>
<if test="remark!=null">AND r.remark LIKE CONCAT('%', #{remark}, '%')</if> <if test="remark!=null">AND r.remark LIKE CONCAT('%', #{remark}, '%')</if>
<if test="orgCode!=null">AND r.org_Code = #{orgCode}</if> <if test="orgCode!=null">AND r.org_Code = #{orgCode}</if>
<if test="bizOrgCode!=null">AND r.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%') </if> <if test="bizOrgCode!=null">AND r.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%') </if>
...@@ -126,11 +126,11 @@ ...@@ -126,11 +126,11 @@
ORDER BY create_date DESC ORDER BY create_date DESC
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose> </choose>
</select> </select>
<delete id="deleteReleInputItem" > <delete id="deleteReleInputItem" >
delete b from p_point_inputitem a,p_route_point_item b where a.id = b.point_input_item_id and a.input_item_id in delete b from p_point_inputitem a,p_route_point_item b where a.id = b.point_input_item_id and a.input_item_id in
<foreach item="Id" collection="array" index="index" open="(" separator="," close=")"> <foreach item="Id" collection="array" index="index" open="(" separator="," close=")">
#{Id} #{Id}
</foreach> </foreach>
...@@ -141,14 +141,14 @@ ...@@ -141,14 +141,14 @@
SELECT SELECT
r.id, r.id,
r.`name` r.name
FROM FROM
p_plan ppl p_plan ppl
LEFT JOIN p_route r ON r.id = ppl.route_id LEFT JOIN p_route r ON r.id = ppl.route_id
WHERE WHERE
r.is_delete = 0 r.is_delete = 0
AND find_in_set(#{userId}, ppl.user_id) > 0 and r.org_code = #{orgCode} AND find_in_set(#{userId}, ppl.user_id) > 0 and r.org_code = #{orgCode}
</if> </if>
<if test="(orgCode != null and orgCode != '') or (deptId != null and deptId != '')"> <if test="(orgCode != null and orgCode != '') or (deptId != null and deptId != '')">
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
</if> </if>
SELECT SELECT
r.id, r.id,
r.`name` r.name
FROM FROM
p_route r p_route r
WHERE WHERE
...@@ -180,7 +180,7 @@ ...@@ -180,7 +180,7 @@
SELECT SELECT
r.id, r.id,
r.`name` r.name
FROM FROM
p_plan ppl p_plan ppl
LEFT JOIN p_route r ON r.id = ppl.route_id LEFT JOIN p_route r ON r.id = ppl.route_id
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
</if> </if>
SELECT SELECT
r.id, r.id,
r.`name` r.name
FROM FROM
p_route r p_route r
WHERE WHERE
...@@ -218,7 +218,7 @@ ...@@ -218,7 +218,7 @@
p_route_point rp p_route_point rp
LEFT JOIN p_point p ON p.id = rp.point_id LEFT JOIN p_point p ON p.id = rp.point_id
where p.is_delete = 0 where p.is_delete = 0
AND rp.route_id = #{routeId} AND rp.route_id = #{routeId}
AND p.org_code = #{orgCode} AND p.org_code = #{orgCode}
</select> </select>
<select id="queryRoutePoints" resultType="Map"> <select id="queryRoutePoints" resultType="Map">
...@@ -260,10 +260,10 @@ ...@@ -260,10 +260,10 @@
<if test="name != null and name != ''">and p.name like CONCAT('%', #{name}, '%')</if> <if test="name != null and name != ''">and p.name like CONCAT('%', #{name}, '%')</if>
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose> </choose>
</select> </select>
<resultMap id="routePointMap" type="com.yeejoin.amos.patrol.core.common.response.RoutePointRespone"> <resultMap id="routePointMap" type="com.yeejoin.amos.patrol.core.common.response.RoutePointRespone">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="pointNo" column="pointNo" /> <result property="pointNo" column="pointNo" />
...@@ -272,18 +272,18 @@ ...@@ -272,18 +272,18 @@
<result property="orderNo" column="orderNo" /> <result property="orderNo" column="orderNo" />
<result property="routeId" column="routeId" /> <result property="routeId" column="routeId" />
<result property="createDate" column="createDate" /> <result property="createDate" column="createDate" />
<collection property="pointClassifyList" ofType="com.yeejoin.amos.patrol.core.common.response.PointClassifysRespone" <collection property="pointClassifyList" ofType="com.yeejoin.amos.patrol.core.common.response.PointClassifysRespone"
column="{pointId=pointId}" select ="queryPointClassifyList"></collection> column="{pointId=pointId}" select ="queryPointClassifyList"></collection>
<collection property="routePointItem" ofType="com.yeejoin.amos.patrol.core.common.response.PointInputItemRespone" <collection property="routePointItem" ofType="com.yeejoin.amos.patrol.core.common.response.PointInputItemRespone"
column="{pointId=pointId,routeId=routeId,isBound = isBound}" select ="queryRoutePointItemByCondition"></collection> column="{pointId=pointId,routeId=routeId,isBound = isBound}" select ="queryRoutePointItemByCondition"></collection>
</resultMap> </resultMap>
<select id="queryPointClassifyList" resultType="com.yeejoin.amos.patrol.core.common.response.PointClassifysRespone"> <select id="queryPointClassifyList" resultType="com.yeejoin.amos.patrol.core.common.response.PointClassifysRespone">
SELECT id,name FROM p_point_classify WHERE point_id = #{pointId} SELECT id,name FROM p_point_classify WHERE point_id = #{pointId}
</select> </select>
<select id="queryRoutePointsByCondition" resultMap="routePointMap"> <select id="queryRoutePointsByCondition" resultMap="routePointMap">
SELECT SELECT
rp.id, rp.id,
rp.order_no orderNo, rp.order_no orderNo,
rp.create_date createDate, rp.create_date createDate,
...@@ -299,16 +299,16 @@ ...@@ -299,16 +299,16 @@
where p.is_delete = 0 where p.is_delete = 0
AND rp.route_id = #{routeId} AND rp.route_id = #{routeId}
AND p.org_code = #{orgCode} AND p.org_code = #{orgCode}
order by rp.order_no order by rp.order_no
<if test="pointNo != null and pointNo != ''">and p.point_no like CONCAT('%', #{pointNo}, '%')</if> <if test="pointNo != null and pointNo != ''">and p.point_no like CONCAT('%', #{pointNo}, '%')</if>
<if test="name != null and name != ''">and p.name like CONCAT('%', #{name}, '%')</if> <if test="name != null and name != ''">and p.name like CONCAT('%', #{name}, '%')</if>
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose> </choose>
</select> </select>
<select id="queryRoutePointItem" resultType="com.yeejoin.amos.patrol.dao.entity.RoutePointItem"> <select id="queryRoutePointItem" resultType="com.yeejoin.amos.patrol.dao.entity.RoutePointItem">
SELECT SELECT
rpi.* rpi.*
...@@ -324,23 +324,23 @@ ...@@ -324,23 +324,23 @@
AND rp.point_id = #{pointId} AND rp.point_id = #{pointId}
</if> </if>
<if test="inputItemId !=null and inputItemId !=''"> <if test="inputItemId !=null and inputItemId !=''">
AND ppi.input_item_id = #{inputItemId} AND ppi.input_item_id = #{inputItemId}
</if> </if>
<if test="pointClassifyId !=null and pointClassifyId !=''"> <if test="pointClassifyId !=null and pointClassifyId !=''">
AND rpi.point_classify_id = #{pointClassifyId} AND rpi.point_classify_id = #{pointClassifyId}
</if> </if>
</where> </where>
</select> </select>
<select id="getRouteInfoList" resultType="Map"> <select id="getRouteInfoList" resultType="Map">
SELECT SELECT
ppl.planId, ppl.planId,
IFNULL(ppl.user_id ,'') userId, IFNULL(ppl.user_id ,'') userId,
IFNULL(ppl.user_id,'') userName, IFNULL(ppl.user_id,'') userName,
IFNULL(ppl.org_code,'') orgCode, IFNULL(ppl.org_code,'') orgCode,
IFNULL(ppl.dept_id ,'')groupName, IFNULL(ppl.dept_id ,'')groupName,
pr.id routeId, pr.id routeId,
IFNULL( pr.`name`,'') routeName, IFNULL( pr.name,'') routeName,
pr.tel, pr.tel,
pr.is_delete isDelete, pr.is_delete isDelete,
IFNULL(pr.boss,'') boss, IFNULL(pr.boss,'') boss,
...@@ -375,18 +375,18 @@ ...@@ -375,18 +375,18 @@
WHERE WHERE
pr.id = #{routeId} pr.id = #{routeId}
</select> </select>
<select id="queryRoutePointItemByCondition" resultType="com.yeejoin.amos.patrol.core.common.response.PointInputItemRespone"> <select id="queryRoutePointItemByCondition" resultType="com.yeejoin.amos.patrol.core.common.response.PointInputItemRespone">
SELECT SELECT
CONCAT(ppi.id,(case WHEN ppc.id IS NULL THEN '' ELSE CONCAT('-',ppc.id) END)) tempId, CONCAT(ppi.id,(case WHEN ppc.id IS NULL THEN '' ELSE CONCAT('-',ppc.id) END)) tempId,
ppi.point_id pointId, ppi.point_id pointId,
ppi.order_no orderNo, ppi.order_no orderNo,
ppi.id pointInputItemId, ppi.id pointInputItemId,
pii.`name` inputName, pii.name inputName,
ppc.`name` classifyName, ppc.name classifyName,
ppc.id pointClassifyId, ppc.id pointClassifyId,
pii.`level`, pii.level,
pii.item_type itemType, pii.item_type itemType,
pii.is_must isMust, pii.is_must isMust,
pii.is_score isScore, pii.is_score isScore,
...@@ -420,22 +420,22 @@ ...@@ -420,22 +420,22 @@
WHERE WHERE
prp.route_id = #{routeId} prp.route_id = #{routeId}
) temp ON temp.pointInputItemId = ppi.id AND temp.pointId = ppi.point_id AND IFNULL(temp.pointClassifyId,0) = IFNULL(ppc.id,0) ) temp ON temp.pointInputItemId = ppi.id AND temp.pointId = ppi.point_id AND IFNULL(temp.pointClassifyId,0) = IFNULL(ppc.id,0)
WHERE WHERE
ppi.point_id = #{pointId} ppi.point_id = #{pointId}
<!-- <if test="level!=null and level !=''"> <!-- <if test="level!=null and level !=''">
and pii.`level` = #{level} and pii.level = #{level}
</if> --> </if> -->
<choose> <choose>
<when test="level!=null and level !='' and level > 0">and pii.`level` = #{level}</when> <when test="level!=null and level !='' and level > 0">and pii.level = #{level}</when>
<when test="level== -1"> and pii.`level` is null</when> <when test="level== -1"> and pii.level is null</when>
</choose> </choose>
<if test="classifyId!=null and classifyId !=''"> <if test="classifyId!=null and classifyId !=''">
and ppc.id = #{classifyId} and ppc.id = #{classifyId}
</if> </if>
<if test="inputName!=null and inputName !=''"> <if test="inputName!=null and inputName !=''">
and (pii.`name` like CONCAT('%', #{inputName}, '%') and (pii.name like CONCAT('%', #{inputName}, '%')
or pii.`item_no` like CONCAT('%', #{inputName}, '%')) or pii.item_no like CONCAT('%', #{inputName}, '%'))
</if> </if>
<if test="isBound!=null and isBound !=''"> <if test="isBound!=null and isBound !=''">
and temp.routePointItemId >0 and temp.routePointItemId >0
...@@ -443,7 +443,7 @@ ...@@ -443,7 +443,7 @@
ORDER BY ORDER BY
pii.id pii.id
</select> </select>
<select id="queryRoutesByOrgCode" resultType="com.yeejoin.amos.patrol.dao.entity.Route"> <select id="queryRoutesByOrgCode" resultType="com.yeejoin.amos.patrol.dao.entity.Route">
SELECT * FROM p_route r where r.is_delete = 0 and r.biz_org_code like CONCAT( #{orgCode}, '%') SELECT * FROM p_route r where r.is_delete = 0 and r.biz_org_code like CONCAT( #{orgCode}, '%')
</select> </select>
......
...@@ -60,8 +60,8 @@ ...@@ -60,8 +60,8 @@
</delete> </delete>
<insert id="insertRoutePointItem"> <insert id="insertRoutePointItem">
insert into `p_route_point_item` insert into p_route_point_item
(`id`, `route_point_id`, `order_no`, `point_input_item_id`, `creator_id`, `create_date`, `point_classify_id`, `basis_json`) (id, route_point_id, order_no, point_input_item_id, creator_id, create_date, point_classify_id, basis_json)
VALUES( VALUES(
#{id}, #{id},
#{routePointId}, #{routePointId},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment