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.wishuok.mapper.UserMapper" >
4
+ <resultMap id =" BaseResultMap" type =" com.wishuok.pojo.User" >
5
+ <id column =" id" jdbcType =" VARCHAR" property =" id" />
6
+ <result column =" UserName" jdbcType =" VARCHAR" property =" username" />
7
+ <result column =" Sex" jdbcType =" INTEGER" property =" sex" />
8
+ <result column =" AccountType" jdbcType =" INTEGER" property =" accounttype" />
9
+ </resultMap >
10
+ <sql id =" Base_Column_List" >
11
+ id, UserName, Sex, AccountType
12
+ </sql >
13
+ <select id =" selectByPrimaryKey" parameterType =" java.lang.String" resultMap =" BaseResultMap" >
14
+ select
15
+ <include refid =" Base_Column_List" />
16
+ from user
17
+ where id = #{id,jdbcType=VARCHAR}
18
+ </select >
19
+ <delete id =" deleteByPrimaryKey" parameterType =" java.lang.String" >
20
+ delete from user
21
+ where id = #{id,jdbcType=VARCHAR}
22
+ </delete >
23
+ <insert id =" insert" parameterType =" com.wishuok.pojo.User" >
24
+ insert into user (id, UserName, Sex,
25
+ AccountType)
26
+ values (#{id,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{sex,jdbcType=INTEGER},
27
+ #{accounttype,jdbcType=INTEGER})
28
+ </insert >
29
+ <insert id =" insertSelective" parameterType =" com.wishuok.pojo.User" >
30
+ insert into user
31
+ <trim prefix =" (" suffix =" )" suffixOverrides =" ," >
32
+ <if test =" id != null" >
33
+ id,
34
+ </if >
35
+ <if test =" username != null" >
36
+ UserName,
37
+ </if >
38
+ <if test =" sex != null" >
39
+ Sex,
40
+ </if >
41
+ <if test =" accounttype != null" >
42
+ AccountType,
43
+ </if >
44
+ </trim >
45
+ <trim prefix =" values (" suffix =" )" suffixOverrides =" ," >
46
+ <if test =" id != null" >
47
+ #{id,jdbcType=VARCHAR},
48
+ </if >
49
+ <if test =" username != null" >
50
+ #{username,jdbcType=VARCHAR},
51
+ </if >
52
+ <if test =" sex != null" >
53
+ #{sex,jdbcType=INTEGER},
54
+ </if >
55
+ <if test =" accounttype != null" >
56
+ #{accounttype,jdbcType=INTEGER},
57
+ </if >
58
+ </trim >
59
+ </insert >
60
+ <update id =" updateByPrimaryKeySelective" parameterType =" com.wishuok.pojo.User" >
61
+ update user
62
+ <set >
63
+ <if test =" username != null" >
64
+ UserName = #{username,jdbcType=VARCHAR},
65
+ </if >
66
+ <if test =" sex != null" >
67
+ Sex = #{sex,jdbcType=INTEGER},
68
+ </if >
69
+ <if test =" accounttype != null" >
70
+ AccountType = #{accounttype,jdbcType=INTEGER},
71
+ </if >
72
+ </set >
73
+ where id = #{id,jdbcType=VARCHAR}
74
+ </update >
75
+ <update id =" updateByPrimaryKey" parameterType =" com.wishuok.pojo.User" >
76
+ update user
77
+ set UserName = #{username,jdbcType=VARCHAR},
78
+ Sex = #{sex,jdbcType=INTEGER},
79
+ AccountType = #{accounttype,jdbcType=INTEGER}
80
+ where id = #{id,jdbcType=VARCHAR}
81
+ </update >
82
+ </mapper >
0 commit comments