1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3+ <mapper namespace =" com.ipman.springboot.transactional.sample.core.dao.User1Mapper" >
4+ <resultMap id =" BaseResultMap" type =" com.ipman.springboot.transactional.sample.common.domain.model.User1" >
5+ <id column =" id" property =" id" jdbcType =" INTEGER" />
6+ <result column =" name" property =" name" jdbcType =" VARCHAR" />
7+ </resultMap >
8+ <sql id =" Base_Column_List" >
9+ id, `name`
10+ </sql >
11+ <select id =" selectByPrimaryKey" resultMap =" BaseResultMap" parameterType =" java.lang.Integer" >
12+ select
13+ <include refid =" Base_Column_List" />
14+ from user1
15+ where id = #{id,jdbcType=INTEGER}
16+ </select >
17+ <delete id =" deleteByPrimaryKey" parameterType =" java.lang.Integer" >
18+ delete from user1
19+ where id = #{id,jdbcType=INTEGER}
20+ </delete >
21+ <insert id =" insert" parameterType =" com.ipman.springboot.transactional.sample.common.domain.model.User1" >
22+ <selectKey resultType =" java.lang.Integer" keyProperty =" id" order =" BEFORE" >
23+ SELECT LAST_INSERT_ID()
24+ </selectKey >
25+ insert into user1 (id, `name`)
26+ values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR})
27+ </insert >
28+ <insert id =" insertSelective" parameterType =" com.ipman.springboot.transactional.sample.common.domain.model.User1" >
29+ <selectKey resultType =" java.lang.Integer" keyProperty =" id" order =" BEFORE" >
30+ SELECT LAST_INSERT_ID()
31+ </selectKey >
32+ insert into user1
33+ <trim prefix =" (" suffix =" )" suffixOverrides =" ," >
34+ id,
35+ <if test =" name != null" >
36+ `name`,
37+ </if >
38+ </trim >
39+ <trim prefix =" values (" suffix =" )" suffixOverrides =" ," >
40+ #{id,jdbcType=INTEGER},
41+ <if test =" name != null" >
42+ #{name,jdbcType=VARCHAR},
43+ </if >
44+ </trim >
45+ </insert >
46+ <update id =" updateByPrimaryKeySelective" parameterType =" com.ipman.springboot.transactional.sample.common.domain.model.User1" >
47+ update user1
48+ <set >
49+ <if test =" name != null" >
50+ `name` = #{name,jdbcType=VARCHAR},
51+ </if >
52+ </set >
53+ where id = #{id,jdbcType=INTEGER}
54+ </update >
55+ <update id =" updateByPrimaryKey" parameterType =" com.ipman.springboot.transactional.sample.common.domain.model.User1" >
56+ update user1
57+ set `name` = #{name,jdbcType=VARCHAR}
58+ where id = #{id,jdbcType=INTEGER}
59+ </update >
60+ </mapper >
0 commit comments