Blame view

src/main/resources/mapper/SysYxSchoolMapper.xml 3.99 KB
e5f98c16   徐泉   招生咨询会
1
2
3
4
5
6
7
<?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" />
21d1bd0f   徐泉   招生咨询会
8
9
10
    <result column="province" jdbcType="VARCHAR" property="province" />
    <result column="city" jdbcType="VARCHAR" property="city" />
    <result column="area" jdbcType="VARCHAR" property="area" />
e5f98c16   徐泉   招生咨询会
11
12
  </resultMap>
  <sql id="Base_Column_List">
21d1bd0f   徐泉   招生咨询会
13
    id, school_name, school_type, create_time,province,city,area
e5f98c16   徐泉   招生咨询会
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
  </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>
21d1bd0f   徐泉   招生咨询会
45
      <if test="schoolName != null and schoolName !=''">
e5f98c16   徐泉   招生咨询会
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
        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>
21d1bd0f   徐泉   招生咨询会
69
70
71
72
73
74
75
76
77
      <if test="province != null">
        province,
      </if>
      <if test="city != null">
        city,
      </if>
      <if test="area != null">
        area,
      </if>
e5f98c16   徐泉   招生咨询会
78
79
80
81
82
83
84
85
86
87
88
89
90
91
    </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>
21d1bd0f   徐泉   招生咨询会
92
93
94
95
96
97
98
99
100
      <if test="province != null">
        #{province,jdbcType=VARCHAR},
      </if>
      <if test="city != null">
        #{city,jdbcType=VARCHAR},
      </if>
      <if test="area != null">
        #{area,jdbcType=VARCHAR},
      </if>
e5f98c16   徐泉   招生咨询会
101
102
103
104
105
106
107
108
109
110
111
112
113
114
    </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>
21d1bd0f   徐泉   招生咨询会
115
116
117
118
119
120
121
122
123
      <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>
e5f98c16   徐泉   招生咨询会
124
125
126
127
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>