select zdtm.id, zdtm.name, zdtm.serial_no, zdtm.model, zdtm.ip, zdtm.mac, zdtm.version, zdtm.address, zdtm.status, zdtm.printer_status, zdtm.have_paper_num, zdtm.password, zdtm.create_by, zdtm.create_time, zdtm.status_time, zdtm.printer_status_time, zdtm.dept_id, zdtm.scenic_id, zs.scenic_name from zdy_device_ticket_machine zdtm left join zdy_scenic zs on zs.id = zdtm.scenic_id insert into zdy_device_ticket_machine name, serial_no, model, ip, mac, version, address, status, printer_status, have_paper_num, password, create_by, create_time, status_time, printer_status_time, dept_id, scenic_id, #{name}, #{serialNo}, #{model}, #{ip}, #{mac}, #{version}, #{address}, #{status}, #{printerStatus}, #{havePaperNum}, #{password}, #{createBy}, #{createTime}, #{statusTime}, #{printerStatusTime}, #{deptId}, #{scenicId}, update zdy_device_ticket_machine name = #{name}, serial_no = #{serialNo}, model = #{model}, ip = #{ip}, mac = #{mac}, version = #{version}, address = #{address}, status = #{status}, printer_status = #{printerStatus}, have_paper_num = #{havePaperNum}, password = #{password}, create_by = #{createBy}, create_time = #{createTime}, status_time = #{statusTime}, printer_status_time = #{printerStatusTime}, dept_id = #{deptId}, scenic_id = #{scenicId}, where id = #{id} update zdy_device_ticket_machine name = #{name}, model = #{model}, ip = #{ip}, mac = #{mac}, version = #{version}, address = #{address}, status = #{status}, printer_status = #{printerStatus}, have_paper_num = #{havePaperNum}, password = #{password}, create_by = #{createBy}, create_time = #{createTime}, status_time = #{statusTime}, printer_status_time = #{printerStatusTime}, dept_id = #{deptId}, scenic_id = #{scenicId}, where serial_no = #{serialNo} update zdy_device_ticket_machine set have_paper_num = have_paper_num - #{ticketNum} where serial_no = #{serialNo} delete from zdy_device_ticket_machine where id = #{id} delete from zdy_device_ticket_machine where id in #{id}