Commit 9edc8b71 authored by dlkong's avatar dlkong

风险巡查岗位新增时返回主键id

parent f44b10c3
...@@ -89,7 +89,7 @@ public class CurrentRiskPostController extends BaseController ...@@ -89,7 +89,7 @@ public class CurrentRiskPostController extends BaseController
{ {
Long currentRiskPostId = currentRiskPost.getId(); Long currentRiskPostId = currentRiskPost.getId();
if(currentRiskPostId == null){ if(currentRiskPostId == null){
currentRiskPostService.insertCurrentRiskPost(currentRiskPost); int id = currentRiskPostService.insertCurrentRiskPost(currentRiskPost);
currentRiskPostId = currentRiskPost.getId(); currentRiskPostId = currentRiskPost.getId();
}else{ }else{
currentRiskPostService.updateCurrentRiskPost(currentRiskPost); currentRiskPostService.updateCurrentRiskPost(currentRiskPost);
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
where id = #{id} where id = #{id}
</select> </select>
<insert id="insertCurrentRiskPost" parameterType="com.censoft.censoftrongtong.domain.CurrentRiskPost" useGeneratedKeys="true"> <insert id="insertCurrentRiskPost" parameterType="com.censoft.censoftrongtong.domain.CurrentRiskPost" useGeneratedKeys="true" keyProperty="id">
insert into current_risk_post insert into current_risk_post
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if> <if test="id != null">id,</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment