create view ` v_damage_damage_type` as
select d.id as id,
d.description as description,
d.location as location,
d.post_date as post_date,
d.post_user as post_user,
d.railway as railway,
d.status as status,
dt.type_name as type_name,
dt.type_description = type_description
from inspection.damage d join inspection.damage_type dt on d.id = dt.id;
- 创建完视图之后要在对应的mapper的xml文件中添加include
<sql id="Task_Process_List">
t.task_id, t.damage_id, t.receive_date, t.deadline, t.status, t.receiver, d.post_date,
d.location, d.description
</sql>