ecfunctiontreenodemapper.xml 3.62 KB
Newer Older
hulei committed
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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
<?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.brilliance.isc.mda.dao.EcFunctionTreeNodeMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.bo.EcFunctionTreeNode">
        <result property="id" column="ID" jdbcType="INTEGER"/>
        <result property="name" column="NAME" jdbcType="VARCHAR"/>
        <result property="description" column="DESCRIPTION" jdbcType="VARCHAR"/>
        <result property="type" column="TYPE" jdbcType="VARCHAR"/>
        <result property="resource" column="RESOURCES" jdbcType="VARCHAR"/>
        <result property="authorityScript" column="AUTHORITYSCRIPT" jdbcType="VARCHAR"/>
        <result property="parentNodeId" column="PARENTNODEID" jdbcType="INTEGER"/>
        <result property="orders" column="ORDERS" jdbcType="INTEGER"/>
        <result property="state" column="STATE" jdbcType="INTEGER"/>
        <result property="treeId" column="TREEID" jdbcType="INTEGER"/>
        <result property="menuType" column="MENUTYPE" jdbcType="INTEGER"/>
        <result property="entity" column="ENTITY" jdbcType="VARCHAR"/>
        <result property="icon" column="ICON" jdbcType="VARCHAR"/>
        <result property="isDisablePageOpt" column="ISDISABLEPAGEOPT" jdbcType="INTEGER"/>
        <result property="isConfigurable" column="isConfigurable" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        ID,NAME,DESCRIPTION,TYPE,RESOURCES,AUTHORITYSCRIPT,PARENTNODEID,ORDERS,STATE,TREEID,MENUTYPE,ENTITY,ICON,ISDISABLEPAGEOPT,isConfigurable
    </sql>

    <select id="listByIds" resultMap="BaseResultMap">
        select
            <include refid="Base_Column_List" />
        from ec_functiontreenode
        where id in
        <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
            #{item}
        </foreach>
    </select>

    <update id="updateConfigurableByNameAndParentId">
        update ec_functiontreenode
        <set>
            isConfigurable = #{isConfigurable,jdbcType=VARCHAR},
        </set>
        where NAME = #{name} and PARENTNODEID = #{parentNodeId}
    </update>

    <select id="selectByNameAndParentId" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from ec_functiontreenode
        where NAME = #{name} and PARENTNODEID = #{parentNodeId}
    </select>

    <select id="listQuickAccessConfig" resultMap="BaseResultMap">
        select
            a.ID id,
            a.NAME name,
            a.DESCRIPTION description,
            a.type type,
            a.RESOURCES resource,
            a.AUTHORITYSCRIPT authorityScript,
            a.PARENTNODEID parentNodeId,
            a.ORDERS orders,
            a.STATE state,
            a.TREEID treeId,
            a.MENUTYPE menuType,
            a.ENTITY entity,
            a.ICON icon,
            a.ISDISABLEPAGEOPT isDisablePageOpt,
            a.isConfigurable isConfigurable
        from
            ec_functiontreenode a
        left join FPRI_RRLKM b on
            a.ID = b.RESOURCE_ID
        where
            a.isConfigurable = 'Y'
            and b.STATE = '1'
            and b.ROLE_ID = #{roleid}
    </select>

    <select id="listByIdOrParentId" resultMap="BaseResultMap">
        select * from ec_functiontreenode where id = #{id} or PARENTNODEID = #{id}
    </select>

    <select id="selectByOrdersAndParentId" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from ec_functiontreenode
        where ORDERS = #{orders} and PARENTNODEID = #{parentNodeId}
    </select>

</mapper>