SysYxSchoolMapper.xml
3.99 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<?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.sincere.student.mapper.SysYxSchoolMapper">
<resultMap id="BaseResultMap" type="com.sincere.student.model.yx.SysYxSchool">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="school_name" jdbcType="VARCHAR" property="schoolName" />
<result column="school_type" jdbcType="INTEGER" property="schoolType" />
<result column="province" jdbcType="VARCHAR" property="province" />
<result column="city" jdbcType="VARCHAR" property="city" />
<result column="area" jdbcType="VARCHAR" property="area" />
</resultMap>
<sql id="Base_Column_List">
id, school_name, school_type, create_time,province,city,area
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_yx_school
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_yx_school
where id = #{id,jdbcType=INTEGER}
</delete>
<select id="selectList" parameterType="com.sincere.student.dto.yx.AddYxSchoolVo" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from sys_yx_school
<where>
<if test="schoolName != null and schoolName !=''">
and school_name = #{schoolName}
</if>
<if test="schoolType != null">
and school_type = #{schoolType}
</if>
</where>
</select>
<select id="getListCount" parameterType="com.sincere.student.dto.yx.AddYxSchoolVo" resultType="java.lang.Integer">
select
count(0)
from sys_yx_school
<where>
<if test="schoolName != null and schoolName !=''">
and school_name = #{schoolName}
</if>
<if test="schoolType != null">
and school_type = #{schoolType}
</if>
</where>
</select>
<insert id="insertSelective" parameterType="com.sincere.student.model.yx.SysYxSchool">
insert into sys_yx_school
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="schoolName != null">
school_name,
</if>
<if test="schoolType != null">
school_type,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="province != null">
province,
</if>
<if test="city != null">
city,
</if>
<if test="area != null">
area,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="schoolName != null">
#{schoolName,jdbcType=VARCHAR},
</if>
<if test="schoolType != null">
#{schoolType,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="province != null">
#{province,jdbcType=VARCHAR},
</if>
<if test="city != null">
#{city,jdbcType=VARCHAR},
</if>
<if test="area != null">
#{area,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sincere.student.model.yx.SysYxSchool">
update sys_yx_school
<set>
<if test="schoolName != null">
school_name = #{schoolName,jdbcType=VARCHAR},
</if>
<if test="schoolType != null">
school_type = #{schoolType,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="province != null">
province = #{province,jdbcType=VARCHAR},
</if>
<if test="city != null">
city = #{city,jdbcType=VARCHAR},
</if>
<if test="area != null">
area = #{area,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>