DockingManMapper.xml
2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.project.demo.mapper.DockingManMapper">
<resultMap id="dockingManMap" type="com.project.demo.domain.DockingMan">
<result column="id" property="id" />
<result column="name" property="name" />
<result column="position" property="position" />
<result column="projects_id" property="projectsId" />
<result column="gender" property="gender" />
<result column="mobile" property="mobile" />
<result column="corporate_name" property="corporateName" />
<result column="industry" property="industry" />
</resultMap>
<select id="search" resultMap="dockingManMap" resultType="Map">
SELECT
*
FROM docking_man
where 1=1
<if test="params.projectsId != null">
AND projects_id = #{params.projectsId}
</if>
</select>
<delete id="delete">
DELETE FROM docking_man where id = #{id}
</delete>
<insert id="insert" parameterType="com.project.demo.domain.SalesMan">
insert into docking_man
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">
name,
</if>
<if test="position != null">
position,
</if>
<if test="projectsId != null">
projects_id,
</if>
<if test="gender != null">
gender,
</if>
<if test="mobile != null">
mobile,
</if>
<if test="corporateName != null">
corporate_name,
</if>
<if test="industry != null">
industry,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">
#{name},
</if>
<if test="position != null">
#{position},
</if>
<if test="projectsId != null">
#{projectsId},
</if>
<if test="gender != null">
#{gender},
</if>
<if test="mobile != null">
#{mobile},
</if>
<if test="corporateName != null">
#{corporateName},
</if>
<if test="industry != null">
#{industry},
</if>
</trim>
</insert>
</mapper>