TOwnDeptMapper.xml 2.14 KB
Newer Older
hongguangwu's avatar
hongguangwu committed
1 2 3
<?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">
fangxinjiang's avatar
fangxinjiang committed
4 5 6 7 8 9 10
    <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>
hongguangwu's avatar
hongguangwu committed
11
    <sql id="Base_Column_List">
fangxinjiang's avatar
fangxinjiang committed
12 13 14 15 16 17
             a.id,
                  a.dept_id,
                  a.dept_no,
                  a.dept_name,
                  a.unit_name
         </sql>
hongguangwu's avatar
hongguangwu committed
18 19
    <sql id="tOwnDept_where">
        <if test="tOwnDept != null">
fangxinjiang's avatar
fangxinjiang committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
            <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>
hongguangwu's avatar
hongguangwu committed
35 36 37 38 39 40 41 42 43 44 45 46
        </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>
fangxinjiang's avatar
fangxinjiang committed
47 48 49 50 51 52
    <!--tOwnDept简单list查询-->
    <select id="getTOwnDeptIdList" resultType="String">
        SELECT a.dept_id FROM t_own_dept a
    </select>
    <!--获取自有员工身份证-->
    <select id="getOwnEmpList" resultType="String">
hongguangwu's avatar
hongguangwu committed
53
		SELECT EMP_IDCARD FROM view_own_employee
fangxinjiang's avatar
fangxinjiang committed
54
    </select>
hongguangwu's avatar
hongguangwu committed
55
</mapper>