insert into business_inspection_point
(inspection_id,operate,remark,inspection_name,community_id,b_id,point_obj_type,point_obj_id,point_obj_name)
values
(#{inspectionId},#{operate},#{remark},#{inspectionName},#{communityId},#{bId},#{pointObjType},#{pointObjId},#{pointObjName})
select t.inspection_id,t.inspection_id inspectionId,t.operate,t.remark,t.inspection_name,t.inspection_name inspectionName,
t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.point_obj_type,t.point_obj_id,t.point_obj_name,
t.point_obj_type pointObjType,t.point_obj_id pointObjId,t.point_obj_name pointObjName
from business_inspection_point t
where 1 =1
and t.inspection_id= #{inspectionId}
and t.operate= #{operate}
and t.remark= #{remark}
and t.inspection_name like concat('%',#{inspectionName},'%')
and t.community_id= #{communityId}
and t.b_id= #{bId}
insert into
inspection_point(
inspection_id,remark,status_cd,inspection_name,community_id,b_id,
point_obj_type,point_obj_id,point_obj_name
) select t.inspection_id,t.remark,'0',t.inspection_name,t.community_id,t.b_id,
t.point_obj_type,t.point_obj_id,t.point_obj_name
from
business_inspection_point t where 1=1
and t.inspection_id= #{inspectionId}
and t.operate= 'ADD'
and t.remark= #{remark}
and t.inspection_name= #{inspectionName}
and t.community_id= #{communityId}
and t.b_id= #{bId}
select
t.inspection_id,t.inspection_id inspectionId,t.remark,t.status_cd,t.status_cd statusCd,
t.inspection_name,t.inspection_name inspectionName,t.community_id,
t.community_id communityId,t.b_id,t.b_id bId,
t.point_obj_type,t.point_obj_id,t.point_obj_name,
t.point_obj_type pointObjType,t.point_obj_id pointObjId,t.point_obj_name pointObjName
from inspection_point t
left join inspection_route_point_rel c on t.inspection_id = c.inspection_id
and c.status_cd = '0'
and c.inspection_route_id is null
where 1 =1
and t.inspection_id= #{inspectionId}
and t.point_obj_type= #{pointObjType}
and t.remark= #{remark}
and t.status_cd= #{statusCd}
and t.inspection_name like concat('%',#{inspectionName},'%')
and t.community_id= #{communityId}
and t.b_id= #{bId}
group by t.inspection_id
order by t.create_time desc
limit #{page}, #{row}
update inspection_point t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.point_obj_type= #{pointObjType}
, t.point_obj_id= #{pointObjId}
, t.point_obj_name= #{pointObjName}
, t.remark= #{remark}
, t.inspection_name= #{inspectionName}
, t.community_id= #{communityId}
where 1=1
and t.inspection_id= #{inspectionId}
and t.b_id= #{bId}
select count(1) count
from inspection_point t
left join inspection_route_point_rel c on t.inspection_id = c.inspection_id
and c.status_cd = '0'
and c.inspection_route_id is null
where 1 =1
and t.inspection_id= #{inspectionId}
and t.point_obj_type= #{pointObjType}
and t.remark= #{remark}
and t.status_cd= #{statusCd}
and t.inspection_name like concat('%',#{inspectionName},'%')
and t.community_id= #{communityId}
and t.b_id= #{bId}
select
t.inspection_id,t.inspection_id inspectionId,t.remark,t.status_cd,t.status_cd statusCd,
t.inspection_name,t.inspection_name inspectionName,t.community_id,
t.community_id communityId,t.b_id,t.b_id bId,
t.point_obj_type,t.point_obj_id,t.point_obj_name,
t.point_obj_type pointObjType,t.point_obj_id pointObjId,t.point_obj_name pointObjName
d.name locationTypeName
from inspection_point t
left join inspection_route_point_rel c on t.inspection_id = c.inspection_id and c.status_cd = '0' and c.inspection_route_id = #{inspectionRouteId}
where 1 =1
and c.inspection_id is not null
and c.inspection_id is null
and t.inspection_id= #{inspectionId}
and t.point_obj_type= #{pointObjType}
and t.remark= #{remark}
and t.status_cd= #{statusCd}
and t.inspection_name like concat('%',#{inspectionName},'%')
and t.community_id= #{communityId}
and t.b_id= #{bId}
order by t.create_time desc
limit #{page}, #{row}
select count(1) count
from inspection_point t
left join inspection_route_point_rel c on t.inspection_id = c.inspection_id and c.status_cd = '0' and c.inspection_route_id = #{inspectionRouteId}
where 1 =1
and c.inspection_id is not null
and c.inspection_id is null
and t.inspection_id= #{inspectionId}
and t.point_obj_type= #{pointObjType}
and t.remark= #{remark}
and t.status_cd= #{statusCd}
and t.inspection_name like concat('%',#{inspectionName},'%')
and t.community_id= #{communityId}
and t.b_id= #{bId}
select
t.inspection_id,t.inspection_id inspectionId,t.machine_id,
t.machine_id machineId,t.remark,t.status_cd,t.status_cd statusCd,
t.inspection_name,t.inspection_name inspectionName,t.community_id,
t.community_id communityId,t.b_id,t.b_id bId,
m.machine_code machineCode,m.machine_name machineName,location_type_cd locationTypeCd,location_obj_id
locationObjId,m.machine_id machineId,
d.name locationTypeName
from inspection_point t,machine m,t_dict d,inspection_route_point_rel c,inspection_plan ip
where 1 =1
and t.machine_id = m.machine_id
and m.status_cd = 0
and d.status_cd = m.location_type_cd
and d.table_name = 'machine'
and d.table_columns = 'location_type_cd'
and t.inspection_id = c.inspection_id
and c.status_cd = '0'
and c.inspection_route_id = ip.inspection_route_id
and ip.inspection_plan_id = #{inspectionPlanId}
and t.inspection_id= #{inspectionId}
and m.machine_code= #{machineCode}
and t.remark= #{remark}
and t.status_cd= #{statusCd}
and t.inspection_name like concat('%',#{inspectionName},'%')
and t.community_id= #{communityId}
and t.b_id= #{bId}
group by t.inspection_id
order by t.create_time desc