select d.id, d.upload_code, d.upload_date, d.upload_type, d.content, d.dept_id ,s.dept_name from t_uploadhistory d left join sys_dept s on s.dept_id = d.dept_id SELECT seq_t_uploadhistory.NEXTVAL as id FROM DUAL insert into t_uploadhistory id, upload_code, upload_date, upload_type, content, dept_id, #{id}, #{uploadCode}, #{uploadDate}, #{uploadType}, #{content}, #{deptId}, update t_uploadhistory upload_code = #{uploadCode}, upload_date = #{uploadDate}, upload_type = #{uploadType}, content = #{content}, dept_id = #{deptId}, where id = #{id}