业务逻辑
业主管理根据手机号查询账号是否存在,如存在则不能注册
SELECT count(0) FROM `property_owner` where phone = "2"
添加车辆
根据前端输入的手机号查询业主id
select id from property_owner where phone="1"
带着id插入到车辆表
INSERT INTO `car_manage`( `user_id`, `brand`, `model`, `create_time`) VALUES (#{id}, 'qw', 'qwf', '2023-05-09 10:31:13');
查询车辆管理信息
用户表的id关联车辆表的user_id
select c.id, c.user_id, c.brand, c.model, c.create_time,u.name from car_manage c join property_owner u on u.id=c.user_id
继承业主实体
public class CarManage extends PropertyOwner