|
@@ -0,0 +1,38 @@
|
|
|
+<?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.bosshand.virgo.core.dao.IdentityResourceDao">
|
|
|
+
|
|
|
+ <resultMap type="com.bosshand.virgo.core.model.IdentityResource" id="result">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="identityId" property="identityId"/>
|
|
|
+ <result column="type" property="type"/>
|
|
|
+ <result column="menus" property="menus"/>
|
|
|
+ <result column="resource" property="resource"/>
|
|
|
+ <result column="remark" property="remark"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="getList" resultMap="result">
|
|
|
+ select * from identity_resource
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insert" parameterType="com.bosshand.virgo.core.model.IdentityResource" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ INSERT INTO identity_resource(identityId, type, menus, resource, remark) VALUES (#{identityId}, #{type}, #{menus}, #{resource}, #{remark})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <delete id="delete">
|
|
|
+ DELETE FROM identity_resource WHERE id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <update id="update" parameterType="com.bosshand.virgo.core.model.IdentityResource">
|
|
|
+ UPDATE identity_resource
|
|
|
+ <trim prefix="set" suffixOverrides=",">
|
|
|
+ <if test="identityId!=0">identityId=#{identityId},</if>
|
|
|
+ <if test="type!=null">type=#{type},</if>
|
|
|
+ <if test="menus!=null">menus=#{menus},</if>
|
|
|
+ <if test="resource!=null">resource=#{resource},</if>
|
|
|
+ <if test="remark!=null">remark=#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ WHERE id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+</mapper>
|