insert into business_inspection_point
(inspection_id,machine_id,operate,remark,inspection_name,community_id,b_id)
values
(#{inspectionId},#{machineId},#{operate},#{remark},#{inspectionName},#{communityId},#{bId})
select t.inspection_id,t.inspection_id inspectionId,t.machine_id,t.machine_id
machineId,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
from business_inspection_point t
where 1 =1
and t.inspection_id= #{inspectionId}
and t.machine_id= #{machineId}
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,machine_id,remark,status_cd,inspection_name,community_id,b_id
) select t.inspection_id,t.machine_id,t.remark,'0',t.inspection_name,t.community_id,t.b_id from
business_inspection_point t where 1=1
and t.inspection_id= #{inspectionId}
and t.machine_id= #{machineId}
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.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
inner join machine m on t.machine_id = m.machine_id and m.status_cd = 0
inner join t_dict d on d.status_cd = m.location_type_cd
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 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
limit #{page}, #{row}
update inspection_point t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.machine_id= #{machineId}
, 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.machine_id= #{machineId}
and t.remark= #{remark}
and t.status_cd= #{statusCd}
and t.inspection_name= #{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
inner join machine m on t.machine_id = m.machine_id and m.status_cd = 0
inner join t_dict d on d.status_cd = m.location_type_cd
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_route_id = #{inspectionRouteId}
and c.inspection_id is null
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
limit #{page}, #{row}
select count(1) count
from inspection_point t
inner join machine m on t.machine_id = m.machine_id and m.status_cd = 0
inner join t_dict d on d.status_cd = m.location_type_cd
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_route_id = #{inspectionRouteId}
and c.inspection_id is null
and t.inspection_id= #{inspectionId}
and t.machine_id= #{machineId}
and t.remark= #{remark}
and t.status_cd= #{statusCd}
and t.inspection_name= #{inspectionName}
and t.community_id= #{communityId}
and t.b_id= #{bId}