<?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.engine.organization.mapper.jclimport.ImportMapper">


    <select id="getImportFields" resultType="com.engine.organization.entity.jclimport.po.HrmFormFieldPO">
        select a.fieldid, a.fieldname, b.labelname, a.issystem, a.ismand
        from hrm_formfield a
                 inner join htmllabelinfo b on a.fieldlabel = b.indexid and b.languageid = #{languageId}
                 inner join hrm_fieldgroup c on a.groupid = c.id
        where a.fieldhtmltype != '6' and c.grouptype = #{groupType}
          and a.isuse = 1
    </select>
    <select id="getImportFieldInfo" resultType="com.engine.organization.entity.jclimport.po.HrmFormFieldPO">
        select a.fieldid,
               a.fieldname,
               b.labelname,
               a.issystem,
               a.ismand,
               a.fielddbtype,
               a.fieldhtmltype,
               a.type,
               a.dmlurl
        from hrm_formfield a
                 inner join htmllabelinfo b on a.fieldlabel = b.indexid and b.languageid = #{languageId}
                 inner join hrm_fieldgroup c on a.groupid = c.id
        where a.fieldhtmltype != '6' and c.grouptype = #{groupType}
          and b.labelname = #{labelName}
          and a.isuse = 1
    </select>
    <select id="getResourceExceptedFields" resultType="java.lang.String">
        select FIELDNAME
        from cus_formdict
        where id in (select fieldid
                     from cus_formfield
                     where scope = 'HrmCustomFieldByInfoType'
                       and scopeid = 3
                       and dmlUrl in ('sequenceBrowser', 'schemeBrowser', 'LevelBrowser', 'gradeBrowser')
                     union
                     select fieldid
                     from cus_formfield
                     where scope = 'HrmCustomFieldByInfoType'
                       and hrm_fieldlable = '职等职级'
                       and scopeid = 3
                       and dmlUrl = (select max(mainid) from mode_customtreedetail where tablename = 'v_jcl_zdzjs'))
    </select>
</mapper>