and mld.host_id = #{host_id}
and mld.loc_no like concat('%',#{loc_no},'%')
and mld.loc_no like concat('%',#{loc_no},'%')
and mld.matnr like concat('%',#{matnr},'%')
and mld.maktx like concat('%',#{maktx},'%')
and mld.update_time between #{startTime} and #{endTime}
select * from man_node where 1=1 and uuid=#{uuid} and host_id = #{hostId} and status = 1
select * from
(
SELECT
ROW_NUMBER() over (order by mld.create_time desc) as row,
mld.*
FROM man_loc_detl mld
LEFT JOIN man_node mn ON mld.node_id = mn.id
LEFT JOIN man_mat mm ON mld.matnr = mm.matnr
LEFT JOIN man_tag mt ON mm.tag_id = mt.id
WHERE 1=1
AND (CHARINDEX(','+#{node_id}+',', ','+mn.path+',') > 0 OR mn.id = #{node_id})
AND (CHARINDEX(','+#{tag_id}+',', ','+mt.path+',') > 0 OR mt.id = #{tag_id})
) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
select
count(1)
FROM man_loc_detl mld
LEFT JOIN man_node mn ON mld.node_id = mn.id
LEFT JOIN man_mat mm ON mld.matnr = mm.matnr
LEFT JOIN man_tag mt ON mm.tag_id = mt.id
WHERE 1=1
AND (CHARINDEX(','+#{node_id}+',', ','+mn.path+',') > 0 OR mn.id = #{node_id})
AND (CHARINDEX(','+#{tag_id}+',', ','+mt.path+',') > 0 OR mt.id = #{tag_id})