1.对应xml文件
<insert id="insert" parameterType="DetectStandard"
useGeneratedKeys="true" keyColumn="id" keyProperty="id">
insert into t_detect_standard
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="standardCode != null" >
standard_code,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="standardCode != null" >
#{standardCode,jdbcType=VARCHAR},
</if>
</trim>
</insert>
2.后台对应获取主键ID:
//添加检测标准
detectStandardMapper.insert(ds);
int standardId = ds.getId();//获得标准ID


相关文章:

  • 2021-09-16
  • 2022-03-05
  • 2021-08-12
  • 2022-12-23
  • 2021-09-02
  • 2021-05-25
猜你喜欢
  • 2021-07-01
  • 2022-12-23
  • 2022-02-01
  • 2021-08-28
  • 2021-08-31
  • 2022-12-23
相关资源
相似解决方案