- 1、动态sql插入及将主键task_id注入到实体类taskId属性中
@Insert({"<script>"," insert into "+ TableUtils.CLOUD_TASK_TABLE+
"<trim prefix=\"(\" suffix=\")\" suffixOverrides=\",\" >" +
" <if test=\"nUserId != null\" > n_user_id, </if>" +
..........
" </trim>" +
" <trim prefix=\"values (\" suffix=\")\" suffixOverrides=\",\" >" +
" <if test=\"nUserId != null\" > #{nUserId}, </if>" +
.......
" </trim>", "</script>"})
@Options(useGeneratedKeys = true, keyProperty = "taskId", keyColumn = "task_id")//将主键task_id注入到实体类taskId属性中
Integer releaseTask(CloudTaskDT