1.控制层
@ApiOperation(value = "根据数据id查询子数据列表") @GetMapping("insertDate") public Result insertDate() { dictService.insertDate(); return Result.ok(); }
2.业务层接口
void insertDate();
3.业务层实现类
4.dao层
void insertDate(@Param("tableName") String tableName, @Param("com") List<String> com, @Param("values") List<String> values);
5.XML
<insert id="insertDate"> insert into ${tableName} <foreach collection="com" item="item" separator="," open="(" close=")"> ${item} </foreach> values <foreach collection="values" item="item" separator="," open="(" close=")"> #{item} </foreach> </insert>
6.postman
7.代码运行结果
8.数据库结果