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,
......
......@@ -309,7 +309,7 @@
and
department_id = #{departmentId}
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
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>
......@@ -23,7 +23,7 @@
FROM
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>
......
......@@ -27,20 +27,20 @@
SELECT
count(1) AS total_num
FROM
`p_check` `a`
p_check a
<choose>
<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 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>
</choose>
<trim prefix="WHERE" prefixOverrides="AND ">
<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="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="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="pointNo!=null">and b.point_no like concat('%',#{pointNo},'%')</if>
<if test="isFixed!=null">and b.is_fixed = #{isFixed}</if>
<if test="isOK!=null">and a.is_OK = #{isOK}</if>
......@@ -53,11 +53,11 @@
<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>
<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)
</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 == 1">and (a.plan_task_detail_id != 0 AND a.is_ok != 3)</when>
<when test="finishStatus == 2">and a.is_ok = 3</when>
</choose>
</trim>
</select>
......@@ -67,10 +67,10 @@
SELECT
count(a.id)
FROM
`p_check` `a`
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_plan` `e` ON `a`.`plan_id` = `e`.`id`
p_check a
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_plan e ON a.plan_id = e.id
<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
</if>
......@@ -79,8 +79,8 @@
<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} <![CDATA[>=]]> a.check_time </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="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="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="isOK!=null and isOK!=''">and a.is_OK = #{isOK}</if>
......@@ -96,11 +96,11 @@
<if test="checkType == '计划检查'">and a.plan_task_id &gt; 0</if>
<if test="checkType == '无计划检查'">and a.plan_task_id &lt;= 0</if>
<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)
</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 == 1">and (a.plan_task_detail_id != 0 AND a.is_ok != 3)</when>
<when test="finishStatus == 2">and a.is_ok = 3</when>
</choose>
<if test="dangerId != null and dangerId != ''">
and FIND_IN_SET(#{dangerId}, t.dangerIds)
......@@ -131,47 +131,47 @@
a.dep_name department_name,
a.dep_id departmentId,
date_format(
`a`.`check_time`,
a.check_time,
'%Y-%m-%d %H:%i:%s'
) AS `checkDate`,
) AS checkDate,
date_format(
`a`.`upload_time`,
a.upload_time,
'%Y-%m-%d %H:%i:%s'
) AS `upload_time`,
) AS upload_time,
(
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'
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'
WHEN `a`.`is_ok` = 3
WHEN a.is_ok = 3
THEN '2'
END
) AS `Finish_Status`,
) AS Finish_Status,
a.is_ok is_ok,
a.score,
d.`name` AS `route_name`,
d.name AS route_name,
a.check_mode,
e.`name` AS `plan_name`,
e.name AS plan_name,
a.plan_task_id,
a.plan_id,
a.`route_id`,
b.`catalog_id`,
a.route_id,
b.catalog_id,
a.error,
a.remark
FROM
`p_check` `a`
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_plan` `e` ON `a`.`plan_id` = `e`.`id`
p_check a
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_plan e ON a.plan_id = e.id
<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
</if>
<trim prefix="WHERE" prefixOverrides="AND ">
<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="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="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="pointNo!=null">and b.point_no like concat('%',#{pointNo},'%')</if>
<if test="isFixed!=null">and b.is_fixed = #{isFixed}</if>
<if test="isOK!=null">and a.is_OK = #{isOK}</if>
......@@ -187,11 +187,11 @@
<if test="checkType == '计划检查'">and a.plan_task_id &gt; 0</if>
<if test="checkType == '无计划检查'">and a.plan_task_id &lt;= 0</if>
<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)
</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 == 1">and (a.plan_task_detail_id != 0 AND a.is_ok != 3)</when>
<when test="finishStatus == 2">and a.is_ok = 3</when>
</choose>
<if test="dangerId != null and dangerId != ''">
and FIND_IN_SET(#{dangerId}, t.dangerIds)
......@@ -221,35 +221,35 @@
a.dep_id departmentId,
wws.name address,
date_format(
`a`.`check_time`,
a.check_time,
'%Y-%m-%d %H:%i:%s'
) AS `checkDate`,
) AS checkDate,
date_format(
`a`.`upload_time`,
a.upload_time,
'%Y-%m-%d %H:%i:%s'
) AS `upload_time`,
) AS upload_time,
(
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 '计划外完成'
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 '按时完成'
WHEN `a`.`is_ok` = 3
WHEN a.is_ok = 3
THEN '未执行'
END
) AS `Finish_Status`,
) AS Finish_Status,
(
CASE
WHEN `a`.`is_ok` = 1
WHEN a.is_ok = 1
THEN '合格'
WHEN `a`.`is_ok` = 2
WHEN a.is_ok = 2
THEN '不合格'
WHEN `a`.`is_ok` = 3
WHEN a.is_ok = 3
THEN '漏检'
END
) as is_ok,
a.score,
a.`route_name`,
a.route_name,
(
CASE
WHEN a.check_mode = 'QR'
......@@ -266,19 +266,19 @@
'系统自检'
END
) as check_mode,
a.`plan_name` AS `plan_name`,
a.plan_name AS plan_name,
a.plan_task_id,
a.plan_id,
a.`route_id`,
b.`catalog_id`,
a.route_id,
b.catalog_id,
a.error,
a.remark,
b.biz_org_name AS bizOrgName
FROM
`p_check` `a`
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_plan` `e` ON `a`.`plan_id` = `e`.`id`
p_check a
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_plan e ON a.plan_id = e.id
LEFT JOIN wl_warehouse_structure wws on wws.id = b.risk_source_id
<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
......@@ -288,8 +288,8 @@
<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} <![CDATA[>=]]> a.check_time </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="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="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="isOK!=null and isOK!=''">and a.is_OK = #{isOK}</if>
......@@ -305,11 +305,11 @@
<if test="checkType == '计划检查'">and a.plan_task_id &gt; 0</if>
<if test="checkType == '无计划检查'">and a.plan_task_id &lt;= 0</if>
<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)
</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 == 1">and (a.plan_task_detail_id != 0 AND a.is_ok != 3)</when>
<when test="finishStatus == 2">and a.is_ok = 3</when>
</choose>
<if test="dangerId != null and dangerId != ''">
and FIND_IN_SET(#{dangerId}, t.dangerIds)
......@@ -336,7 +336,7 @@
SELECT
count(1)
FROM
`p_check` `a`
p_check a
<trim prefix="WHERE" prefixOverrides="AND ">
<if test="userId!=null and userId!=''">and find_in_set(#{userId}, a.user_id) > 0</if>
<if test="bizOrgCode != null and bizOrgCode != ''">
......@@ -354,23 +354,23 @@
a.id,
a.user_id,
date_format(
`a`.`check_time`,
a.check_time,
'%Y-%m-%d %H:%i:%s'
) AS `checkDate`,
) AS checkDate,
(
CASE
WHEN `a`.`is_ok` = 1
WHEN a.is_ok = 1
THEN '合格'
WHEN `a`.`is_ok` = 2
WHEN a.is_ok = 2
THEN '不合格'
WHEN `a`.`is_ok` = 3
WHEN a.is_ok = 3
THEN '漏检'
END
) as is_ok
FROM
`p_check` `a`
p_check a
<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="bizOrgCode != null and bizOrgCode != ''">
and a.org_code LIKE CONCAT(#{bizOrgCode},'%')
......@@ -420,7 +420,7 @@
pcs.photo_data photoDate,
pcs.point_name pointName
FROM
`p_check_shot` pcs
p_check_shot pcs
LEFT JOIN p_check pc ON pc.id = pcs.check_id
WHERE
pc.plan_task_id = #{planTaskId}
......@@ -531,7 +531,7 @@
<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="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 id="calendarData" resultType="Map">
......@@ -546,7 +546,7 @@
<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="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
ORDER BY time
</select>
......@@ -571,7 +571,7 @@
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},"%") </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="userId != null and userId != '' ">
......@@ -692,14 +692,14 @@
JOIN p_check_shot s ON s.check_id = a.id
<choose>
<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>
</choose>
<trim prefix="WHERE" prefixOverrides="AND ">
<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="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="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="pointNo!=null">and b.point_no = #{pointNo}</if>
<if test="isFixed!=null">and b.is_fixed = #{isFixed}</if>
<if test="isOK!=null">and a.is_OK = #{isOK}</if>
......@@ -710,11 +710,11 @@
<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>
<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)
</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 == 1">and (a.plan_task_detail_id != 0 AND a.is_ok != 3)</when>
<when test="finishStatus == 2">and a.is_ok = 3</when>
</choose>
<if test="departmentId!=null"> and find_in_set(#{departmentId},a.dep_id)>0 </if>
</trim>
......@@ -747,23 +747,23 @@
a.user_name user_name,
a.dep_name department_name,
date_format(
`a`.`check_time`,
a.check_time,
'%Y-%m-%d %H:%i:%s'
) AS `checkDate`,
) AS checkDate,
date_format(
`a`.`upload_time`,
a.upload_time,
'%Y-%m-%d %H:%i:%s'
) AS `upload_time`,
) AS upload_time,
(
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'
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'
WHEN `a`.`is_ok` = 3
WHEN a.is_ok = 3
THEN '2'
END
) AS `Finish_Status`,
) AS Finish_Status,
CASE
WHEN a.is_ok = '1' THEN
'合格'
......@@ -773,17 +773,17 @@
'漏检'
END AS is_ok,
a.score,
d.`name` AS `route_name`,
d.name AS route_name,
a.check_mode,
e.`name` AS `plan_name`,
e.name AS plan_name,
a.plan_task_id,
a.error,
a.remark
from
`p_check` `a`
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_plan` `e` ON `a`.`plan_id` = `e`.`id`
p_check a
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_plan e ON a.plan_id = e.id
WHERE
a.id in
<foreach collection="checkIds" item="id" index="index" open="(" close=")" separator=",">#{id}</foreach>
......@@ -1123,7 +1123,7 @@
'漏检'
END
) AS IsOK,
ii.`name` AS NAME,
ii.name AS NAME,
c.upload_time AS UploadTime,
c.user_name AS RealName,
ci.score AS Score,
......@@ -1189,7 +1189,7 @@
'漏检'
END
) AS IsOK,
ii.`name` AS NAME,
ii.name AS NAME,
c.upload_time AS UploadTime,
c.user_name AS RealName,
ci.score AS Score,
......@@ -1257,7 +1257,7 @@
c.dep_id AS depId,
c.check_time AS CheckTime,
p.point_no AS PointNo,
p.`name` AS PointName,
p.name AS PointName,
c.user_id AS RealName,
c.dep_name AS groupName,
(
......@@ -1268,8 +1268,8 @@
'固定点'
END
) AS IsFixed,
r.`name` AS RouteName,
p.`level` AS Level,
r.name AS RouteName,
p.level AS Level,
(
CASE c.is_ok
WHEN 1 THEN
......@@ -1280,7 +1280,7 @@
'漏检'
END
) AS IsOK,
pl.`name` AS planName,
pl.name AS planName,
pl.remark AS Remark,
if(c.plan_id =0 AND p.is_score=0,0,c.score) as score,
c.remark checkRemark
......@@ -1344,7 +1344,7 @@
a.point_id,
max(id) id
FROM
`p_check` a
p_check a
<trim prefix="WHERE" prefixOverrides="AND ">
<if test="orgCode!=null">and a.org_code like #{orgCode}</if>
<if test="pointId!=null">and a.point_id = #{pointId}</if>
......@@ -1381,21 +1381,21 @@
pc.id checkId,
pc.point_id pointId,
pp.point_no pointNo,
pp.`name` pointName,
ppl.`name` planName,
pp.name pointName,
ppl.name planName,
ppl.id planId,
pc.user_id userId,
pc.`user_name` userName,
pc.user_name userName,
pc.check_time checkTime,
pp.address,
pc.is_ok status,
pci.is_ok inputStatus,
pii.`name` inputItemName,
pii.name inputItemName,
pci.input_value inputValue,
pc.dep_name department,
pii.level
FROM
`p_check_input` pci
p_check_input pci
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_plan ppl ON ppl.id = pc.plan_id
......@@ -1445,7 +1445,7 @@
END
AS is_ok,
c. NAME route_name,
d.`name` plan_name,
d.name plan_name,
b.dep_name dep_name,
b.user_name user_name
FROM
......@@ -1457,7 +1457,7 @@
a.point_id,
max(id) id
FROM
`p_check` a
p_check a
<trim prefix="WHERE" prefixOverrides="AND ">
<if test="orgCode!=null">and a.org_code like #{orgCode}</if>
<if test="pointId!=null">and a.point_id = #{pointId}</if>
......@@ -1468,7 +1468,7 @@
a.user_id,
a.point_id
) 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_plan d ON d.id = sa.plan_id
) ma
......@@ -1534,7 +1534,7 @@
b.name AS name,
(SELECT
GROUP_CONCAT(
`name`
name
)
FROM
s_user u
......@@ -1623,7 +1623,7 @@
p.Address,
p.id PointID,
p. STATUS RealTimeStatus,
p.`level`,
p.level,
p.org_code compCode,
ptd.task_id taskId,
temp.*
......@@ -1643,7 +1643,7 @@
u.id OpenID,
(SELECT
GROUP_CONCAT(
`name`
name
)
FROM
s_user u
......@@ -1667,12 +1667,12 @@
SELECT
r.id RouteID,
r. NAME rName,
su.`name` boss,
su.name boss,
r.tel,
u.id OpenID,
(SELECT
GROUP_CONCAT(
`name`
name
)
FROM
s_user u
......@@ -1689,7 +1689,7 @@
) B ON A.route_id = B.RouteID
) temp ON temp.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 id="getCheckStatisticalAnalysis" resultType="com.yeejoin.amos.patrol.business.vo.CheckAnalysisVo">
......@@ -2046,9 +2046,9 @@
<!-- <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="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="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>-->
<!-- </trim>-->
......@@ -2080,9 +2080,9 @@
<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="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="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>
order by c.create_date DESC
<choose>
......@@ -2105,9 +2105,9 @@
<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="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="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>
</select>
......@@ -2128,7 +2128,7 @@
<select id="getCheckInfoBusinessById" resultMap="checkInfoResulBusinesstMap">
SELECT
pc.point_id pointId,
pp.`name` pointName,
pp.name pointName,
pc.is_ok status,
pc.id checkId,
pc.user_name as checkUser,
......@@ -2149,11 +2149,11 @@
<select id="queryPointInputBu" resultMap="CheckInputBuMap">
SELECT
pci.is_ok inputStatus,
pii.`name` pointInputitemName,
pii.name pointInputitemName,
a.id pointInputitemId,
pci.id checkInputitemId
FROM
`p_check_input` pci
p_check_input pci
LEFT JOIN p_input_item pii ON pii.id = pci.input_id
LEFT JOIN (
SELECT
......@@ -2171,7 +2171,7 @@
<select id="queryUserInfoByIds" resultType="Map">
SELECT
GROUP_CONCAT(u.`name`) userName,
GROUP_CONCAT(u.name) userName,
GROUP_CONCAT( distinct d.department_name) depName,
GROUP_CONCAT( distinct d.id) depId
FROM
......
......@@ -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
......@@ -42,7 +42,7 @@
and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})
</if>
<if test="searchDay!=null and searchDay != '' and searchDay == 1">
and a.`check_date` = curdate()
and a.check_date = curdate()
</if>
</where>
......@@ -72,7 +72,7 @@
(case b.is_finish
when 0 THEN '尚未巡检'
when 1 THEN '按时完成'
else '超时漏检' END) as `statusName`,
else '超时漏检' END) as statusName,
......@@ -88,20 +88,20 @@
</sql>
<!--计划执行查询 -->
<select id="getPlanTaskInfo" resultType="java.util.HashMap">
<include refid="planTaskInfoSql" />
<include refid="planTaskInfoSql"/>
<where>
<if test="pointNo!=null"> and d.point_no like concat('%',#{pointNo},'%')</if>
<if test="pointName!=null"> and d.name like concat('%',#{pointName},'%')</if>
<!-- AND-->
<!-- ((<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate}</if>)-->
<!-- OR-->
<!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{beginDate} AND a.end_Time <![CDATA[>=]]> #{beginDate}</if>)-->
<!-- OR-->
<!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{endDate} AND a.end_Time <![CDATA[>=]]> #{endDate}</if>)-->
<!-- OR-->
<!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{beginDate} AND a.end_Time <![CDATA[>=]]> #{endDate}</if>)-->
<!-- )-->
<if test="pointNo!=null">and d.point_no like concat('%',#{pointNo},'%')</if>
<if test="pointName!=null">and d.name like concat('%',#{pointName},'%')</if>
<!-- AND-->
<!-- ((<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate}</if>)-->
<!-- OR-->
<!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{beginDate} AND a.end_Time <![CDATA[>=]]> #{beginDate}</if>)-->
<!-- OR-->
<!-- (<if test="beginDate!=null and endDate!=null">a.begin_Time <![CDATA[<=]]> #{endDate} AND a.end_Time <![CDATA[>=]]> #{endDate}</if>)-->
<!-- 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 and endDate != '' and beginDate != ''">
and a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate}
......@@ -117,15 +117,15 @@
</if>
<if test="status!=null"> and b.is_finish = #{status}</if>
<if test="routeId!=null"> and a.route_id = #{routeId}</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="status!=null">and b.is_finish = #{status}</if>
<if test="routeId!=null">and a.route_id = #{routeId}</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="orgCode!=null">
and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})
</if>
<if test="searchDay!=null and searchDay != '' and searchDay == 1">
and a.`check_date` = curdate()
and a.check_date = curdate()
</if>
</where>
order by b.id
......@@ -190,7 +190,7 @@
</select>
<select id="getPlanTaskByRouteId" resultType="com.yeejoin.amos.patrol.dao.entity.PlanTask">
SELECT * FROM `p_plan_task`
SELECT * FROM p_plan_task
<where>
<if test="routeId != null">route_id = #{routeId}</if>
</where>
......@@ -403,25 +403,25 @@
pt.finish_num finishNum,
pt.finish_status finishStatus,
pt.batch_no batchNo,
CASE ptd.`status`
CASE ptd.status
WHEN 1 THEN
1
ELSE
0
END finish,
CASE ptd.`status`
CASE ptd.status
WHEN 3 THEN
1
ELSE
0
END omission,
CASE ptd.`status`
CASE ptd.status
WHEN 2 THEN
1
ELSE
0
END unqualified,
CASE ptd.`status`
CASE ptd.status
WHEN 0 THEN
1
ELSE
......@@ -480,11 +480,11 @@
temp1.routePointItemId,
temp1.classifyId,
temp1.classifyName,
pii.`name` inputName,
(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_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,
pii.name inputName,
(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_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,
temp2.*
FROM
......@@ -499,7 +499,7 @@
prp.route_id,
prpi.id routePointItemId,
ppc.id classifyId,
ppc.`name` classifyName
ppc.name classifyName
FROM
p_route_point_item prpi
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id
......@@ -523,7 +523,7 @@
p_plan_task ptd
WHERE
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
AND temp1.route_id = temp2.routeId)
......@@ -687,15 +687,15 @@
<select id="getPointPlanTaskInfo" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.PointCheckDetailBo" parameterType="long">
SELECT
pp.id pointId,
pp.`name` pointName,
pp.name pointName,
pp.point_no pointNo,
ppt.route_id routeId,
ppl.`name` planName,
ppl.name planName,
ppt.begin_time checkTime,
ppl.dept_id checkDepartmentId,
ppt.user_id userId,
ppt.user_name userName,
pptd.`status` pointStatus
pptd.status pointStatus
FROM
p_plan_task_detail pptd
LEFT JOIN p_plan_task ppt ON pptd.task_no = ppt.id
......@@ -713,7 +713,7 @@
<select id="getPointInputByRouteIdAndPointId" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.PointCheckDetailBo" parameterType="long">
SELECT
pii.`name` inputName,
pii.name inputName,
pii.id checkInputId,
ppc.id classifyId,
ppc.name classifyName,
......@@ -739,7 +739,7 @@
<!--
SELECT
pii.`name` inputName,
pii.name inputName,
pii.id checkInputId
FROM
p_route_point_item prpi,
......@@ -860,7 +860,7 @@
</resultMap>
<select id="getRoutePointInputItem" resultType="com.yeejoin.amos.patrol.business.vo.PointInputItemVo">
SELECT
pii.*, ppc.id classifyIds, ppc.`name` classifyNames
pii.*, ppc.id classifyIds, ppc.name classifyNames
FROM
p_route_point_item prpi
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id
......@@ -952,10 +952,10 @@
SELECT
ppc.id,
ppc.point_id pointId,
ppc.`name`,
ppc.name,
ppc.order_no orderNo
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
......@@ -964,7 +964,7 @@
GROUP BY
ppc.id,
ppc.point_id,
ppc.`name`,
ppc.name,
ppc.order_no
</select>
......@@ -1041,7 +1041,7 @@
ppk.user_id AS userId,
( CASE pptd.STATUS WHEN 0 THEN '未执行' WHEN 1 THEN '正常' WHEN 2 THEN '异常' WHEN 3 THEN '漏检' END ) AS STATUS
FROM
`p_plan_task` ppk
p_plan_task ppk
LEFT JOIN p_plan pp ON pp.id = ppk.plan_id
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
<where>
......@@ -1068,7 +1068,7 @@
point.risk_source_id,
( CASE pptd.STATUS WHEN 0 THEN '未执行' WHEN 1 THEN '正常' WHEN 2 THEN '异常' WHEN 3 THEN '漏检' END ) AS STATUS
FROM
`p_plan_task` ppk
p_plan_task ppk
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_point point ON point.id = pptd.point_id
......@@ -1111,14 +1111,14 @@
<select id="firePatrolStatics" resultType="java.util.Map">
SELECT
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) AS `value`,
ifnull( sum( p_plan_task.point_num ), 0 ) AS value,
'个' AS unit,
'今日应巡查点' AS `name`,
'currentDayTotal' AS `indexKey`,
'今日应巡查点' AS name,
'currentDayTotal' AS indexKey,
'xfxc' AS type,
'1' AS `key`
'1' AS key
FROM
`p_plan_task`
p_plan_task
WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''">
......@@ -1126,30 +1126,30 @@
</if>
UNION ALL
SELECT
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) AS `value`,
ifnull( sum( p_plan_task.point_num ), 0 ) AS value,
'个' AS unit,
'今日漏查点位' AS `name`,
'currentDayMiss' AS `indexKey`,
'今日漏查点位' AS name,
'currentDayMiss' AS indexKey,
'xfxc' AS type,
'2' AS `key`
'2' AS key
FROM
`p_plan_task`
p_plan_task
WHERE
`finish_status` = 3
finish_status = 3
AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
UNION ALL
SELECT
ifnull( sum( `p_plan_task`.`finish_num` ), 0 ) AS `value`,
ifnull( sum( p_plan_task.finish_num ), 0 ) AS value,
'个' AS unit,
'今日已巡查点' AS `name`,
'currentDayPass' AS `indexKey`,
'今日已巡查点' AS name,
'currentDayPass' AS indexKey,
'xfxc' AS type,
'3' AS `key`
'3' AS key
FROM
`p_plan_task`
p_plan_task
WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''">
......@@ -1161,7 +1161,7 @@
SELECT
count(1)
FROM
`p_plan_task` ppk
p_plan_task ppk
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_route pr ON pr.id = ppk.route_id
......@@ -1181,7 +1181,7 @@
ppk.id AS planTaskId,
pptd.id AS taskDetailId,
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.end_time, '%Y-%m-%d %H:%i:%s') AS endTime,
ppk.point_num AS checkedNum,
......@@ -1190,7 +1190,7 @@
ppk.user_id AS userId,
ppk.user_name AS executor
FROM
`p_plan_task` ppk
p_plan_task ppk
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_route pr ON pr.id = ppk.route_id
......@@ -1221,7 +1221,7 @@
(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
FROM
`p_plan_task` ppk
p_plan_task ppk
LEFT JOIN p_plan pp ON pp.id = ppk.plan_id
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
<where>
......@@ -1277,13 +1277,13 @@
<select id="getDefinitionObjCode" resultType="String">
SELECT
cl.`code`
cl.code
FROM
p_plan_task_detail de
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
WHERE
de.id = #{taskDetailId} AND cl.`code` IS NOT NULL
de.id = #{taskDetailId} AND cl.code IS NOT NULL
</select>
<select id="getDefectEquipInfo" resultType="Map">
......@@ -1300,7 +1300,7 @@
<select id="getCheckMissedEquipInfo" resultType="Map">
SELECT
cl.`name` AS equipName,
cl.name AS equipName,
cl.address AS equipPosition,
'漏检' AS result,
cl.data_source_name AS remark
......@@ -1316,7 +1316,7 @@
<select id="getCheckQualifiedEquipInfo" resultType="Map">
SELECT
cl.`name` AS equipName,
cl.name AS equipName,
cl.address AS equipPosition,
pii.name AS checkItem,
'合格' AS result,
......@@ -1335,13 +1335,13 @@
<select id="getCheckNotQualifiedEquipInfo" resultType="Map">
SELECT
cl.`name` AS equipName,
cl.name AS equipName,
cl.address AS equipPosition,
pii.name AS checkItem,
'不合格' AS result,
pc.check_time AS checkDate,
pc.user_name AS checkUserName,
cl.`code` AS objCode
cl.code AS objCode
FROM
p_point_classify cl
LEFT JOIN p_check_input pci ON pci.point_classify_id = cl.id
......@@ -1359,13 +1359,13 @@
<select id="getStatics" resultType="java.util.Map">
SELECT
'0' AS `key`,
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) AS `value`,
'0' AS key,
ifnull( sum( p_plan_task.point_num ), 0 ) AS value,
'' AS unit,
'今日总巡查点位' AS `name`,
'今日总巡查点位' AS name,
'xfxcjrzxcdw' AS code
FROM
`p_plan_task`
p_plan_task
WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''">
......@@ -1373,13 +1373,13 @@
</if>
UNION ALL
SELECT
'1' AS `key`,
ifnull( sum( `p_plan_task`.`finish_num` ), 0 ) AS `value`,
'1' AS key,
ifnull( sum( p_plan_task.finish_num ), 0 ) AS value,
'' AS unit,
'今日累计巡查点位' AS `name`,
'今日累计巡查点位' AS name,
'xfxcjrljxcdw' AS code
FROM
`p_plan_task`
p_plan_task
WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''">
......@@ -1387,13 +1387,13 @@
</if>
UNION ALL
SELECT
'2' AS `key`,
count(1) AS `value`,
'2' AS key,
count(1) AS value,
'' AS unit,
'合格' AS `name`,
'合格' AS name,
'xfxchg' AS code
FROM
`p_plan_task` ppk
p_plan_task ppk
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND pptd.STATUS = 1
......@@ -1402,20 +1402,20 @@
</if>
UNION ALL
SELECT
'3' AS `key`,
'' AS `value`,
'3' AS key,
'' AS value,
'%' AS unit,
'合格占比' AS `name`,
'合格占比' AS name,
'xfxchgzb' AS code
UNION ALL
SELECT
'4' AS `key`,
count(1) AS `value`,
'4' AS key,
count(1) AS value,
'' AS unit,
'不合格' AS `name`,
'不合格' AS name,
'xfxcbhg' AS code
FROM
`p_plan_task` ppk
p_plan_task ppk
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
WHERE
DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE () AND pptd.STATUS = 2
......@@ -1424,25 +1424,25 @@
</if>
UNION ALL
SELECT
'5' AS `key`,
count(1) AS `value`,
'5' AS key,
count(1) AS value,
'' AS unit,
'今日漏查点位' AS `name`,
'今日漏查点位' AS name,
'xfxcjrlcdw' AS code
FROM
`p_plan_task`
p_plan_task
WHERE
`finish_status` = 3
finish_status = 3
AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
UNION ALL
SELECT
'6' AS `key`,
'' AS `value`,
'6' AS key,
'' AS value,
'%' AS unit,
'漏查率' AS `name`,
'漏查率' AS name,
'xfxclcl' AS code
</select>
......@@ -1467,9 +1467,9 @@
(
SELECT
pt.id AS task_id,
r.`name` route_name,
r.name route_name,
pt.route_id,
p.`name` plan_name,
p.name plan_name,
pt.plan_id,
pt.id AS plan_task_id,
pt.begin_time,
......@@ -1492,7 +1492,7 @@
0,
SUM( is_certificate ))
FROM
`cb_org_usr`
cb_org_usr
WHERE
FIND_IN_SET( amos_org_id, pt.user_id ) > 0
) AS certified_person_count,
......@@ -1502,9 +1502,9 @@
p.org_code,
p.biz_org_code AS biz_org_code,
p.biz_org_name AS biz_org_name,
pt.end_time AS `date`
pt.end_time AS date
FROM
`p_plan_task` pt
p_plan_task pt
LEFT JOIN p_plan p ON p.id = pt.plan_id
LEFT JOIN p_route r ON r.id = pt.route_id
<where>
......@@ -1538,7 +1538,7 @@
ci.input_name,
ci.input_value,
c.check_time,
pt.end_time AS `date`,
pt.end_time AS date,
c.plan_id,
c.plan_name,
c.route_id,
......@@ -1550,17 +1550,17 @@
c.dep_name,
es.id AS eq_id,
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,
CONCAT( pt.id, '' ) AS plan_task_id,
pt.end_time AS plan_completion_time,
c.id AS check_id,
p.point_no,
cou.`code` AS company_code,
cou.code AS company_code,
es.equipment_code AS equipment_type_code,
pii.item_no AS input_code,
p.point_no AS pointCode,
wws.`code` AS buildCode,
wws.code AS buildCode,
wws.full_name AS buildName
FROM
p_check_input ci
......
......@@ -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,
......@@ -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
......
......@@ -71,7 +71,7 @@
SELECT DISTINCT
route_id
FROM
`p_route_point`
p_route_point
<where>
<if test="pointId != null">point_id = #{pointId}</if>
</where>
......@@ -83,12 +83,12 @@
SELECT
COUNT(1) AS total_sum
FROM
`p_route` r
p_route r
<!-- LEFT JOIN s_department d ON r.dept_id = d.id
LEFT JOIN s_user u ON r.user_id = u.id -->
WHERE
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="orgCode!=null">AND r.org_Code = #{orgCode}</if>
<if test="bizOrgCode!=null">AND r.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%') </if>
......@@ -103,7 +103,7 @@
<!--返回路线信息-->
<select id="getRouteInfo" resultType="java.util.HashMap">
SELECT
r.`name`,
r.name,
r.id,
r.boss,
r.tel,
......@@ -112,10 +112,10 @@
r.boss_name bossName,
ifnull(r.biz_org_code, "") as bizOrgCode
FROM
`p_route` r
p_route r
WHERE
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="orgCode!=null">AND r.org_Code = #{orgCode}</if>
<if test="bizOrgCode!=null">AND r.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%') </if>
......@@ -141,7 +141,7 @@
SELECT
r.id,
r.`name`
r.name
FROM
p_plan ppl
LEFT JOIN p_route r ON r.id = ppl.route_id
......@@ -156,7 +156,7 @@
</if>
SELECT
r.id,
r.`name`
r.name
FROM
p_route r
WHERE
......@@ -180,7 +180,7 @@
SELECT
r.id,
r.`name`
r.name
FROM
p_plan ppl
LEFT JOIN p_route r ON r.id = ppl.route_id
......@@ -195,7 +195,7 @@
</if>
SELECT
r.id,
r.`name`
r.name
FROM
p_route r
WHERE
......@@ -340,7 +340,7 @@
IFNULL(ppl.org_code,'') orgCode,
IFNULL(ppl.dept_id ,'')groupName,
pr.id routeId,
IFNULL( pr.`name`,'') routeName,
IFNULL( pr.name,'') routeName,
pr.tel,
pr.is_delete isDelete,
IFNULL(pr.boss,'') boss,
......@@ -383,10 +383,10 @@
ppi.point_id pointId,
ppi.order_no orderNo,
ppi.id pointInputItemId,
pii.`name` inputName,
ppc.`name` classifyName,
pii.name inputName,
ppc.name classifyName,
ppc.id pointClassifyId,
pii.`level`,
pii.level,
pii.item_type itemType,
pii.is_must isMust,
pii.is_score isScore,
......@@ -424,18 +424,18 @@
WHERE
ppi.point_id = #{pointId}
<!-- <if test="level!=null and level !=''">
and pii.`level` = #{level}
and pii.level = #{level}
</if> -->
<choose>
<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!=null and level !='' and level > 0">and pii.level = #{level}</when>
<when test="level== -1"> and pii.level is null</when>
</choose>
<if test="classifyId!=null and classifyId !=''">
and ppc.id = #{classifyId}
</if>
<if test="inputName!=null and inputName !=''">
and (pii.`name` like CONCAT('%', #{inputName}, '%')
or pii.`item_no` like CONCAT('%', #{inputName}, '%'))
and (pii.name like CONCAT('%', #{inputName}, '%')
or pii.item_no like CONCAT('%', #{inputName}, '%'))
</if>
<if test="isBound!=null and isBound !=''">
and temp.routePointItemId >0
......
......@@ -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