<?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.personnels.mapper.FtbPersonnelsRegistrationFormFieldMapper">


    <sql id="Base_Column_List">
        SELECT a.F_Id                 AS id,
               a.F_FormTypeId         AS formTypeId,
               a.F_Name               AS name,
               a.F_SystemType         AS systemType,
               a.F_Type               AS type,
               a.F_IsUpdateManager    AS isUpdateManager,
               a.F_IsUpdateWorker     AS isUpdateWorker,
               a.F_IsAllowStop        AS isAllowStop,
               a.F_AllowNeedFill      AS allowNeedFill,
               a.F_IsNeedFill         AS isNeedFill,
               a.F_IsRegisterFormShow AS isRegisterFormShow,
               a.F_OptionType         AS optionType,
               a.F_Sorts              AS sorts,
               a.F_Rules              AS rules,
               a.F_Tag                AS tag,
               a.F_Limit              AS `limit`,
               a.F_Status             AS `status`,
               a.F_GroupName          AS groupName,
               a.F_EnabledMark        AS enabledMark,
               a.F_CreatorUserId      AS creatorUserId,
               a.F_CreatorTime        AS creationTime,
               a.F_LastModifyUserId   AS lastModifyUserId,
               a.F_LastModifyTime     AS lastModificationTime,
               a.F_DeleteUserId       AS deleteUserId,
               a.F_DeleteTime         AS deletionTime,
               a.F_TenantId           AS tenantId,
               a.F_IsVisibleWorker    AS isVisibleWorker
        FROM ftb_personnels_registration_form_field as a
    </sql>
    <!--分页查询人事注册表单字段-->
    <select id="pagingQuery"
            resultType="jnpf.model.personnels.dto.staff.field.FtbPersonnelsRegistrationFormFieldDto">
        <include refid="Base_Column_List"></include>

        <where>
            a.F_EnabledMark = 0 and a.F_FormTypeId != '5'
            <if test="params.typeId!= null and params.typeId !=''">
                and a.F_FormTypeId =#{params.typeId}
            </if>
            <if test="params.name!= null and params.name !=''">
                and a.F_Name like concat('%',#{params.name},'%')
            </if>
            <if test="params.status != null ">
                and a.F_Status =#{params.status}
            </if>
            <if test="params.isNeedFill != null">
                and a.F_IsNeedFill =#{params.isNeedFill}
            </if>
        </where>
        order by a.F_Sorts desc

    </select>

</mapper>