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
<?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="cn.wisenergy.mapper.WorkDeptMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.wisenergy.model.app.WorkDept">
<id column="id" property="id" />
<result column="dept_name" property="deptName" />
<result column="oa_dept_id" property="oaDeptId"/>
<result column="centre_id" property="centreId"/>
<result column="dept_manager_id" property="deptManagerId"/>
<result column="create_time" property="createTime" />
<result column="modify_time" property="modifyTime" />
</resultMap>
<sql id="table">
work_dept
</sql>
<sql id="cols_all">
id, <include refid="cols_exclude_id"/>
</sql>
<sql id="cols_exclude_id">
dept_name, create_time, modify_time
</sql>
<sql id="criteria">
<if test="id != null">AND id = #{id}</if>
<if test="deptName != null">AND dept_name = #{deptName}</if>
<if test="oaDeptId != null">AND oa_dept_id = #{oaDeptId}</if>
<if test="centreId != null">AND centre_id = #{centreId}</if>
<if test="deptManagerId != null">AND dept_manager_id = #{deptManagerId}</if>
<if test="createTime != null">AND create_time = #{createTime}</if>
<if test="modifyTime != null">AND modify_time = #{modifyTime}</if>
</sql>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id,dept_name, oa_dept_id,centre_id, dept_name, create_time, modify_time
</sql>
<select id="getDeptByCondition" resultMap="BaseResultMap" parameterType="integer">
select <include refid="cols_all"/>
from <include refid="table"/>
<where>
<include refid="criteria"/>
</where>
</select>
</mapper>