...
|
...
|
@@ -3,31 +3,38 @@ |
|
|
<mapper namespace="com.tianbo.warehouse.dao.PERMISSIONMapper" >
|
|
|
<resultMap id="BaseResultMap" type="com.tianbo.warehouse.model.PERMISSION" >
|
|
|
<id column="permission_id" property="permissionId" jdbcType="INTEGER" />
|
|
|
<result column="permission_name" property="permissionName" jdbcType="VARCHAR" />
|
|
|
<result column="permission_sign" property="permissionSign" jdbcType="VARCHAR" />
|
|
|
<result column="name" property="name" jdbcType="VARCHAR" />
|
|
|
<result column="permission_order" property="permissionOrder" jdbcType="VARCHAR" />
|
|
|
<result column="description" property="description" jdbcType="VARCHAR" />
|
|
|
<result column="group_name" property="groupName" jdbcType="VARCHAR" />
|
|
|
<result column="ismenu" property="ismenu" jdbcType="BOOLEAN" />
|
|
|
<result column="hidden" property="hidden" jdbcType="BOOLEAN" />
|
|
|
<result column="parent_id" property="parentId" jdbcType="INTEGER" />
|
|
|
<result column="path" property="path" jdbcType="VARCHAR" />
|
|
|
<result column="url" property="url" jdbcType="VARCHAR" />
|
|
|
<result column="ext1" property="ext1" jdbcType="VARCHAR" />
|
|
|
<result column="ext2" property="ext2" jdbcType="VARCHAR" />
|
|
|
<result column="ext3" property="ext3" jdbcType="VARCHAR" />
|
|
|
<result column="method" property="method" jdbcType="VARCHAR" />
|
|
|
<result column="iconCls" property="iconCls" jdbcType="VARCHAR" />
|
|
|
<result column="component" property="component" jdbcType="VARCHAR" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List" >
|
|
|
permission_id, permission_name, permission_sign, description, group_name, parent_id,
|
|
|
path, url, ext1, ext2, ext3
|
|
|
permission_id, name, permission_order, description, ismenu,hidden,parent_id,
|
|
|
path, url, method, iconCls, component
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from permission
|
|
|
where permission_id = #{permissionId,jdbcType=INTEGER}
|
|
|
where permission_id = #{permissionId,jdbcType=INTEGER} ORDER BY permission_order
|
|
|
</select>
|
|
|
<select id="findAll" resultMap="BaseResultMap" >
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from permission
|
|
|
from permission ORDER BY permission_order
|
|
|
</select>
|
|
|
|
|
|
<select id="getAllMenus" resultMap="BaseResultMap" >
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from permission where ismenu is TRUE ORDER BY permission_order
|
|
|
</select>
|
|
|
<select id="findRoleListByUrl" resultType="java.lang.String" parameterType="java.lang.String">
|
|
|
SELECT
|
...
|
...
|
@@ -36,7 +43,7 @@ FROM |
|
|
permission P
|
|
|
LEFT JOIN role_permission RP ON P.permission_id = RP.permission_id
|
|
|
LEFT JOIN ROLE R ON R.ROLE_ID= RP.ROLE_ID
|
|
|
where P.url = #{permissionUrl,jdbcType=VARCHAR}
|
|
|
where P.url = #{permissionUrl,jdbcType=VARCHAR} ORDER BY permission_order
|
|
|
</select>
|
|
|
<select id="findByUserId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
SELECT
|
...
|
...
|
@@ -65,21 +72,21 @@ where P.url = #{permissionUrl,jdbcType=VARCHAR} |
|
|
UR.USER_ID = #{userId,jdbcType=INTEGER}
|
|
|
)
|
|
|
)
|
|
|
)
|
|
|
) ORDER BY permission_order
|
|
|
</select>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
|
|
delete from permission
|
|
|
where permission_id = #{permissionId,jdbcType=INTEGER}
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.tianbo.warehouse.model.PERMISSION" >
|
|
|
insert into permission (permission_id, permission_name, permission_sign,
|
|
|
description, group_name, parent_id,
|
|
|
path, url, ext1, ext2,
|
|
|
ext3)
|
|
|
values (#{permissionId,jdbcType=INTEGER}, #{permissionName,jdbcType=VARCHAR}, #{permissionSign,jdbcType=VARCHAR},
|
|
|
#{description,jdbcType=VARCHAR}, #{groupName,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER},
|
|
|
#{path,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR},
|
|
|
#{ext3,jdbcType=VARCHAR})
|
|
|
insert into permission (permission_id, name, permission_order,
|
|
|
description, ismenu,hidden, parent_id,
|
|
|
path, url, method, iconCls,
|
|
|
component)
|
|
|
values (#{permissionId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{permissionOrder,jdbcType=VARCHAR},
|
|
|
#{description,jdbcType=VARCHAR}, #{ismenu,jdbcType=BOOLEAN},#{hidden,jdbcType=BOOLEAN},#{parentId,jdbcType=INTEGER},
|
|
|
#{path,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR}, #{iconCls,jdbcType=VARCHAR},
|
|
|
#{component,jdbcType=VARCHAR})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.tianbo.warehouse.model.PERMISSION" >
|
|
|
insert into permission
|
...
|
...
|
@@ -87,17 +94,20 @@ where P.url = #{permissionUrl,jdbcType=VARCHAR} |
|
|
<if test="permissionId != null" >
|
|
|
permission_id,
|
|
|
</if>
|
|
|
<if test="permissionName != null" >
|
|
|
permission_name,
|
|
|
<if test="name != null" >
|
|
|
name,
|
|
|
</if>
|
|
|
<if test="permissionSign != null" >
|
|
|
permission_sign,
|
|
|
<if test="permissionOrder != null" >
|
|
|
permission_order,
|
|
|
</if>
|
|
|
<if test="description != null" >
|
|
|
description,
|
|
|
</if>
|
|
|
<if test="groupName != null" >
|
|
|
group_name,
|
|
|
<if test="ismenu != null" >
|
|
|
ismenu,
|
|
|
</if>
|
|
|
<if test="hidden != null" >
|
|
|
hidden,
|
|
|
</if>
|
|
|
<if test="parentId != null" >
|
|
|
parent_id,
|
...
|
...
|
@@ -108,31 +118,34 @@ where P.url = #{permissionUrl,jdbcType=VARCHAR} |
|
|
<if test="url != null" >
|
|
|
url,
|
|
|
</if>
|
|
|
<if test="ext1 != null" >
|
|
|
ext1,
|
|
|
<if test="method != null" >
|
|
|
method,
|
|
|
</if>
|
|
|
<if test="ext2 != null" >
|
|
|
ext2,
|
|
|
<if test="iconCls != null" >
|
|
|
iconCls,
|
|
|
</if>
|
|
|
<if test="ext3 != null" >
|
|
|
ext3,
|
|
|
<if test="component != null" >
|
|
|
component,
|
|
|
</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
<if test="permissionId != null" >
|
|
|
#{permissionId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="permissionName != null" >
|
|
|
#{permissionName,jdbcType=VARCHAR},
|
|
|
<if test="name != null" >
|
|
|
#{name,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="permissionSign != null" >
|
|
|
#{permissionSign,jdbcType=VARCHAR},
|
|
|
<if test="permissionOrder != null" >
|
|
|
#{permissionOrder,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="description != null" >
|
|
|
#{description,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="groupName != null" >
|
|
|
#{groupName,jdbcType=VARCHAR},
|
|
|
<if test="ismenu != null" >
|
|
|
#{ismenu,jdbcType=BOOLEAN},
|
|
|
</if>
|
|
|
<if test="hidden != null" >
|
|
|
#{hidden,jdbcType=BOOLEAN},
|
|
|
</if>
|
|
|
<if test="parentId != null" >
|
|
|
#{parentId,jdbcType=INTEGER},
|
...
|
...
|
@@ -143,31 +156,34 @@ where P.url = #{permissionUrl,jdbcType=VARCHAR} |
|
|
<if test="url != null" >
|
|
|
#{url,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="ext1 != null" >
|
|
|
#{ext1,jdbcType=VARCHAR},
|
|
|
<if test="method != null" >
|
|
|
#{method,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="ext2 != null" >
|
|
|
#{ext2,jdbcType=VARCHAR},
|
|
|
<if test="iconCls != null" >
|
|
|
#{iconCls,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="ext3 != null" >
|
|
|
#{ext3,jdbcType=VARCHAR},
|
|
|
<if test="component != null" >
|
|
|
#{component,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.tianbo.warehouse.model.PERMISSION" >
|
|
|
update permission
|
|
|
<set >
|
|
|
<if test="permissionName != null" >
|
|
|
permission_name = #{permissionName,jdbcType=VARCHAR},
|
|
|
<if test="name != null" >
|
|
|
name = #{name,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="permissionSign != null" >
|
|
|
permission_sign = #{permissionSign,jdbcType=VARCHAR},
|
|
|
<if test="permissionOrder != null" >
|
|
|
permission_order = #{permissionOrder,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="description != null" >
|
|
|
description = #{description,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="groupName != null" >
|
|
|
group_name = #{groupName,jdbcType=VARCHAR},
|
|
|
<if test="ismenu != null" >
|
|
|
ismenu = #{ismenu,jdbcType=BOOLEAN},
|
|
|
</if>
|
|
|
<if test="hidden != null" >
|
|
|
hidden = #{hidden,jdbcType=BOOLEAN},
|
|
|
</if>
|
|
|
<if test="parentId != null" >
|
|
|
parent_id = #{parentId,jdbcType=INTEGER},
|
...
|
...
|
@@ -178,30 +194,31 @@ where P.url = #{permissionUrl,jdbcType=VARCHAR} |
|
|
<if test="url != null" >
|
|
|
url = #{url,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="ext1 != null" >
|
|
|
ext1 = #{ext1,jdbcType=VARCHAR},
|
|
|
<if test="method != null" >
|
|
|
method = #{method,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="ext2 != null" >
|
|
|
ext2 = #{ext2,jdbcType=VARCHAR},
|
|
|
<if test="iconCls != null" >
|
|
|
iconCls = #{iconCls,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
<if test="ext3 != null" >
|
|
|
ext3 = #{ext3,jdbcType=VARCHAR},
|
|
|
<if test="component != null" >
|
|
|
component = #{component,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
</set>
|
|
|
where permission_id = #{permissionId,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKey" parameterType="com.tianbo.warehouse.model.PERMISSION" >
|
|
|
update permission
|
|
|
set permission_name = #{permissionName,jdbcType=VARCHAR},
|
|
|
permission_sign = #{permissionSign,jdbcType=VARCHAR},
|
|
|
set name = #{name,jdbcType=VARCHAR},
|
|
|
permission_order = #{permissionOrder,jdbcType=VARCHAR},
|
|
|
description = #{description,jdbcType=VARCHAR},
|
|
|
group_name = #{groupName,jdbcType=VARCHAR},
|
|
|
ismenu = #{ismenu,jdbcType=BOOLEAN},
|
|
|
hidden = #{hidden,jdbcType=BOOLEAN},
|
|
|
parent_id = #{parentId,jdbcType=INTEGER},
|
|
|
path = #{path,jdbcType=VARCHAR},
|
|
|
url = #{url,jdbcType=VARCHAR},
|
|
|
ext1 = #{ext1,jdbcType=VARCHAR},
|
|
|
ext2 = #{ext2,jdbcType=VARCHAR},
|
|
|
ext3 = #{ext3,jdbcType=VARCHAR}
|
|
|
method = #{method,jdbcType=VARCHAR},
|
|
|
iconCls = #{iconCls,jdbcType=VARCHAR},
|
|
|
component = #{component,jdbcType=VARCHAR}
|
|
|
where permission_id = #{permissionId,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
</mapper> |
|
|
\ No newline at end of file |
...
|
...
|
|