insert into bm_unit_person
unit_id,
user_id,
company_id,
create_time,
#{unitId},
#{userId},
#{companyId},
#{createTime},
delete from bm_unit_person where unit_id = #{unitId}
SELECT
bu.unit_id AS unitId,
bu.unit_name AS unitName,
bu.STATUS AS STATUS,
bu.type_id AS typeId,
bu.link_man AS linkMan,
bu.telphone AS telphone,
bu.dept_id AS deptId,
bu.del_flag AS delFlag,
bu.create_by AS createBy,
bu.create_time AS createTime,
bu.update_by AS updateBy,
bu.update_time AS updateTime,
bu.remark AS remark,
bup.user_id as userId
FROM
bm_unit bu
left join bm_unit_person bup ON bu.unit_id = bup.unit_id
WHERE
bu.del_flag = 0
and bu.unit_name like concat('%', #{unitName}, '%')