Commit 3e634363 authored by Zhang's avatar Zhang

Upload New File

parent 3cb945bd
package com.mybatis.mapper;
package com.mybatis.mapper;
import com.mybatis.handle.ContentTypeHandler;
import com.mybatis.model.User;
import org.apache.ibatis.annotations.*;
import java.util.List;
@Mapper
public interface UserMapper {
@Insert("INSERT INTO USERTEST(NAME,SEX,HOBBY) VALUES (#{name},#{sex}," +
"#{hobby,typeHandler=com.mybatis.handle.ContentTypeHandler})")
int insert(User user);
@Insert({
"<script>",
"insert into USERTEST(name, sex, hobby) values ",
"<foreach collection='list' item='item' separator=','>",
"(#{item.name}, #{item.sex}, #{item.hobby,typeHandler=com.mybatis.handle.ContentTypeHandler})",
"</foreach>",
"</script>"
})
boolean batchInsert(@Param(value="list")List<User> list);
}
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