Blame view

src/main/resources/mapper/SysYxSchoolMapper.xml 3.17 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="create_time" jdbcType="TIMESTAMP" property="createTime" />
  </resultMap>
  <sql id="Base_Column_List">
e5f98c16   徐泉   招生咨询会
11
12
    id, school_name, school_type, create_time
  </sql>
21d1bd0f   徐泉   招生咨询会
13
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
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
    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 school_name = #{schoolName}
21d1bd0f   徐泉   招生咨询会
45
      </if>
e5f98c16   徐泉   招生咨询会
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
      <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>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
21d1bd0f   徐泉   招生咨询会
69
70
71
72
73
74
75
76
77
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="schoolName != null">
        #{schoolName,jdbcType=VARCHAR},
      </if>
      <if test="schoolType != null">
        #{schoolType,jdbcType=INTEGER},
      </if>
e5f98c16   徐泉   招生咨询会
78
79
80
81
82
83
84
85
86
87
88
89
90
91
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </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>
21d1bd0f   徐泉   招生咨询会
92
93
94
95
96
97
98
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>
e5f98c16   徐泉   招生咨询会

21d1bd0f   徐泉   招生咨询会

e5f98c16   徐泉   招生咨询会