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
<?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.yifu.cloud.plus.v1.yifu.salary.mapper.TOwnDeptMapper">
<resultMap id="tOwnDeptMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.TOwnDept">
<id property="id" column="id"/>
<result property="deptId" column="dept_id"/>
<result property="deptNo" column="dept_no"/>
<result property="deptName" column="dept_name"/>
<result property="unitName" column="unit_name"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.dept_id,
a.dept_no,
a.dept_name,
a.unit_name
</sql>
<sql id="tOwnDept_where">
<if test="tOwnDept != null">
<if test="tOwnDept.id != null">
AND a.id = #{tOwnDept.id}
</if>
<if test="tOwnDept.deptId != null and tOwnDept.deptId.trim() != ''">
AND a.dept_id = #{tOwnDept.deptId}
</if>
<if test="tOwnDept.deptNo != null and tOwnDept.deptNo.trim() != ''">
AND a.dept_no = #{tOwnDept.deptNo}
</if>
<if test="tOwnDept.deptName != null and tOwnDept.deptName.trim() != ''">
AND a.dept_name = #{tOwnDept.deptName}
</if>
<if test="tOwnDept.unitName != null and tOwnDept.unitName.trim() != ''">
AND a.unit_name = #{tOwnDept.unitName}
</if>
</if>
</sql>
<!--tOwnDept简单分页查询-->
<select id="getTOwnDeptPage" resultMap="tOwnDeptMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_own_dept a
<where>
1=1
<include refid="tOwnDept_where"/>
</where>
</select>
<!--tOwnDept简单list查询-->
<select id="getTOwnDeptIdList" resultType="String">
SELECT a.dept_id FROM t_own_dept a
</select>
<!--获取自有员工身份证-->
<select id="getOwnEmpList" resultType="String">
SELECT EMP_IDCARD FROM view_own_employee
</select>
</mapper>