select door_id, area_id, device_name, brand, device_id, device_port, login_username, login_password_cipher, door_no, time_section_no, device_charset, enabled, online_status, del_flag, remark, create_by, create_time, update_by, update_time from t_door_device select d.door_id, d.area_id, a.area_name, d.device_name, d.brand, d.device_id, d.device_port, d.login_username, case when d.login_password_cipher is not null and d.login_password_cipher <> '' then 1 else 0 end as password_configured, d.door_no, d.time_section_no, d.device_charset, d.enabled, d.online_status, d.remark, d.create_time from t_door_device d left join t_visit_area a on a.area_id = d.area_id and a.del_flag = '0' insert into t_door_device ( area_id, device_name, brand, device_id, device_port, login_username, login_password_cipher, door_no, time_section_no, device_charset, enabled, online_status, remark, create_by, create_time ) values ( #{areaId}, #{deviceName}, #{brand}, #{deviceId}, #{devicePort}, #{loginUsername}, #{loginPasswordCipher}, #{doorNo}, #{timeSectionNo}, #{charset}, #{enabled}, #{onlineStatus}, #{remark}, #{createBy}, sysdate() ) update t_door_device set area_id = #{areaId}, device_name = #{deviceName}, brand = #{brand}, device_id = #{deviceId}, device_port = #{devicePort}, login_username = #{loginUsername}, login_password_cipher = #{loginPasswordCipher}, door_no = #{doorNo}, time_section_no = #{timeSectionNo}, device_charset = #{charset}, enabled = #{enabled}, remark = #{remark}, update_by = #{updateBy}, update_time = sysdate() where door_id = #{doorId} and del_flag = '0' update t_door_device set enabled = #{enabled}, update_by = #{updateBy}, update_time = sysdate() where del_flag = '0' and door_id in #{doorId} update t_door_device set online_status = #{onlineStatus}, update_by = #{updateBy}, update_time = sysdate() where del_flag = '0' and door_id in #{doorId} update t_door_device set del_flag = '1', update_by = #{updateBy}, update_time = sysdate() where del_flag = '0' and door_id in #{doorId}