<?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.buy507.mall.dao.TmsRolelistDao">
    <!--<resultMap id="TmsRolelistMap" type="com.buy507.mall.model.TmsRolelist">-->
        <!--<id column="id" jdbcType="BIGINT" property="id" />&lt;!&ndash;主鍵 ID &ndash;&gt;-->
        <!--<result column="name" jdbcType="VARCHAR" property="name"/>&lt;!&ndash;名称 &ndash;&gt;-->
        <!--<result column="description" jdbcType="VARCHAR" property="description"/>&lt;!&ndash;描述 &ndash;&gt;-->
        <!--<result column="admin_count" jdbcType="INTEGER" property="admincount"/>&lt;!&ndash;后台用户数量 &ndash;&gt;-->
        <!--<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />&lt;!&ndash;创建时间 &ndash;&gt;-->
        <!--<result column="status" jdbcType="INTEGER" property="status"/>&lt;!&ndash;启用状态：0->禁用；1->启用&ndash;&gt;-->
    <!--</resultMap>-->
    <select id="selectAll" resultType="java.util.HashMap">
        SELECT
              m.id as id,
              m.name as name,
              m.description as description,
              m.admin_count as admincount,
              DATE_FORMAT(m.create_time,'%Y-%m-%d %H:%i:%s') as createTime,
              m.status as status
          FROM ums_role m
    </select>

    <select id="selectPermissionId" resultType="java.util.HashMap">
        SELECT
              pms.name as name,
              pms.value as value,
              pms.icon as icon,
              pms.type as type,
              pms.uri as uri,
              pms.status as status,
              DATE_FORMAT(pms.create_time,'%Y-%m-%d %H:%i:%s') as createTime
          FROM
              ums_permission pms
          LEFT JOIN
              ums_role_permission_relation rp ON rp.permission_id = pms.id
          WHERE
              rp.role_id = #{Id}



    </select>

</mapper>