|
|
@@ -1,10 +1,67 @@
|
|
|
<?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.xintong.visualinspection.dao.master.PermissionDao">
|
|
|
- <select id="findAll" resultType="com.xintong.visualinspection.bean.Permission">
|
|
|
+
|
|
|
+ <resultMap id="BaseResultMap" type="com.xintong.visualinspection.bean.Permission" >
|
|
|
+ <id column="id" property="id" jdbcType="INTEGER" />
|
|
|
+ <result column="name" property="name" jdbcType="VARCHAR" />
|
|
|
+ <result column="descritpion" property="descritpion" jdbcType="VARCHAR" />
|
|
|
+ <result column="pid" property="pid" jdbcType="INTEGER" />
|
|
|
+ <result column="type" property="type" jdbcType="INTEGER" />
|
|
|
+ <result column="resourceid" property="resourceid" jdbcType="INTEGER" />
|
|
|
+ <result column="status" property="status" jdbcType="INTEGER" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="findAll" resultMap="BaseResultMap">
|
|
|
|
|
|
SELECT * from sys_permission ;
|
|
|
</select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="getPermission" parameterType="com.xintong.visualinspection.dao.master.PermissionDao" resultMap="BaseResultMap">
|
|
|
+ SELECT
|
|
|
+ id,name,descritpion,pid,type,resourceid,status
|
|
|
+ FROM sys_permission
|
|
|
+ where 1=1
|
|
|
+ <if test="id != null and id != 0">and id = #{id}</if>
|
|
|
+ <if test="name != null">and name = #{name}</if>
|
|
|
+ <if test="descritpion != null">and descritpion = #{descritpion}</if>
|
|
|
+ <if test="pid != null and pid != 0">and pid = #{pid}</if>
|
|
|
+ <if test="type != null and type != 0">and type = #{type}</if>
|
|
|
+ <if test="resourceid != null and resourceid != 0">and resourceid = #{resourceid}</if>
|
|
|
+ <if test="status != null">and status = #{status}</if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insert" parameterType="com.xintong.visualinspection.dao.master.PermissionDao" >
|
|
|
+ INSERT INTO
|
|
|
+ sys_permission
|
|
|
+ (name,descritpion,pid,type,resourceid,status)
|
|
|
+ VALUES
|
|
|
+ (#{name},#{descritpion},#{pid},#{type},#{resourceid},#{status})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+
|
|
|
+ <update id="update" parameterType="com.xintong.visualinspection.dao.master.PermissionDao" >
|
|
|
+ UPDATE
|
|
|
+ sys_permission
|
|
|
+ SET
|
|
|
+ id = #{id}
|
|
|
+ <if test="name != null">and name = #{name}</if>
|
|
|
+ <if test="descritpion != null">and descritpion = #{descritpion}</if>
|
|
|
+ <if test="pid != null and pid != 0">and pid = #{pid}</if>
|
|
|
+ <if test="type != null and type != 0">and type = #{type}</if>
|
|
|
+ <if test="resourceid != null and resourceid != 0">and resourceid = #{resourceid}</if>
|
|
|
+ WHERE
|
|
|
+ id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="delete" parameterType="java.lang.Integer" >
|
|
|
+ update sys_permission
|
|
|
+ set status=-1
|
|
|
+ WHERE
|
|
|
+ id =#{id}
|
|
|
+ </delete>
|
|
|
|
|
|
<select id="findByAdminUserId" parameterType="int" resultType="com.xintong.visualinspection.bean.Permission">
|
|
|
select p.*
|