新增权限管理相关接口
This commit is contained in:
@@ -56,6 +56,8 @@ secure:
|
||||
- /druid/**
|
||||
- /admin/login
|
||||
- /admin/register
|
||||
- /admin/info
|
||||
- /admin/logout
|
||||
- /minio/upload
|
||||
aliyun:
|
||||
oss:
|
||||
|
||||
@@ -74,9 +74,6 @@
|
||||
oi.product_price item_product_price,
|
||||
oi.product_quantity item_product_quantity,
|
||||
oi.product_attr item_product_attr,
|
||||
oi.sp1 item_sp1,
|
||||
oi.sp2 item_sp2,
|
||||
oi.sp3 item_sp3,
|
||||
oh.id history_id,
|
||||
oh.operate_man history_operate_man,
|
||||
oh.create_time history_create_time,
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
l.id ladder_id,l.product_id ladder_product_id,l.discount ladder_discount,l.count ladder_count,l.price ladder_price,
|
||||
pf.id full_id,pf.product_id full_product_id,pf.full_price full_full_price,pf.reduce_price full_reduce_price,
|
||||
m.id member_id,m.product_id member_product_id,m.member_level_id member_member_level_id,m.member_price member_member_price,m.member_level_name member_member_level_name,
|
||||
s.id sku_id,s.product_id sku_product_id,s.price sku_price,s.low_stock sku_low_stock,s.pic sku_pic,s.sale sku_sale,s.sku_code sku_sku_code,s.sp1 sku_sp1,s.sp2 sku_sp2,s.sp3 sku_sp3,s.stock sku_stock,
|
||||
s.id sku_id,s.product_id sku_product_id,s.price sku_price,s.low_stock sku_low_stock,s.pic sku_pic,s.sale sku_sale,s.sku_code sku_sku_code,s.stock sku_stock,s.sp_data sku_sp_data,
|
||||
a.id attribute_id,a.product_id attribute_product_id,a.product_attribute_id attribute_product_attribute_id,a.value attribute_value
|
||||
FROM pms_product p
|
||||
LEFT JOIN pms_product_category pc on pc.id = p.product_category_id
|
||||
|
||||
@@ -2,22 +2,20 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.macro.mall.dao.PmsSkuStockDao">
|
||||
<insert id="insertList">
|
||||
INSERT INTO pms_sku_stock (product_id, sku_code, price, stock, low_stock, sp1, sp2, sp3, pic, sale) VALUES
|
||||
INSERT INTO pms_sku_stock (product_id, sku_code, price, stock, low_stock, pic, sale, sp_data) VALUES
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(#{item.productId,jdbcType=BIGINT},
|
||||
#{item.skuCode,jdbcType=VARCHAR},
|
||||
#{item.price,jdbcType=DECIMAL},
|
||||
#{item.stock,jdbcType=INTEGER},
|
||||
#{item.lowStock,jdbcType=INTEGER},
|
||||
#{item.sp1,jdbcType=VARCHAR},
|
||||
#{item.sp2,jdbcType=VARCHAR},
|
||||
#{item.sp3,jdbcType=VARCHAR},
|
||||
#{item.pic,jdbcType=VARCHAR},
|
||||
#{item.sale,jdbcType=INTEGER})
|
||||
#{item.sale,jdbcType=INTEGER},
|
||||
#{item.spData,jdbcType=VARCHAR})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="replaceList">
|
||||
REPLACE INTO pms_sku_stock (id,product_id, sku_code, price, stock, low_stock, sp1, sp2, sp3, pic, sale) VALUES
|
||||
REPLACE INTO pms_sku_stock (id,product_id, sku_code, price, stock, low_stock,pic, sale, sp_data) VALUES
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(#{item.id,jdbcType=BIGINT},
|
||||
#{item.productId,jdbcType=BIGINT},
|
||||
@@ -25,11 +23,9 @@
|
||||
#{item.price,jdbcType=DECIMAL},
|
||||
#{item.stock,jdbcType=INTEGER},
|
||||
#{item.lowStock,jdbcType=INTEGER},
|
||||
#{item.sp1,jdbcType=VARCHAR},
|
||||
#{item.sp2,jdbcType=VARCHAR},
|
||||
#{item.sp3,jdbcType=VARCHAR},
|
||||
#{item.pic,jdbcType=VARCHAR},
|
||||
#{item.sale,jdbcType=INTEGER})
|
||||
#{item.sale,jdbcType=INTEGER},
|
||||
#{item.spData,jdbcType=VARCHAR})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -52,4 +52,23 @@
|
||||
pr.type = 1
|
||||
AND pr.admin_id = #{adminId}
|
||||
</select>
|
||||
<select id="getResourceList" resultType="com.macro.mall.model.UmsResource">
|
||||
SELECT
|
||||
ur.id id,
|
||||
ur.create_time createTime,
|
||||
ur.`name` `name`,
|
||||
ur.url url,
|
||||
ur.description description,
|
||||
ur.category_id categoryId
|
||||
FROM
|
||||
ums_admin_role_relation ar
|
||||
LEFT JOIN ums_role r ON ar.role_id = r.id
|
||||
LEFT JOIN ums_role_resource_relation rrr ON r.id = rrr.role_id
|
||||
LEFT JOIN ums_resource ur ON ur.id = rrr.resource_id
|
||||
WHERE
|
||||
ar.admin_id = #{adminId}
|
||||
AND ur.id IS NOT NULL
|
||||
GROUP BY
|
||||
ur.id
|
||||
</select>
|
||||
</mapper>
|
||||
64
mall-admin/src/main/resources/dao/UmsRoleDao.xml
Normal file
64
mall-admin/src/main/resources/dao/UmsRoleDao.xml
Normal file
@@ -0,0 +1,64 @@
|
||||
<?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.macro.mall.dao.UmsRoleDao">
|
||||
|
||||
<select id="getMenuList" resultType="com.macro.mall.model.UmsMenu">
|
||||
SELECT
|
||||
m.id id,
|
||||
m.parent_id parentId,
|
||||
m.create_time createTime,
|
||||
m.title title,
|
||||
m.level level,
|
||||
m.sort sort,
|
||||
m.name name,
|
||||
m.icon icon,
|
||||
m.hidden hidden
|
||||
FROM
|
||||
ums_admin_role_relation arr
|
||||
LEFT JOIN ums_role r ON arr.role_id = r.id
|
||||
LEFT JOIN ums_role_menu_relation rmr ON r.id = rmr.role_id
|
||||
LEFT JOIN ums_menu m ON rmr.menu_id = m.id
|
||||
WHERE
|
||||
arr.admin_id = #{adminId}
|
||||
AND m.id IS NOT NULL
|
||||
GROUP BY
|
||||
m.id
|
||||
</select>
|
||||
<select id="getMenuListByRoleId" resultType="com.macro.mall.model.UmsMenu">
|
||||
SELECT
|
||||
m.id id,
|
||||
m.parent_id parentId,
|
||||
m.create_time createTime,
|
||||
m.title title,
|
||||
m.level level,
|
||||
m.sort sort,
|
||||
m.name name,
|
||||
m.icon icon,
|
||||
m.hidden hidden
|
||||
FROM
|
||||
ums_role_menu_relation rmr
|
||||
LEFT JOIN ums_menu m ON rmr.menu_id = m.id
|
||||
WHERE
|
||||
rmr.role_id = #{roleId}
|
||||
AND m.id IS NOT NULL
|
||||
GROUP BY
|
||||
m.id
|
||||
</select>
|
||||
<select id="getResourceListByRoleId" resultType="com.macro.mall.model.UmsResource">
|
||||
SELECT
|
||||
r.id id,
|
||||
r.create_time createTime,
|
||||
r.`name` `name`,
|
||||
r.url url,
|
||||
r.description description,
|
||||
r.category_id categoryId
|
||||
FROM
|
||||
ums_role_resource_relation rrr
|
||||
LEFT JOIN ums_resource r ON rrr.resource_id = r.id
|
||||
WHERE
|
||||
rrr.role_id = #{roleId}
|
||||
AND r.id IS NOT NULL
|
||||
GROUP BY
|
||||
r.id
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user