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

feat(patrol): 兼容PostgreSQL

parent b51b18c5
......@@ -152,6 +152,11 @@
<version>15.8.0</version>
<classifier>jdk16</classifier>
</dependency>
<dependency>
<groupId>cn.com.vastdata</groupId>
<artifactId>vastbase-jdbc</artifactId>
<version>2.7v</version>
</dependency>
</dependencies>
</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
spring.security.user.name=admin
spring.security.user.password=a1234560
......@@ -20,10 +20,10 @@ ribbon.MaxAutoRetries = 1
xiy_amos_satety_business
spring.reactor.debug-agent.enabled=true
#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.username=root
spring.datasource.password=Yeejoin@2020
spring.datasource.driver-class-name = com.mysql.jdbc.Driver
spring.datasource.url=jdbc:vastbase://36.46.137.116:5432/tzs_amos_tzs_biz_init?currentSchema=business&allowMultiQueries=true
spring.datasource.username=admin
spring.datasource.password=Yeejoin@2023
spring.datasource.driver-class-name = cn.com.vastbase.Driver
spring.datasource.hikari.maxLifetime = 1765000
spring.datasource.hikari.maximum-pool-size = 10
spring.datasource.testWhileIdle = true
......@@ -37,7 +37,7 @@ security.appKey=studio_normalapp_3056965
#redis 配置
spring.redis.database=1
spring.redis.host=172.16.11.201
spring.redis.host=172.16.10.210
spring.redis.port=6379
spring.redis.password=yeejoin@2020
spring.redis.jedis.pool.max-active=200
......@@ -70,13 +70,13 @@ emq.patrol.sync.switch=true
params.work.flow.normalProcessDefinitionKey=normalHazardManagement
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
#websocket
params.remoteWebsocketUrl=http://172.16.11.201:8080/
params.remoteWebsocketUrl=http://172.16.10.210:8080/
#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
......@@ -87,12 +87,12 @@ linux.img.path = /
## emqx
emqx.clean-session=true
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.password=public
emqx.max-inflight=1000
file.url=http://172.16.11.201:9000/
file.url=http://172.16.10.210:9000/
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
......
......@@ -81,7 +81,7 @@
c.point_id,
c.point_name,
c.check_time,
null AS `date`,
null AS date,
c.plan_id,
c.plan_name,
c.route_id,
......@@ -91,11 +91,11 @@
c.dep_id,
c.dep_name,
es.id AS eq_id,
es.`name` eq_name,
es.`code` eq_code,
es.name eq_name,
es.code eq_code,
(
SELECT
GROUP_CONCAT(ffs.`name`)
GROUP_CONCAT(ffs.name)
FROM
f_fire_fighting_system ffs
WHERE
......@@ -103,11 +103,11 @@
) AS system_name,
CONCAT(pt.id, '') AS plan_task_id,
pt.end_time AS plan_completion_time,
cou.`code` AS company_code,
cou.code AS company_code,
es.equipment_code AS equipment_type_code,
pii.item_no AS input_code,
pp.point_no as pointCode,
wws.`code` as buildCode,
wws.code as buildCode,
wws.full_name as buildName
FROM
p_check_input ci
......@@ -124,15 +124,15 @@
o.biz_org_code bzOrgCode,
o.amos_org_id,
o.amos_org_code,
o.`code`
o.code
FROM
cb_org_usr o,
`idx_biz_station_info` s
idx_biz_station_info s
WHERE
o.biz_org_type = 'COMPANY'
and o.is_delete = 0
and o.`code` = s.`code`
) cou ON LOCATE(cou.bzOrgCode, ci.org_code) > 0 ]]>
and o.code = s.code
) cou ON ci.org_code LIKE concat('%', cou.bzOrgCode, '%') ]]>
<where>
<if test="id != null">
ci.id = #{id}
......
......@@ -549,11 +549,11 @@
pld.infer_other_things inferOtherThings,
pld.remark,
pp.plan_type planType,
pp.`name` planName,
pr.`name` routeName,
pp.name planName,
pr.name routeName,
pld.danger_type dangerType,
pc.check_time checkTimeDate,
pii.`name` checkContent,
pii.name checkContent,
pc.user_id checkUser,
pc.error checkResult,
pc.is_ok checkStatus,
......@@ -680,11 +680,11 @@
pld.danger_state dangerState,
pld.overtime_state overtimeState,
pp.plan_type planType,
pp.`name` planName,
pr.`name` routeName,
pp.name planName,
pr.name routeName,
pld.danger_type dangerType,
pc.check_time checkTimeDate,
pii.`name` checkContent,
pii.name checkContent,
pc.user_id checkUser,
pc.error checkResult,
pc.is_ok checkStatus,
......
......@@ -308,8 +308,8 @@
type = #{type}
and
department_id = #{departmentId}
and
(a.`status` in (5,6) or (a.`status` = 7 and DATEDIFF(a.update_date,CURDATE()) =0 ))
and
(a.status in (5,6) or (a.status = 7 and DATEDIFF(a.update_date,CURDATE()) =0 ))
and
violate_state != 1
</select>
......
......@@ -250,7 +250,7 @@
d.point_id,
d.task_no,
d.is_finish,
pp.`name` pointName
pp.name pointName
FROM
p_plan_task_detail d
LEFT JOIN p_point pp ON pp.id = d.point_id
......@@ -1078,7 +1078,7 @@
d.point_id,
d.task_no,
pt.plan_id,
pp.`name` planName,
pp.name planName,
d.is_finish
FROM
p_plan_task_detail d
......@@ -1356,7 +1356,7 @@
d.point_id,
d.task_no,
pr.id route_id,
pr.`name` routeName,
pr.name routeName,
d.is_finish
FROM
p_plan_task_detail d
......@@ -1493,7 +1493,7 @@ FROM
p_plan_task_detail pd
WHERE
pd.task_no = pt.id
AND pd.`status` != 1
AND pd.status != 1
)) notQualifiedPointCount,
sum(
CASE
......@@ -1634,7 +1634,7 @@ FROM
p_plan_task_detail pd
WHERE
pd.task_no = pt.id
AND pd.`status` != 1
AND pd.status != 1
)) notQualifiedPointCount,
sum(
CASE
......
......@@ -11,7 +11,7 @@
s_user b,
s_company d -->
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="orgCode!=null"> and a.org_Code like #{orgCode}</if>
</select>
......@@ -21,27 +21,27 @@
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
FROM
p_catalog_tree a
p_catalog_tree a
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="orgCode!=null"> and a.org_Code like #{orgCode}</if>
order by id desc
<choose>
<when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose>
</select>
<select id="countCatalognum" resultType="java.util.HashMap">
SELECT
a.id,a.name
FROM
p_catalog_tree a
p_catalog_tree a
WHERE 1=1
<if test="name!=null"> and a.name =#{name} </if>
</select>
</mapper>
\ No newline at end of file
......@@ -74,8 +74,8 @@
FROM
p_input_item a
where a.is_delete = '0' and a.input_type!='1'
<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="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="isScore!=null"> and a.is_Score = #{isScore}</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<!-- <if test="level!=null"> and a.level = #{level} </if> -->
......@@ -108,8 +108,8 @@
p_input_item a left join p_catalog_tree b on a.catalog_id = b.id
where a.is_delete = '0'
and a.input_type!='1'
<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="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="isScore!=null"> and a.is_Score = #{isScore}</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<!-- <if test="level!=null"> and a.level = #{level} </if> -->
......@@ -157,7 +157,7 @@
and item_type = #{itemType}
</if>
<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 test="equipmentType!=null and equipmentType.size()>0">
and equipment_type in
......@@ -235,8 +235,8 @@
FROM
p_input_item a
where a.is_delete = '0' and a.input_type!='1'
<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="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="isScore!=null"> and a.is_Score = #{isScore}</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<if test="orgCode!=null"> and a.org_Code = #{orgCode}</if>
......@@ -315,8 +315,8 @@
p_input_item a left join p_catalog_tree b on a.catalog_id = b.id
where a.is_delete = '0'
and a.input_type!='1'
<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="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="isScore!=null"> and a.is_Score = #{isScore}</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<if test="orgCode!=null"> and a.org_Code = #{orgCode}</if>
......@@ -414,8 +414,8 @@
p_input_item a left join p_catalog_tree b on a.catalog_id = b.id
where a.is_delete = '0'
and a.input_type!='1'
<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="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="isScore!=null"> and a.is_Score = #{isScore}</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<if test="orgCode!=null"> and a.org_Code = #{orgCode}</if>
......@@ -516,7 +516,7 @@
</select>
<select id="getAllCategoryName" resultType="java.util.Map">
select code, `name` from wl_equipment_category
select code, name from wl_equipment_category
</select>
<delete id="delPointInputItemById">
......
......@@ -5,95 +5,95 @@
<!-- 另存计划 -->
<insert id="saveAs" parameterType="String">
INSERT INTO p_plan (
`name`,
`dept_id`,
`org_code`,
`route_id`,
`plan_type`,
`is_fixed_date`,
`in_order`,
`plan_begin`,
`plan_end`,
`day_rate`,
`day_time`,
`day_interval`,
`day_interval_unit`,
`day_begin`,
`day_end`,
`execute_interval`,
`month_type`,
`what_day`,
`what_week`,
`week_day`,
`duration`,
`user_id`,
`execute_rate`,
`week_begin_num`,
`week_end_num`,
`min_space`,
`is_score`,
`score_formula`,
`status`,
`error`,
`next_gen_date`,
`create_by`,
`create_date`,
`last_upd_by`,
`last_upd_time`,
`remark`,
`remark1`,
`remark2`,
`is_single_execution`,
`user_dept`
name,
dept_id,
org_code,
route_id,
plan_type,
is_fixed_date,
in_order,
plan_begin,
plan_end,
day_rate,
day_time,
day_interval,
day_interval_unit,
day_begin,
day_end,
execute_interval,
month_type,
what_day,
what_week,
week_day,
duration,
user_id,
execute_rate,
week_begin_num,
week_end_num,
min_space,
is_score,
score_formula,
status,
error,
next_gen_date,
create_by,
create_date,
last_upd_by,
last_upd_time,
remark,
remark1,
remark2,
is_single_execution,
user_dept
) SELECT
CONCAT(`name`, '复制'),
`dept_id`,
`org_code`,
`route_id`,
`plan_type`,
`is_fixed_date`,
`in_order`,
`plan_begin`,
`plan_end`,
`day_rate`,
`day_time`,
`day_interval`,
`day_interval_unit`,
`day_begin`,
`day_end`,
`execute_interval`,
`month_type`,
`what_day`,
`what_week`,
`week_day`,
`duration`,
`user_id`,
`execute_rate`,
`week_begin_num`,
`week_end_num`,
`min_space`,
`is_score`,
`score_formula`,
`status`,
`error`,
`next_gen_date`,
`create_by`,
`create_date`,
`last_upd_by`,
`last_upd_time`,
`remark`,
`remark1`,
`remark2`,
`is_single_execution`,
`user_dept`
CONCAT(name, '复制'),
dept_id,
org_code,
route_id,
plan_type,
is_fixed_date,
in_order,
plan_begin,
plan_end,
day_rate,
day_time,
day_interval,
day_interval_unit,
day_begin,
day_end,
execute_interval,
month_type,
what_day,
what_week,
week_day,
duration,
user_id,
execute_rate,
week_begin_num,
week_end_num,
min_space,
is_score,
score_formula,
status,
error,
next_gen_date,
create_by,
create_date,
last_upd_by,
last_upd_time,
remark,
remark1,
remark2,
is_single_execution,
user_dept
FROM
`p_plan`
p_plan
WHERE
id = #{id}
</insert>
<select id="getPlanByRouteId" resultType="com.yeejoin.amos.patrol.dao.entity.Plan">
SELECT * FROM `p_plan`
SELECT * FROM p_plan
<where>
is_delete = 0
<if test="routeId != null"> and route_id = #{routeId}</if>
......@@ -118,21 +118,21 @@
p_route b
WHERE
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="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="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="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 id="getPlanInfo" resultType="java.util.HashMap">
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
when 1 THEN '天'
when 2 THEN '周'
......@@ -150,13 +150,13 @@
p_route b
WHERE
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="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="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
<choose>
......@@ -176,25 +176,25 @@
p_route b
WHERE
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="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="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
</select>
<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>
<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 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>
</mapper>
\ No newline at end of file
......@@ -151,18 +151,18 @@
FROM
p_task a
<!-- <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="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="orgCode!=null"> and a.org_Code like #{orgCode}</if>
<if test="pointId!=null"> and a.point_id = #{pointId}</if>
</trim> -->
<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="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="orgCode!=null"> and a.org_Code = #{orgCode}</if>
<if test="deptId!=null"> and a.dep_id = #{deptId}</if>
......@@ -191,17 +191,17 @@
<!-- IFNULL(case when u.mobile = '' or u.mobile is null then null else u.mobile END,u.telephone) as telep,
--> a.remark,
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_point pp ON pp.id = ptd.point_id
WHERE ptd.task_id = a.id
GROUP BY pp.`name`) as pointItemName
GROUP BY pp.name) as pointItemName
from p_task a
<!-- LEFT JOIN s_user u on u.id = a.executor_id -->
<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="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="orgCode!=null"> and a.org_Code = #{orgCode}</if>
<if test="deptId!=null"> and a.dep_id = #{deptId}</if>
......@@ -224,14 +224,14 @@
FROM
(
SELECT
@s :=@s - 1 AS `index`,
@s :=@s - 1 AS index,
LEFT (
DATE_SUB(
CURRENT_DATE,
INTERVAL @s MONTH
),
7
) AS `date`
) AS date
FROM
mysql.help_topic,
(
......@@ -256,11 +256,11 @@
case when t.status = 2 then 1 else 0 end canelNum,
case when t.status = 1 then 1 else 0 end finishNum
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
WHERE @a <![CDATA[<]]> DAY(LAST_DAY(CURRENT_DATE)) - DAY(CURRENT_DATE)
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
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}
......@@ -330,15 +330,15 @@
SELECT
pt.id taskID,
pt.title taskName,
pt.`status`,
pt.status,
pt.publisher_name arranger,
pt.executor,
pt.finish_time AS planTime,
pt.fact_finish_time AS fishTime,
pt.remark AS content,
ptd.point_id AS pointId,
pp.`name` pointName,
pii.`name` AS inputItemName,
pp.name pointName,
pii.name AS inputItemName,
pci.input_value AS inputValue,
pci.is_ok AS inputStatus
FROM
......@@ -362,25 +362,25 @@
(
SELECT
t.id,
CASE t.`status`
CASE t.status
WHEN 0 THEN
1
ELSE
0
END proccesed,
CASE t.`status`
CASE t.status
WHEN 1 THEN
1
ELSE
0
END finished,
CASE t.`status`
CASE t.status
WHEN 2 THEN
1
ELSE
0
END cancel,
CASE t.`status`
CASE t.status
WHEN 3 THEN
1
ELSE
......@@ -464,7 +464,7 @@
r.NAME routeName,
</when >
<when test=" statisticsTyle == 3 ">
pt.`name` pointName,
pt.name pointName,
</when >
<when test=" statisticsTyle == 4 ">
d.department_name departmentName,
......@@ -473,25 +473,25 @@
pn.NAME planName,
</when >
</choose>
CASE t.`status`
CASE t.status
WHEN 0 THEN
1
ELSE
0
END proccesed,
CASE t.`status`
CASE t.status
WHEN 1 THEN
1
ELSE
0
END finished,
CASE t.`status`
CASE t.status
WHEN 2 THEN
1
ELSE
0
END cancel,
CASE t.`status`
CASE t.status
WHEN 3 THEN
1
ELSE
......@@ -639,7 +639,7 @@
r.NAME routeName,
</when>
<when test=" statisticsTyle == 3 ">
pt.`name` pointName,
pt.name pointName,
</when>
<when test=" statisticsTyle == 4 ">
t.dep_id departmentName,
......@@ -648,25 +648,25 @@
pn.NAME planName,
</when>
</choose>
CASE t.`status`
CASE t.status
WHEN 0 THEN
1
ELSE
0
END proccesed,
CASE t.`status`
CASE t.status
WHEN 1 THEN
1
ELSE
0
END finished,
CASE t.`status`
CASE t.status
WHEN 2 THEN
1
ELSE
0
END cancel,
CASE t.`status`
CASE t.status
WHEN 3 THEN
1
ELSE
......@@ -785,8 +785,8 @@
td. STATUS,
td.remark,
td.point_id pointId,
CASE WHEN pci.point_classify_name is NULL THEN ii.`name`
ELSE CONCAT(pci.point_classify_name,'-',ii.`name`)
CASE WHEN pci.point_classify_name is NULL THEN ii.name
ELSE CONCAT(pci.point_classify_name,'-',ii.name)
END itemName,
t. NAME pointName,
t.point_no pointNo,
......
......@@ -160,7 +160,7 @@
<select id="getTaskMsgBos" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.TaskMsgBo">
SELECT
pt.id taskId,
pt.`status`,
pt.status,
<![CDATA[
CONCAT(
'您好,您有一条名称为:',
......@@ -205,11 +205,11 @@
SELECT
COUNT(1) AS total
FROM
`p_msg` m
p_msg m
<where>
<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="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="beginDate != null and beginDate != '' ">AND m.create_date <![CDATA[>=]]> #{beginDate}</if>
<if test="endDate != null and endDate != '' ">AND m.create_date <![CDATA[<=]]> #{endDate}</if>
......@@ -221,7 +221,7 @@
<select id="getMsgVoData" resultType="com.yeejoin.amos.patrol.business.vo.MsgVo">
SELECT
m.id,
m.`reciver_name` AS userName,
m.reciver_name AS userName,
m.body AS msgBody,
m.msg_type AS msgType,
m.send_time AS sendTime,
......@@ -233,11 +233,11 @@
END AS isImmediately,
m.fixed_time AS fixedTime
FROM
`p_msg` m
p_msg m
<where>
<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="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="beginDate != null and beginDate != '' ">AND m.create_date <![CDATA[>=]]> #{beginDate}</if>
<if test="endDate != null and endDate != '' ">AND m.create_date <![CDATA[<=]]> #{endDate}</if>
......@@ -266,10 +266,10 @@
pms.msg_type msgType,
pms.attribute1,
pms.attribute2
<!-- su.`name`,
<!-- su.name,
su.user_name username -->
FROM
`p_msg_subscribe` pms
p_msg_subscribe pms
<!-- LEFT JOIN s_user su ON su.id = pms.user_id -->
WHERE
......@@ -292,9 +292,9 @@
<![CDATA[
CONCAT(
'您好,巡检工作即将开始!<br />计划名称:',
pp.`name`,
pp.name,
' <br />巡检路线:',
pr.`name`,
pr.name,
' <br />开始时间:',
ppt.begin_time,
' <br />结束时间:',
......@@ -302,9 +302,9 @@
]]>
CONCAT(
'您好,巡检工作即将开始!计划名称:',
pp.`name`,
pp.name,
' 巡检路线:',
pr.`name`,
pr.name,
' 开始时间:',
ppt.begin_time,
' 结束时间:',
......@@ -329,9 +329,9 @@
<![CDATA[
CONCAT(
'您好,巡检工作未按计划开始!<br />计划名称:',
pp.`name`,
pp.name,
' <br />巡检路线:',
pr.`name`,
pr.name,
' <br />开始时间:',
ppt.begin_time,
' <br />结束时间:',
......@@ -340,9 +340,9 @@
]]>
CONCAT(
'您好,巡检工作未按计划开始!计划名称:',
pp.`name`,
pp.name,
'; 巡检路线:',
pr.`name`,
pr.name,
'; 开始时间:',
ppt.begin_time,
'; 结束时间:',
......@@ -367,11 +367,11 @@
<![CDATA[
CONCAT(
'您好,巡检工作已结束!<br />以下地点尚未巡检:',
GROUP_CONCAT(p.`name`),
GROUP_CONCAT(p.name),
'<br />计划名称:',
pp.`name`,
pp.name,
' <br />巡检路线:',
pr.`name`,
pr.name,
' <br />开始时间:',
ppt.begin_time,
' <br />结束时间:',
......@@ -380,11 +380,11 @@
]]>
CONCAT(
'您好,巡检工作已结束!以下地点尚未巡检:',
GROUP_CONCAT(p.`name`),
GROUP_CONCAT(p.name),
';计划名称:',
pp.`name`,
pp.name,
'; 巡检路线:',
pr.`name`,
pr.name,
'; 开始时间:',
ppt.begin_time,
'; 结束时间:',
......@@ -416,7 +416,7 @@
SELECT
point_id
FROM
`p_check`
p_check
WHERE
id = #{checkId}
) t
......@@ -434,7 +434,7 @@
SELECT
point_id
FROM
`p_check`
p_check
WHERE
id = #{checkId}
) t
......
......@@ -62,7 +62,7 @@
</select>
<select id="getPointClassInputItemById" resultType="com.yeejoin.amos.patrol.business.vo.PointInputItemVo">
SELECT
pc.`name` classifyNames,
pc.name classifyNames,
pc.id classifyIds,
pi.order_no pOrderNo,
pi.id AS pointItemId,
......@@ -71,7 +71,7 @@
p_point_inputitem pi
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_route_point prp ON prp.point_id = pi.point_id
WHERE
pi.point_id = #{pointId}
......@@ -411,10 +411,10 @@
SELECT
ppi.order_no pOrderNo,
ppi.id pointItemId,
ppc.`name` classifyNames,
ppc.name classifyNames,
ppc.id classifyIds,
pii.id,
pii.`name`,
pii.name,
pii.risk_desc riskDesc,
pii.order_no orderNo,
pii.item_type itemType,
......@@ -430,13 +430,13 @@
pii.create_by createBy,
pii.create_date createDate,
pii.is_delete isDelete,
pii.`level`,
pii.level,
pii.item_no itemNo,
pii.original_id originalId,
pii.basis_json basisJson,
pii.org_code orgCode
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_point_classify ppc ON FIND_IN_SET(ppc.id, ppi.classify_ids) > 0
WHERE
......@@ -450,13 +450,13 @@
SELECT
ppc.id,
ppc.point_id pointId,
ppc.`name`,
ppc.name,
ppc.order_no orderNo,
ppc.equipment_id equipmentId,
ppc.code,
ppc.data_source_code dataSourceCode
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_point_classify ppc ON ppc.id = prpi.point_classify_id
WHERE
......@@ -465,7 +465,7 @@
GROUP BY
ppc.id,
ppc.point_id,
ppc.`name`,
ppc.name,
ppc.order_no
</select>
......@@ -498,49 +498,49 @@
SELECT
IFNULL( count( * ), 0 )
FROM
`p_check`
p_check
WHERE
check_time LIKE CONCAT( DATE_FORMAT( now( ), '%Y-%m-%d' ), '%' )
<if test="orgCode!=null">
and (org_code LIKE CONCAT('%',#{orgCode},'%' ))
</if>
AND is_ok = 1
) AS `over_num`,
) AS over_num,
(
SELECT
IFNULL( count( * ), 0 )
FROM
`p_check`
p_check
WHERE
check_time LIKE CONCAT( DATE_FORMAT( now( ), '%Y-%m-%d' ), '%' )
<if test="orgCode!=null">
and (org_code LIKE CONCAT('%',#{orgCode},'%' ))
</if>
AND is_ok = 2
) AS `unfinish_num`,
) AS unfinish_num,
(
SELECT
IFNULL( count( * ), 0 )
FROM
`p_check`
p_check
WHERE
check_time LIKE CONCAT( DATE_FORMAT( now( ), '%Y-%m-%d' ), '%' )
<if test="orgCode!=null">
and (org_code LIKE CONCAT('%',#{orgCode},'%' ))
</if>
AND is_ok = 3
) AS `miss_num`,
) AS miss_num,
(
SELECT
ifnull( sum( `p_plan_task`.`point_num` ), 0 )
ifnull( sum( p_plan_task.point_num ), 0 )
FROM
`p_plan_task`
p_plan_task
WHERE
( `p_plan_task`.`check_date` LIKE concat( curdate( ), '%' ) )
( p_plan_task.check_date LIKE concat( curdate( ), '%' ) )
<if test="orgCode!=null">
and (org_code LIKE CONCAT('%',#{orgCode},'%' ))
</if>
) AS `today_num`
) AS today_num
</select>
<!-- 巡检点统计 -->
<select id="getSumPtForDept" resultType="java.util.HashMap">
......@@ -807,25 +807,25 @@
(
SELECT
pt.id,
CASE pt.`status`
CASE pt.status
WHEN '1' THEN
1
ELSE
0
END QUALIFIED,
CASE pt.`status`
CASE pt.status
WHEN '0' THEN
1
ELSE
0
END UNPLAN,
CASE pt.`status`
CASE pt.status
WHEN '2' THEN
1
ELSE
0
END UNQUALIFIED,
CASE pt.`status`
CASE pt.status
WHEN '3' THEN
1
ELSE
......@@ -856,25 +856,25 @@
pt.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 pt.`status`
CASE pt.status
WHEN '1' THEN
1
ELSE
0
END QUALIFIED,
CASE pt.`status`
CASE pt.status
WHEN '0' THEN
1
ELSE
0
END UNPLAN,
CASE pt.`status`
CASE pt.status
WHEN '2' THEN
1
ELSE
0
END UNQUALIFIED,
CASE pt.`status`
CASE pt.status
WHEN '3' THEN
1
ELSE
......@@ -902,12 +902,12 @@
pp.id pointId,
pp.floor,
pp.is_indoor isIndoor,
pp.`name` pointName,
pp.name pointName,
pp.coordinates,
pp.`level` pointLevel,
pp.`status`,
pp.level pointLevel,
pp.status,
pp.address,
ppl.`name` pplName,
ppl.name pplName,
ppl.user_id userName,
ppl.user_id userId,
pp.org_code orgCode,
......@@ -972,7 +972,7 @@
<select id="queryLeavelPoint" resultMap="leavelPoint">
SELECT
p.id,
p.`status`,
p.status,
p.offline,
p.NAME pointName,
point_no pointNo,
......@@ -993,14 +993,14 @@
WHERE p.is_delete = 0
AND p.offline = 1
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>-->
</select>
<select id="getPoints" resultType="Map">
SELECT
p.point_no pointNo,
p.`name` pointName,
CASE p.`status`
p.name pointName,
CASE p.status
WHEN '0' THEN
'未纳入巡检'
WHEN '1' THEN
......@@ -1010,7 +1010,7 @@
ELSE
'漏检'
END status ,
pct.`name` catalogName,
pct.name catalogName,
p.address,
sd.department_name depName,
su. NAME username,
......@@ -1042,7 +1042,7 @@
<select id="getPointConfigDom" resultMap="pointConfigResultMap">
SELECT
p.id pointId,
p.`status` status,
p.status status,
p.NAME pointName,
p.point_no pointNo,
p.is_fixed isFixed,
......@@ -1122,12 +1122,12 @@
SELECT
p.id,
p.point_no pointNo,
p.`name`,
p.name,
p.is_fixed isFixed,
CONCAT(p.shot_min_number,'-',p.shot_max_number) shotNumber,
p.route_name routeName,
ppc.id classifyId,
ppc.`name` classifyName,
ppc.name classifyName,
p.biz_org_name
FROM
p_point p
......@@ -1138,10 +1138,10 @@
and p.biz_org_code like CONCAT(#{bizOrgCode},'%')
</if>
<if test="pointNo !=null and pointNo !=''">
and p.point_no like concat(concat("%",#{pointNo}),"%")
and p.point_no like concat(concat('%',#{pointNo}),'%')
</if>
<if test="name !=null and name !=''">
and p.name like concat(concat("%",#{name}),"%")
and p.name like concat(concat('%',#{name}),'%')
</if>
<if test="isFixed !=null and isFixed !=''">
and p.is_fixed = #{isFixed}
......@@ -1167,12 +1167,12 @@
p_point p
where p.is_delete = 0
<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="code !=null and code !=''"> and p.point_no like concat(concat("%",#{code}),"%")</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>
</select>
<select id="queryAllPointConfig" resultType="java.util.Map">
SELECT
c.`name`,
c.name,
c.point_code pointCode
FROM
p_point_config c,
......@@ -1250,10 +1250,10 @@
</foreach>
</if>
<if test="name != null and name.length > 0">
AND pp.name LIKE concat("%", #{name}, "%")
AND pp.name LIKE concat('%', #{name}, '%')
</if>
<if test="pointNo != null and pointNo.length > 0">
AND pp.point_no LIKE concat("%", #{pointNo}, "%")
AND pp.point_no LIKE concat('%', #{pointNo}, '%')
</if>
<if test="nullRiskSourceId == true">
AND ( pp.risk_source_id is NULL OR trim(pp.risk_source_id)='')
......@@ -1277,10 +1277,10 @@
</foreach>
</if>
<if test="name != null and name.length > 0">
AND pp.name LIKE concat("%", #{name}, "%")
AND pp.name LIKE concat('%', #{name}, '%')
</if>
<if test="pointNo != null and pointNo.length > 0">
AND pp.point_no LIKE concat("%", #{pointNo}, "%")
AND pp.point_no LIKE concat('%', #{pointNo}, '%')
</if>
<if test="nullRiskSourceId == true">
AND ( pp.risk_source_id is NULL OR trim(pp.risk_source_id)='')
......@@ -1317,10 +1317,10 @@
</foreach>
</if>
<if test="name != null and name.length > 0">
AND pp.name LIKE concat("%", #{name}, "%")
AND pp.name LIKE concat('%', #{name}, '%')
</if>
<if test="pointNo != null and pointNo.length > 0">
AND pp.point_no LIKE concat("%", #{pointNo}, "%")
AND pp.point_no LIKE concat('%', #{pointNo}, '%')
</if>
<if test="nullRiskSourceId == true">
AND ( pp.risk_source_id is NULL OR trim(pp.risk_source_id)='' )
......@@ -1351,10 +1351,10 @@
</foreach>
</if>
<if test="name != null and name.length > 0">
AND pp.name LIKE concat("%", #{name}, "%")
AND pp.name LIKE concat('%', #{name}, '%')
</if>
<if test="pointNo != null and pointNo.length > 0">
AND pp.point_no LIKE concat("%", #{pointNo}, "%")
AND pp.point_no LIKE concat('%', #{pointNo}, '%')
</if>
<if test="nullRiskSourceId == true">
AND ( pp.risk_source_id is NULL OR trim(pp.risk_source_id)='' )
......
......@@ -16,7 +16,7 @@
(
SELECT
p.id AS pointId,
p.`name` AS pointName
p.name AS pointName
FROM
p_point p
LEFT JOIN p_plan_task_detail ptd ON ptd.point_id = p.id
......@@ -47,5 +47,5 @@
LEFT JOIN p_check c ON c.point_id = t1.pointId
GROUP BY t1.pointId;
</select>
</mapper>
\ No newline at end of file
......@@ -60,8 +60,8 @@
</delete>
<insert id="insertRoutePointItem">
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`)
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)
VALUES(
#{id},
#{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