id
,pole_code,pole_name,
device_type,user_id,client_id,
province,city,region,
address,lon,lat,
device_code,on_line_state,binding_count,
create_time,update_time
UPDATE pole
SET device_code=null
WHERE id = #{id}
SELECT
t1.*
FROM
pole t1
LEFT JOIN pole_group_relation t2 ON t1.id = t2.pole_id
LEFT JOIN pole_group t3 ON t3.group_id = t2.pole_group_id
AND (t1.user_id = #{userid} OR t1.client_id = #{userid})
AND ( t1.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
OR t1.device_code LIKE CONCAT(CONCAT('%', #{keyword}), '%'))
AND t1.device_type = -1
AND t1.device_type != -1
AND t3.group_id = #{groupid}
AND t1.user_id != -1
AND t1.user_id = -1
GROUP BY t1.id
ORDER BY ${orderBy}
SELECT
t1.*
FROM
pole t1
LEFT JOIN pole_group_relation t2 ON t1.id = t2.pole_id
LEFT JOIN pole_group t3 ON t3.group_id = t2.pole_group_id
AND (t1.user_id = #{userid} OR t1.client_id = #{userid})
AND ( t1.id LIKE CONCAT(CONCAT('%', #{keyword}), '%')
OR t1.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%'))
GROUP BY t1.id