old mode 100644
new mode 100755
| | |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="privilegeDAOImpl"> |
| | | |
| | | <select id="queryUserDefaultPrivilege" parameterType="map" resultType="map"> |
| | | SELECT a.`p_id` pId,a.`privilege_flag` privilegeFlag,a.`user_id` userId FROM p_privilege_user a WHERE a.`p_id` = |
| | | #{pId} |
| | |
| | | <!-- 保存属性信息 c_business_attrs --> |
| | | <insert id="saveUserDefaultPrivilege" parameterType="Map"> |
| | | <![CDATA[ |
| | | INSERT INTO p_privilege_user(p_id,privilege_flag,user_id,store_id) VALUES(#{pId},'1',#{userId},#{storeId}) |
| | | INSERT INTO p_privilege_user(p_id,privilege_flag,user_id,store_id) VALUES(#{pId},'1',#{userId},#{storeId}) |
| | | ]]> |
| | | </insert> |
| | | |
| | |
| | | INSERT INTO p_privilege_group(pg_id,`name`,description,store_id,domain) |
| | | VALUES(#{pgId},#{name},#{description},#{storeId},#{storeTypeCd}) |
| | | </insert> |
| | | |
| | | |
| | | <update id="updatePrivilegeGroup" parameterType="Map"> |
| | | UPDATE p_privilege_group a SET |
| | |
| | | <if test="storeTypeCd != null and storeTypeCd != ''"> |
| | | and a.domain= #{storeTypeCd} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 删除权限组 --> |
| | | <update id="deletePrivilegeGroup" parameterType="Map"> |
| | | UPDATE p_privilege_group a SET a.`status_cd` = '1' |
| | |
| | | <if test="storeTypeCd != null and storeTypeCd != ''"> |
| | | and a.domain= #{storeTypeCd} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 删除权限组 --> |
| | |
| | | AND ppr.`status_cd` = '0' |
| | | AND pp.`status_cd` = '0' |
| | | AND ppr.`pg_id` = #{pgId} |
| | | |
| | | </select> |
| | | |
| | | <select id="queryPrivilegeGroup" parameterType="Map" resultType="Map"> |
| | |
| | | and ppg.domain = #{storeTypeCd} |
| | | </if> |
| | | and ppg.status_cd = '0' |
| | | |
| | | </select> |
| | | |
| | | <insert id="addPrivilegeRel" parameterType="Map"> |
| | | insert into p_privilege_rel(p_id,pg_id) |
| | | values(#{pId},#{pgId}) |
| | | </insert> |
| | | |
| | | <!-- 查询权限 --> |
| | | <select id="queryPrivilege" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | |
| | | </if> |
| | | AND pp.`status_cd` = '0' |
| | | </select> |
| | | |
| | | <!-- 查询用户权限 --> |
| | | <select id="queryUserPrivilege" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | |
| | | </if> |
| | | AND ppu.`status_cd` = '0' |
| | | </select> |
| | | |
| | | <!-- 保存属性信息 c_business_attrs --> |
| | | <insert id="addUserPrivilege" parameterType="Map"> |
| | | <![CDATA[ |
| | | INSERT INTO p_privilege_user(p_id,privilege_flag,user_id,store_id) VALUES(#{pId},#{privilegeFlag},#{userId},#{storeId}) |
| | | INSERT INTO p_privilege_user(p_id,privilege_flag,user_id,store_id) VALUES(#{pId},#{privilegeFlag},#{userId},#{storeId}) |
| | | ]]> |
| | | </insert> |
| | | |
| | |
| | | INNER JOIN p_privilege p on t.p_id = p.p_id and p.status_cd = '0' |
| | | where t.privilege_flag = '0' |
| | | and t.status_cd = '0' |
| | | and p.resource = #{resource} |
| | | and t.store_id = #{storeId} |
| | | <if test="resource != null and resource != ''"> |
| | | and p.resource = #{resource} |
| | | </if> |
| | | <if test="storeId != null and storeId != ''"> |
| | | and t.store_id = #{storeId} |
| | | </if> |
| | | union ALL |
| | | select t.user_id userId |
| | | from p_privilege_user t |
| | |
| | | INNER JOIN p_privilege p on pr.p_id = p.p_id and p.status_cd = '0' |
| | | where t.status_cd = '0' |
| | | and t.privilege_flag = '1' |
| | | and p.resource = #{resource} |
| | | and t.store_id = #{storeId} |
| | | <if test="resource != null and resource != ''"> |
| | | and p.resource = #{resource} |
| | | </if> |
| | | <if test="storeId != null and storeId != ''"> |
| | | and t.store_id = #{storeId} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |