select
dbmdp.maint_detail_project_id,
dbmdp.bills_maint_detail_id,
dbmdp.maint_project_id,
COALESCE(dbmdp.maint_project_name, dbmp.maint_project_name) as maint_project_name,
COALESCE(dbmdp.maint_project_desc, dbmp.maint_project_desc) as maint_project_desc,
dbmdp.maint_project_status,
dbmdp.remark,
dbmdp.create_time
from
dms_bills_maint_detail_project dbmdp
left join dms_base_maint_project dbmp on dbmdp.maint_project_id = dbmp.maint_project_id