mysqlmybatis返回插入的主键id_MySQL
时间:2021-07-01 10:21:17
帮助过:35人阅读
bitsCN.com
mysql mybatis返回插入的主键id [html] insert into T_Company_Info (Company_Id, IsFranchisee, Company_Code, Company_Name) values (#{companyId}, #{isfranchisee}, #{companyCode}, #{companyName}) SELECT LAST_INSERT_ID() AS ID 在执行插入之后执行,查询到 主键id[html] SELECT LAST_INSERT_ID() AS ID 通过对象 com.yjf.entity.TCompanyInfo.companyId 取得主键[java] company.getCompanyId() bitsCN.com