<?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="jnpf.notice.mapper.FtbNoticeManagerMapper">

    <resultMap id="BaseResultMap" type="jnpf.model.notice.domain.FtbNoticeManager">
        <id property="id" column="F_Id" jdbcType="VARCHAR"/>
        <result property="userId" column="F_UserId" jdbcType="VARCHAR"/>
        <result property="enabledMark" column="F_EnabledMark" jdbcType="INTEGER"/>
        <result property="creatorUserId" column="F_CreatorUserId" jdbcType="VARCHAR"/>
        <result property="creatorTime" column="F_CreatorTime" jdbcType="TIMESTAMP"/>
        <result property="lastModifyUserId" column="F_LastModifyUserId" jdbcType="VARCHAR"/>
        <result property="lastModifyTime" column="F_LastModifyTime" jdbcType="TIMESTAMP"/>
        <result property="tenantId" column="F_TenantId" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        F_Id
        ,F_UserId,F_EnabledMark,
        F_CreatorUserId,F_CreatorTime,F_LastModifyUserId,
        F_LastModifyTime,F_DeleteUserId,F_DeleteTime,
        F_TenantId
    </sql>
    <!--分页查询通知公告管理员列表-->
    <select id="pagingQuery" resultType="jnpf.model.notice.dto.FtbNoticeManagerDto">

        select manager.F_Id as id,
        manager.F_UserId as userId,
        manager.F_CreatorTime as creatorTime,
        roster.F_Name as userName,
        roster.F_Id as rosterId,
        roster.F_WorkerStatus as workerStatus
        from ftb_notice_manager as manager
        join ftb_personnels_staff_roster as roster
        on manager.F_UserId = roster.F_UserId and roster.F_EnabledMark = 0 and
        roster.F_WorkerStatus !='305'
        where manager.F_EnabledMark = 1
        <if test="params.keyWord!= null and params.keyWord!= ''">
            and roster.F_Name like CONCAT('%',#{params.keyWord},'%')
        </if>
        order by manager.F_CreatorTime desc
    </select>
</mapper>
