Commit f560bdab authored by H2T's avatar H2T

代码回滚

parent de1301a7
......@@ -572,7 +572,7 @@
<if test="type!=null and type==3">AND DATE_FORMAT(pt.check_date, '%Y') = left(#{checkTime}, 4)</if>
<if test="userId!=null and userId!=0">AND FIND_IN_SET(#{userId}, pt.user_id)>0</if>
<!-- <if test="orgCode!=null">AND org_code LIKE #{orgCode}</if>-->
<if test="orgCode!=null">AND pt.org_code LIKE concat(#{orgCode}::text,'%') </if>
<if test="orgCode!=null">AND pt.org_code LIKE concat(#{orgCode},'%') </if>
GROUP BY stime
order by stime ASC
</select>
......
......@@ -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('%',#{name}::text,'%')</if>
<if test="itemNo!=null"> and a.item_no like concat('%',#{itemNo}::text,'%')</if>
<if test="name!=null"> and a.name like concat('%',#{name},'%')</if>
<if test="itemNo!=null"> and a.item_no like 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('%',#{name}::text,'%')</if>
<if test="itemNo!=null"> and a.item_no like concat('%',#{itemNo}::text,'%')</if>
<if test="name!=null"> and a.name like concat('%',#{name},'%')</if>
<if test="itemNo!=null"> and a.item_no like 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> -->
......@@ -151,7 +151,7 @@
SELECT * FROM p_input_item
where is_delete = '0' and input_type = 0
<if test="id!=null and id !='' ">
and id like concat('%', #{id}::text, '%')
and id like concat('%', #{id}, '%')
</if>
<if test="orgCode!=null and orgCode !='' ">
and org_Code = #{orgCode}
......@@ -163,7 +163,7 @@
and input_classify = #{inputClassify}
</if>
<if test="nameOrItemNo!=null and nameOrItemNo !='' ">
and (name like concat('%', #{nameOrItemNo}::text, '%') or item_no like concat('%', #{nameOrItemNo}::text, '%'))
and (name like concat('%', #{nameOrItemNo}, '%') or item_no like concat('%', #{nameOrItemNo}, '%'))
</if>
<if test="equipmentType!=null and equipmentType.size()>0">
and equipment_type in
......@@ -180,7 +180,7 @@
and custom_type is not null
</if>
<if test="bizOrgCode!=null and bizOrgCode !=''">
and biz_org_code LIKE CONCAT (#{bizOrgCode}::text,'%')
and biz_org_code LIKE CONCAT (#{bizOrgCode},'%')
</if>
ORDER BY create_date DESC
</select>
......@@ -241,8 +241,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('%',#{name}::text,'%')</if>
<if test="itemNo!=null"> and a.item_no like concat('%',#{itemNo}::text,'%')</if>
<if test="name!=null"> and a.name like concat('%',#{name},'%')</if>
<if test="itemNo!=null"> and a.item_no like 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>
......@@ -250,7 +250,7 @@
and a.catalog_id in <foreach collection="catalogIds" item="catalogId" index="index" open="(" separator="," close=")" >#{catalogId}</foreach>
</if>
<if test="bizOrgCode!=null and bizOrgCode!=''">
and a.biz_org_code LIKE CONCAT (#{bizOrgCode}::text,'%')
and a.biz_org_code LIKE CONCAT (#{bizOrgCode},'%')
</if>
<if test="treeId != null and treeId != '' and treeId == '-1'">
and a.facilities_type is not null
......@@ -322,8 +322,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('%',#{name}::text,'%')</if>
<if test="itemNo!=null"> and a.item_no like concat('%',#{itemNo}::text,'%')</if>
<if test="name!=null"> and a.name like concat('%',#{name},'%')</if>
<if test="itemNo!=null"> and a.item_no like 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>
......@@ -331,7 +331,7 @@
and a.catalog_id in <foreach collection="catalogIds" item="catalogId" index="index" open="(" separator="," close=")" >#{catalogId}</foreach>
</if>
<if test="bizOrgCode!=null and bizOrgCode!=''">
and a.biz_org_code LIKE CONCAT (#{bizOrgCode}::text,'%')
and a.biz_org_code LIKE CONCAT (#{bizOrgCode},'%')
</if>
<if test="treeId != null and treeId != '' and treeId == '-1'">
and a.facilities_type is not null
......@@ -421,8 +421,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('%',#{name}::text,'%')</if>
<if test="itemNo!=null"> and a.item_no like concat('%',#{itemNo}::text,'%')</if>
<if test="name!=null"> and a.name like concat('%',#{name},'%')</if>
<if test="itemNo!=null"> and a.item_no like 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>
......@@ -430,7 +430,7 @@
and a.catalog_id in <foreach collection="catalogIds" item="catalogId" index="index" open="(" separator="," close=")" >#{catalogId}</foreach>
</if>
<if test="bizOrgCode!=null and bizOrgCode!=''">
and a.biz_org_code LIKE CONCAT (#{bizOrgCode}::text,'%')
and a.biz_org_code LIKE CONCAT (#{bizOrgCode},'%')
</if>
<if test="treeId != null and treeId != '' and treeId == '-1'">
and a.facilities_type is not null
......
......@@ -86,18 +86,18 @@
p_route b
WHERE
a.route_Id = b.id and a.is_delete = 0
<if test="planName!=null"> and a.name like concat('%',#{planName}::varchar,'%')</if>
<if test="planName!=null"> and a.name like 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('%',#{remark}::varchar,'%')</if>
<if test="orgCode!=null"> and (a.org_Code like concat (#{orgCode}::varchar,'-%')or a.org_code= #{orgCode})</if>
<if test="userId!=null"> and FIND_IN_SET(#{userId}::varchar,a.user_id)</if>
<if test="bizOrgCode!=null"> and b.biz_org_code like concat('%',#{bizOrgCode}::varchar,'%')</if>
<if test="remark!=null"> and a.remark1 like 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>
</select>
<!--巡检计划查询 -->
<select id="getPlanInfo" resultType="java.util.HashMap">
SELECT
a.id,a.name , IFNULL(a.plan_begin::varchar,'') planBegin,a.status,
a.id,a.name , IFNULL(a.plan_begin,'') planBegin,a.status,
(
case a.plan_type
when 1 THEN '天'
......@@ -112,7 +112,7 @@
else '是'
end
) as isFixedDateName,
IFNULL(a.plan_end::varchar,'') planEnd,a.plan_end planEnd,a.plan_type planType,
IFNULL(a.plan_end,'') planEnd,a.plan_end planEnd,a.plan_type planType,
b.name routeName,a.route_id routeId,a.is_fixed_date isFixedDate,a.remark,a.remark1,
b.dept_name bizOrgCode
FROM
......@@ -120,13 +120,13 @@
p_route b
WHERE
a.route_Id = b.id and a.is_delete = 0
<if test="planName!=null"> and a.name like concat('%',#{planName}::varchar,'%')</if>
<if test="planName!=null"> and a.name like 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('%',#{remark}::varchar,'%')</if>
<if test="orgCode!=null"> and (a.org_Code like concat (#{orgCode}::varchar,'-%')or a.org_code= #{orgCode})</if>
<if test="userId!=null"> and FIND_IN_SET(#{userId}::varchar,a.user_id)</if>
<if test="bizOrgCode!=null"> and b.biz_org_code like concat('%',#{bizOrgCode}::varchar,'%')</if>
<if test="remark!=null"> and a.remark1 like 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>
order by a.id desc
<choose>
......@@ -146,18 +146,18 @@
p_route b
WHERE
a.is_delete = 0 and a.route_Id = b.id
<if test="planName!=null"> and a.name like concat('%',#{planName}::varchar,'%')</if>
<if test="planName!=null"> and a.name like 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('%',#{remark}::varchar,'%')</if>
<if test="orgCode!=null"> and (a.org_code LIKE CONCAT(#{orgCode}::varchar, '-%' ) or a.org_code= #{orgCode} )</if>
<if test="userId!=null"> and FIND_IN_SET(#{userId}::varchar,a.user_id)</if>
<if test="bizOrgCode!=null"> and b.biz_org_code like concat(#{bizOrgCode}::varchar,'%')</if>
<if test="remark!=null"> and a.remark like 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>
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}::varchar,'%')
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">
......
......@@ -11,8 +11,8 @@
LEFT JOIN p_plan_task a ON a.id = b.task_no
LEFT JOIN p_point d ON d.id = b.point_id
<where>
<if test="pointNo!=null">and d.point_no like concat('%',#{pointNo}::varchar,'%')</if>
<if test="pointName!=null">and d.name like concat('%',#{pointName}::varchar,'%')</if>
<if test="pointNo!=null">and d.point_no like concat('%',#{pointNo},'%')</if>
<if test="pointName!=null">and d.name like concat('%',#{pointName},'%')</if>
<if test="beginDate!=null and endDate!=null and endDate != '' and beginDate != ''">
and a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate}
</if>
......@@ -25,9 +25,9 @@
<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}::varchar,'%')</if>
<if test="bizOrgCode!=null">and a.org_code like concat (#{bizOrgCode},'%')</if>
<if test="orgCode!=null">
and (a.org_Code like concat (#{orgCode}::varchar,'-%')or a.org_code= #{orgCode})
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()
......@@ -78,8 +78,8 @@
<include refid="planTaskInfoSql"/>
<where>
<if test="pointNo!=null">and d.point_no like concat('%',#{pointNo}::varchar,'%')</if>
<if test="pointName!=null">and d.name like concat('%',#{pointName}::varchar,'%')</if>
<if test="pointNo!=null">and d.point_no like concat('%',#{pointNo},'%')</if>
<if test="pointName!=null">and d.name like concat('%',#{pointName},'%')</if>
<if test="beginDate!=null and endDate!=null and endDate != '' and beginDate != ''">
and a.begin_Time <![CDATA[>=]]> #{beginDate} AND a.end_Time <![CDATA[<=]]> #{endDate}
</if>
......@@ -92,9 +92,9 @@
<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}::varchar,'%')</if>
<if test="bizOrgCode!=null">and a.org_code like concat (#{bizOrgCode},'%')</if>
<if test="orgCode!=null">
and (a.org_Code like concat (#{orgCode}::varchar,'-%')or a.org_code= #{orgCode})
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()
......@@ -285,7 +285,7 @@
<if test="checkDate != null and checkDate != '' "> and a.beginTime <![CDATA[<=]]> #{checkDate} and a.endTime <![CDATA[>=]]> #{checkDate} </if>
<if test="finishStatus != null"> and a.finishStatus = #{finishStatus}</if>
<if test="orgCode != null and orgCode !=''" >
and a.OrgCode LIKE CONCAT( #{orgCode}::text, '%' )
and a.OrgCode LIKE CONCAT( #{orgCode}, '%' )
</if>
<!-- <if test="departmentId != null and departmentId != 0 ">and a.userDept like concat('%', #{departmentId}, '%')</if>-->
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
......
......@@ -95,10 +95,10 @@
<where>
p.is_delete = 0
<if test="pointParams.pointNo != null and pointParams.pointNo != ''">
and p.point_no LIKE CONCAT ('%',#{pointParams.pointNo}::varchar,'%')
and p.point_no LIKE CONCAT ('%',#{pointParams.pointNo},'%')
</if>
<if test="pointParams.name != null and pointParams.name != ''">
and p.name LIKE CONCAT ('%',#{pointParams.name}::varchar,'%')
and p.name LIKE CONCAT ('%',#{pointParams.name},'%')
</if>
<if test="pointParams.isFixed != null and pointParams.isFixed != ''">
and p.is_fixed = #{pointParams.isFixed}
......@@ -107,7 +107,7 @@
and p.catalog_id = #{pointParams.catalogId}
</if>
<if test="pointParams.bizOrgCode != null and pointParams.bizOrgCode != ''">
and p.biz_org_code LIKE CONCAT (#{pointParams.bizOrgCode}::varchar,'%')
and p.biz_org_code LIKE CONCAT (#{pointParams.bizOrgCode},'%')
</if>
</where>
ORDER BY p.id DESC
......@@ -121,10 +121,10 @@
<where>
is_delete = 0
<if test="pointNo != null and pointNo != ''">
and point_no LIKE CONCAT ('%',#{pointNo}::text,'%')
and point_no LIKE CONCAT ('%',#{pointNo},'%')
</if>
<if test="name != null and name != ''">
and name LIKE CONCAT ('%',#{name}::text,'%')
and name LIKE CONCAT ('%',#{name},'%')
</if>
<if test="isFixed != null and isFixed != ''">
and is_fixed = #{isFixed}
......@@ -134,7 +134,7 @@
</if>
<if test="bizOrgCode != null and bizOrgCode != ''">
and biz_org_code LIKE CONCAT (#{bizOrgCode}::text ,'%')
and biz_org_code LIKE CONCAT (#{bizOrgCode} ,'%')
</if>
</where>
</select>
......@@ -203,12 +203,12 @@
)</if>
AND p.is_delete = 0
and ( select COUNT(p_point_inputitem.id) fROM p_point_inputitem where p_point_inputitem.point_id =p.id) >0
<if test="name!=null"> AND ( p.point_no LIKE CONCAT('%', #{name}::text,'%')
OR p.NAME LIKE CONCAT('%', #{name}::text,'%')) </if>
<if test="name!=null"> AND ( p.point_no LIKE CONCAT('%', #{name},'%')
OR p.NAME LIKE CONCAT('%', #{name},'%')) </if>
<if test="query != null and query != ''">
<choose>
<when test="queryType != null and (queryType == 'point' || queryType == 'all') ">
AND CONCAT(p. NAME, ',', p.point_no ) LIKE concat('%', #{query}::text, '%')
AND CONCAT(p. NAME, ',', p.point_no ) LIKE concat('%', #{query}, '%')
</when>
<otherwise>
AND EXISTS (
......@@ -220,20 +220,20 @@
WHERE
p.id = pi.point_id
<if test="queryType == null or queryType == '' or queryType == 'all' ">
AND CONCAT( ii. NAME, ',', p. NAME, ',', p.point_no ) LIKE concat('%', #{query}::text, '%')
AND CONCAT( ii. NAME, ',', p. NAME, ',', p.point_no ) LIKE concat('%', #{query}, '%')
</if>
<if test="queryType != null and queryType == 'inputItem' ">
AND ii. NAME LIKE concat('%', #{query}::text, '%')
AND ii. NAME LIKE concat('%', #{query}, '%')
</if>
<if test="queryType != null and queryType == 'point' ">
AND CONCAT(p. NAME, ',', p.point_no ) LIKE concat('%', #{query}::text, '%')
AND CONCAT(p. NAME, ',', p.point_no ) LIKE concat('%', #{query}, '%')
</if>
)
</otherwise>
</choose>
</if>
<!-- <if test="orgCode!=null "> and p.org_Code= #{orgCode} </if>-->
<if test="orgCode!=null "> and p.biz_org_code LIKE CONCAT (#{orgCode}::text ,'%') </if>
<if test="orgCode!=null "> and p.biz_org_code LIKE CONCAT (#{orgCode} ,'%') </if>
</where>
......@@ -261,14 +261,14 @@
AND p.is_delete = 0
and ( select COUNT(p_point_inputitem.id) fROM p_point_inputitem where p_point_inputitem.point_id =p.id) >0
<if test="name!=null"> AND ( p.point_no LIKE CONCAT('%', #{name}::text,'%')
OR p.NAME LIKE CONCAT('%', #{name}::text,'%')) </if>
<if test="name!=null"> AND ( p.point_no LIKE CONCAT('%', #{name},'%')
OR p.NAME LIKE CONCAT('%', #{name},'%')) </if>
<if test="query != null and query != ''">
<choose>
<when test="queryType != null and (queryType == 'point'|| queryType == 'all')">
AND CONCAT(p. NAME, ',', p.point_no ) LIKE concat('%', #{query}::text, '%')
AND CONCAT(p. NAME, ',', p.point_no ) LIKE concat('%', #{query}, '%')
</when>
<otherwise>
AND EXISTS (
......@@ -280,13 +280,13 @@
WHERE
p.id = pi.point_id
<if test="queryType == null or queryType == '' or queryType == 'all' ">
AND CONCAT( ii. NAME, ',', p. NAME, ',', p.point_no ) LIKE concat('%', #{query}::text, '%')
AND CONCAT( ii. NAME, ',', p. NAME, ',', p.point_no ) LIKE concat('%', #{query}, '%')
</if>
<if test="queryType != null and queryType == 'inputItem' ">
AND ii. NAME LIKE concat('%', #{query}::text, '%')
AND ii. NAME LIKE concat('%', #{query}, '%')
</if>
<if test="queryType != null and queryType == 'point' ">
AND CONCAT(p. NAME, ',', p.point_no ) LIKE concat('%', #{query}::text, '%')
AND CONCAT(p. NAME, ',', p.point_no ) LIKE concat('%', #{query}, '%')
</if>
)
</otherwise>
......@@ -317,7 +317,7 @@
</if>
<!-- <if test="orgCode!=null "> and p.org_Code= #{orgCode} </if>-->
<if test="orgCode!=null "> and p.biz_org_code LIKE CONCAT (#{orgCode}::text ,'%') </if>
<if test="orgCode!=null "> and p.biz_org_code LIKE CONCAT (#{orgCode} ,'%') </if>
</where>
limit #{offset},#{pageSize};
......@@ -486,7 +486,7 @@
(select status ,id FROM p_point
where is_delete = 0
<if test="orgCode!=null">
and (org_code LIKE CONCAT( #{orgCode}::text, '-%' ) or org_code= #{orgCode} )
and (org_code LIKE CONCAT( #{orgCode}, '-%' ) or org_code= #{orgCode} )
</if>
) vp
) tt group by tt.RealTimeStatus,tt.status order by status
......@@ -503,7 +503,7 @@
WHERE
check_time LIKE CONCAT( DATE_FORMAT( now( ), '%Y-%m-%d' ), '%' )
<if test="orgCode!=null">
and (org_code LIKE CONCAT('%',#{orgCode}::text,'%' ))
and (org_code LIKE CONCAT('%',#{orgCode},'%' ))
</if>
AND is_ok = 1
) AS over_num,
......@@ -515,7 +515,7 @@
WHERE
check_time LIKE CONCAT( DATE_FORMAT( now( ), '%Y-%m-%d' ), '%' )
<if test="orgCode!=null">
and (org_code LIKE CONCAT('%',#{orgCode}::text,'%' ))
and (org_code LIKE CONCAT('%',#{orgCode},'%' ))
</if>
AND is_ok = 2
) AS unfinish_num,
......@@ -527,7 +527,7 @@
WHERE
check_time LIKE CONCAT( DATE_FORMAT( now( ), '%Y-%m-%d' ), '%' )
<if test="orgCode!=null">
and (org_code LIKE CONCAT('%',#{orgCode}::text,'%' ))
and (org_code LIKE CONCAT('%',#{orgCode},'%' ))
</if>
AND is_ok = 3
) AS miss_num,
......@@ -539,7 +539,7 @@
WHERE
( p_plan_task.check_date LIKE concat( curdate( ), '%' ) )
<if test="orgCode!=null">
and (org_code LIKE CONCAT('%',#{orgCode}::text,'%' ))
and (org_code LIKE CONCAT('%',#{orgCode},'%' ))
</if>
) AS today_num
</select>
......@@ -559,7 +559,7 @@
(select DISTINCT is_ok as realTimeStatus ,point_id FROM p_check
<where>
<if test="orgCode!=null">
and (org_code LIKE CONCAT( #{orgCode}::text, '-%' ) or org_code= #{orgCode} )
and (org_code LIKE CONCAT( #{orgCode}, '-%' ) or org_code= #{orgCode} )
</if>
</where>
) vp
......@@ -585,7 +585,7 @@
(select status ,id FROM p_point
where is_delete = 0
<if test="orgCode!=null">
and biz_org_code LIKE CONCAT( #{orgCode}::text, '%' )
and biz_org_code LIKE CONCAT( #{orgCode}, '%' )
</if>
) vp
) tt group by tt.RealTimeStatus,tt.status order by status
......@@ -1491,7 +1491,7 @@
WHERE
pp.is_delete = 0
<if test="pointName != null and pointName != ''">
AND pp.name like concat('%', #{pointName}::varchar, '%')
AND pp.name like concat('%', #{pointName}, '%')
</if>
<if test="pointId != null">
AND pp.id != #{pointId}
......
......@@ -88,10 +88,10 @@
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}::text, '%')</if>
<if test="remark!=null">AND r.remark LIKE CONCAT('%', #{remark}::text, '%')</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}::text, '%') </if>
<if test="bizOrgCode!=null">AND r.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%') </if>
<!-- <if test="deptId!=null">AND r.dept_id = #{deptId}</if> -->
<choose>
......@@ -117,13 +117,13 @@
p_route r
WHERE
r.is_delete = 0
<if test="id!=null">AND r.id LIKE CONCAT('%', #{id}::text, '%')</if>
<if test="name!=null">AND r.name LIKE CONCAT('%', #{name}::text, '%')</if>
<if test="remark!=null">AND r.remark LIKE CONCAT('%', #{remark}::text, '%')</if>
<if test="id!=null">AND r.id LIKE CONCAT('%', #{id}, '%')</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="enterpriseType!=null">AND r.enterprise_type = #{enterpriseType}</if>
<if test="equipType!=null">AND r.equip_type = #{equipType}</if>
<if test="bizOrgCode!=null">AND r.biz_org_code LIKE CONCAT( #{bizOrgCode}::text, '%') </if>
<if test="bizOrgCode!=null">AND r.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%') </if>
<choose>
<when test="deptId > 0 " > AND r.dept_id = #{deptId}</when>
<when test="deptId == -1 " > AND r.dept_id in(0,-1)</when>
......@@ -196,7 +196,7 @@
LEFT JOIN p_route r ON r.id = ppl.route_id
WHERE
r.is_delete = 0
AND find_in_set(#{userId}, ppl.user_id) > 0 and r.biz_org_code LIKE CONCAT( #{orgCode}::text, '%')
AND find_in_set(#{userId}, ppl.user_id) > 0 and r.biz_org_code LIKE CONCAT( #{orgCode}, '%')
</if>
<if test="(orgCode != null and orgCode != '')">
......@@ -211,7 +211,7 @@
WHERE
r.is_delete = 0
<if test="orgCode != null and orgCode != ''">
AND r.biz_org_code LIKE CONCAT( #{orgCode}::text, '%')
AND r.biz_org_code LIKE CONCAT( #{orgCode}, '%')
</if>
</if>) temp
......@@ -266,8 +266,8 @@
where p.is_delete = 0
AND rp.route_id = #{routeId}
AND p.org_code = #{orgCode}
<if test="pointNo != null and pointNo != ''">and p.point_no like CONCAT('%', #{pointNo}::text, '%')</if>
<if test="name != null and name != ''">and p.name like CONCAT('%', #{name}::text, '%')</if>
<if test="pointNo != null and pointNo != ''">and p.point_no like CONCAT('%', #{pointNo}, '%')</if>
<if test="name != null and name != ''">and p.name like CONCAT('%', #{name}, '%')</if>
<choose>
<when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
......@@ -310,8 +310,8 @@
AND rp.route_id = #{routeId}
AND p.org_code = #{orgCode}
order by rp.order_no
<if test="pointNo != null and pointNo != ''">and p.point_no like CONCAT('%', #{pointNo}::text, '%')</if>
<if test="name != null and name != ''">and p.name like CONCAT('%', #{name}::text, '%')</if>
<if test="pointNo != null and pointNo != ''">and p.point_no like CONCAT('%', #{pointNo}, '%')</if>
<if test="name != null and name != ''">and p.name like CONCAT('%', #{name}, '%')</if>
<choose>
<when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
......@@ -444,8 +444,8 @@
and ppc.id = #{classifyId}
</if>
<if test="inputName!=null and inputName !=''">
and (pii.name like CONCAT('%', #{inputName}::varchar, '%')
or pii.item_no like CONCAT('%', #{inputName}::varchar, '%'))
and (pii.name like CONCAT('%', #{inputName}, '%')
or pii.item_no like CONCAT('%', #{inputName}, '%'))
</if>
<if test="isBound!=null and isBound !=''">
and temp.routePointItemId >0
......@@ -455,7 +455,7 @@
</select>
<select id="queryRoutesByOrgCode" resultType="com.yeejoin.amos.patrol.dao.entity.Route">
SELECT * FROM p_route r where r.is_delete = 0 and r.biz_org_code like CONCAT( #{orgCode}::varchar, '%')
SELECT * FROM p_route r where r.is_delete = 0 and r.biz_org_code like CONCAT( #{orgCode}, '%')
</select>
<!--如果查询的点下没有检查项 返回一个标识 -->
......@@ -468,7 +468,7 @@
left join p_route_point prp on prp.route_id = r.id
left join p_route_point_item prpi on prpi.route_point_id = prp.id
WHERE
r.is_delete = 0 and r.biz_org_code like CONCAT( #{orgCode}::varchar, '%')
r.is_delete = 0 and r.biz_org_code like CONCAT( #{orgCode}, '%')
GROUP BY r.id
order by r.create_date DESC
</select>
......
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