Commit b3024cf7 by jiangyun

修改

parent 34954166
......@@ -110,4 +110,12 @@ public class SjLjzjyfzqkController extends BaseController
{
return toAjax(sjLjzjyfzqkService.insertSjLjzjyfzqkBatch(list));
}
@PostMapping("/pladd3")
public AjaxResult pladd3(@RequestBody List<SjLjzjyfzqk> list) throws Exception
{
return toAjax(sjLjzjyfzqkService.pladd3(list));
}
}
......@@ -65,4 +65,6 @@ public interface SjLjzjyfzqkMapper
int insertSjLjzjyfzqkBatch(List<SjLjfzqk> jsqaList);
int insertSjLjzjyfzqkBatch2(List<SjLjzjyfzqk> list);
}
......@@ -63,4 +63,5 @@ public interface ISjLjzjyfzqkService
int insertSjLjzjyfzqkBatch(List<SjLjjw> list);
int pladd3(List<SjLjzjyfzqk> list);
}
......@@ -129,4 +129,14 @@ public class SjLjzjyfzqkServiceImpl implements ISjLjzjyfzqkService
return 1;
}
@Override
public int pladd3(List<SjLjzjyfzqk> list) {
String jh = list.get(0).getJh();
SjDjjc sjDjjc = sjDjjcMapper.selectSjDjjcByJh(jh);
//先删除已有数据
sjLjzjyfzqkMapper.deleteSjLjzjyfzqkByZbid(sjDjjc.getId());
sjLjzjyfzqkMapper.insertSjLjzjyfzqkBatch2(list);
return 1;
}
}
......@@ -81,6 +81,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</foreach>
</insert>
<insert id="insertSjLjzjyfzqkBatch2">
<foreach collection="list" item="item" separator=";">
insert into sj_ljzjyfzqk
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="item.jh != null">jh,</if>
<if test="item.ljjh != null">ljjh,</if>
<if test="item.jl != null">jl,</if>
<if test="item.sj != null">sj,</if>
<if test="item.wzjs != null">wzjs,</if>
<if test="item.fzqk != null">fzqk,</if>
<if test="item.zbid != null">zbid,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="item.jh != null">#{item.jh},</if>
<if test="item.ljjh != null">#{item.ljjh},</if>
<if test="item.jl != null">#{item.jl},</if>
<if test="item.sj != null">#{item.sj},</if>
<if test="item.wzjs != null">#{item.wzjs},</if>
<if test="item.fzqk != null">#{item.fzqk},</if>
<if test="item.zbid != null">#{item.zbid},</if>
</trim>
</foreach>
</insert>
<update id="updateSjLjzjyfzqk" parameterType="SjLjzjyfzqk">
update sj_ljzjyfzqk
......
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