|
|
@@ -1,30 +1,29 @@
|
|
|
-<?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.zheng.upms.dao.mapper.UpmsPermissionMapper">
|
|
|
- <resultMap id="BaseResultMap" type="com.zheng.upms.dao.model.UpmsPermission">
|
|
|
- <id column="user_organization_id" jdbcType="INTEGER" property="userOrganizationId" />
|
|
|
- <result column="user_id" jdbcType="INTEGER" property="userId" />
|
|
|
- <result column="organization_id" jdbcType="INTEGER" property="organizationId" />
|
|
|
+<?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.zheng.upms.dao.mapper.UpmsPermissionMapper" >
|
|
|
+ <resultMap id="BaseResultMap" type="com.zheng.upms.dao.model.UpmsPermission" >
|
|
|
+ <id column="permission_id" property="permissionId" jdbcType="INTEGER" />
|
|
|
+ <result column="system_id" property="systemId" jdbcType="INTEGER" />
|
|
|
</resultMap>
|
|
|
- <sql id="Example_Where_Clause">
|
|
|
- <where>
|
|
|
- <foreach collection="oredCriteria" item="criteria" separator="or">
|
|
|
- <if test="criteria.valid">
|
|
|
- <trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
- <foreach collection="criteria.criteria" item="criterion">
|
|
|
- <choose>
|
|
|
- <when test="criterion.noValue">
|
|
|
+ <sql id="Example_Where_Clause" >
|
|
|
+ <where >
|
|
|
+ <foreach collection="oredCriteria" item="criteria" separator="or" >
|
|
|
+ <if test="criteria.valid" >
|
|
|
+ <trim prefix="(" suffix=")" prefixOverrides="and" >
|
|
|
+ <foreach collection="criteria.criteria" item="criterion" >
|
|
|
+ <choose >
|
|
|
+ <when test="criterion.noValue" >
|
|
|
and ${criterion.condition}
|
|
|
</when>
|
|
|
- <when test="criterion.singleValue">
|
|
|
+ <when test="criterion.singleValue" >
|
|
|
and ${criterion.condition} #{criterion.value}
|
|
|
</when>
|
|
|
- <when test="criterion.betweenValue">
|
|
|
+ <when test="criterion.betweenValue" >
|
|
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
</when>
|
|
|
- <when test="criterion.listValue">
|
|
|
+ <when test="criterion.listValue" >
|
|
|
and ${criterion.condition}
|
|
|
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
+ <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
|
|
|
#{listItem}
|
|
|
</foreach>
|
|
|
</when>
|
|
|
@@ -35,25 +34,25 @@
|
|
|
</foreach>
|
|
|
</where>
|
|
|
</sql>
|
|
|
- <sql id="Update_By_Example_Where_Clause">
|
|
|
- <where>
|
|
|
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
|
- <if test="criteria.valid">
|
|
|
- <trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
- <foreach collection="criteria.criteria" item="criterion">
|
|
|
- <choose>
|
|
|
- <when test="criterion.noValue">
|
|
|
+ <sql id="Update_By_Example_Where_Clause" >
|
|
|
+ <where >
|
|
|
+ <foreach collection="example.oredCriteria" item="criteria" separator="or" >
|
|
|
+ <if test="criteria.valid" >
|
|
|
+ <trim prefix="(" suffix=")" prefixOverrides="and" >
|
|
|
+ <foreach collection="criteria.criteria" item="criterion" >
|
|
|
+ <choose >
|
|
|
+ <when test="criterion.noValue" >
|
|
|
and ${criterion.condition}
|
|
|
</when>
|
|
|
- <when test="criterion.singleValue">
|
|
|
+ <when test="criterion.singleValue" >
|
|
|
and ${criterion.condition} #{criterion.value}
|
|
|
</when>
|
|
|
- <when test="criterion.betweenValue">
|
|
|
+ <when test="criterion.betweenValue" >
|
|
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
</when>
|
|
|
- <when test="criterion.listValue">
|
|
|
+ <when test="criterion.listValue" >
|
|
|
and ${criterion.condition}
|
|
|
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
+ <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
|
|
|
#{listItem}
|
|
|
</foreach>
|
|
|
</when>
|
|
|
@@ -64,293 +63,108 @@
|
|
|
</foreach>
|
|
|
</where>
|
|
|
</sql>
|
|
|
- <sql id="Base_Column_List">
|
|
|
- user_organization_id, user_id, organization_id
|
|
|
- </sql>
|
|
|
- <select id="selectByExample" parameterType="com.zheng.upms.dao.model.UpmsPermissionExample" resultMap="BaseResultMap">
|
|
|
- select
|
|
|
- <if test="distinct">
|
|
|
- distinct
|
|
|
- </if>
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from upms_user_organization
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- <if test="orderByClause != null">
|
|
|
- order by ${orderByClause}
|
|
|
- </if>
|
|
|
- <if test="limit != null">
|
|
|
- <if test="offset != null">
|
|
|
- limit ${offset}, ${limit}
|
|
|
- </if>
|
|
|
- <if test="offset == null">
|
|
|
- limit ${limit}
|
|
|
- </if>
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
- select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from upms_user_organization
|
|
|
- where user_organization_id = #{userOrganizationId,jdbcType=INTEGER}
|
|
|
- </select>
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
- delete from upms_user_organization
|
|
|
- where user_organization_id = #{userOrganizationId,jdbcType=INTEGER}
|
|
|
- </delete>
|
|
|
- <delete id="deleteByExample" parameterType="com.zheng.upms.dao.model.UpmsPermissionExample">
|
|
|
- delete from upms_user_organization
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </delete>
|
|
|
- <insert id="insert" parameterType="com.zheng.upms.dao.model.UpmsPermission">
|
|
|
- insert into upms_user_organization (user_organization_id, user_id, organization_id
|
|
|
- )
|
|
|
- values (#{userOrganizationId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{organizationId,jdbcType=INTEGER}
|
|
|
- )
|
|
|
- </insert>
|
|
|
- <insert id="insertSelective" parameterType="com.zheng.upms.dao.model.UpmsPermission">
|
|
|
- insert into upms_user_organization
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="userOrganizationId != null">
|
|
|
- user_organization_id,
|
|
|
- </if>
|
|
|
- <if test="userId != null">
|
|
|
- user_id,
|
|
|
- </if>
|
|
|
- <if test="organizationId != null">
|
|
|
- organization_id,
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="userOrganizationId != null">
|
|
|
- #{userOrganizationId,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="userId != null">
|
|
|
- #{userId,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="organizationId != null">
|
|
|
- #{organizationId,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
- <select id="countByExample" parameterType="com.zheng.upms.dao.model.UpmsPermissionExample" resultType="java.lang.Integer">
|
|
|
- select count(*) from upms_user_organization
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <update id="updateByExampleSelective" parameterType="map">
|
|
|
- update upms_user_organization
|
|
|
- <set>
|
|
|
- <if test="record.userOrganizationId != null">
|
|
|
- user_organization_id = #{record.userOrganizationId,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="record.userId != null">
|
|
|
- user_id = #{record.userId,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="record.organizationId != null">
|
|
|
- organization_id = #{record.organizationId,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Update_By_Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </update>
|
|
|
- <update id="updateByExample" parameterType="map">
|
|
|
- update upms_user_organization
|
|
|
- set user_organization_id = #{record.userOrganizationId,jdbcType=INTEGER},
|
|
|
- user_id = #{record.userId,jdbcType=INTEGER},
|
|
|
- organization_id = #{record.organizationId,jdbcType=INTEGER}
|
|
|
- <if test="_parameter != null">
|
|
|
- <include refid="Update_By_Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </update>
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="com.zheng.upms.dao.model.UpmsPermission">
|
|
|
- update upms_user_organization
|
|
|
- <set>
|
|
|
- <if test="userId != null">
|
|
|
- user_id = #{userId,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="organizationId != null">
|
|
|
- organization_id = #{organizationId,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where user_organization_id = #{userOrganizationId,jdbcType=INTEGER}
|
|
|
- </update>
|
|
|
- <update id="updateByPrimaryKey" parameterType="com.zheng.upms.dao.model.UpmsPermission">
|
|
|
- update upms_user_organization
|
|
|
- set user_id = #{userId,jdbcType=INTEGER},
|
|
|
- organization_id = #{organizationId,jdbcType=INTEGER}
|
|
|
- where user_organization_id = #{userOrganizationId,jdbcType=INTEGER}
|
|
|
- </update>
|
|
|
- <cache />
|
|
|
- <resultMap id="BaseResultMap" type="com.zheng.upms.dao.model.UpmsPermission">
|
|
|
- <id column="permission_id" jdbcType="INTEGER" property="permissionId" />
|
|
|
- <result column="system_id" jdbcType="INTEGER" property="systemId" />
|
|
|
- </resultMap>
|
|
|
- <sql id="Example_Where_Clause">
|
|
|
- <where>
|
|
|
- <foreach collection="oredCriteria" item="criteria" separator="or">
|
|
|
- <if test="criteria.valid">
|
|
|
- <trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
- <foreach collection="criteria.criteria" item="criterion">
|
|
|
- <choose>
|
|
|
- <when test="criterion.noValue">
|
|
|
- and ${criterion.condition}
|
|
|
- </when>
|
|
|
- <when test="criterion.singleValue">
|
|
|
- and ${criterion.condition} #{criterion.value}
|
|
|
- </when>
|
|
|
- <when test="criterion.betweenValue">
|
|
|
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
- </when>
|
|
|
- <when test="criterion.listValue">
|
|
|
- and ${criterion.condition}
|
|
|
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
- #{listItem}
|
|
|
- </foreach>
|
|
|
- </when>
|
|
|
- </choose>
|
|
|
- </foreach>
|
|
|
- </trim>
|
|
|
- </if>
|
|
|
- </foreach>
|
|
|
- </where>
|
|
|
- </sql>
|
|
|
- <sql id="Update_By_Example_Where_Clause">
|
|
|
- <where>
|
|
|
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
|
- <if test="criteria.valid">
|
|
|
- <trim prefix="(" prefixOverrides="and" suffix=")">
|
|
|
- <foreach collection="criteria.criteria" item="criterion">
|
|
|
- <choose>
|
|
|
- <when test="criterion.noValue">
|
|
|
- and ${criterion.condition}
|
|
|
- </when>
|
|
|
- <when test="criterion.singleValue">
|
|
|
- and ${criterion.condition} #{criterion.value}
|
|
|
- </when>
|
|
|
- <when test="criterion.betweenValue">
|
|
|
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
- </when>
|
|
|
- <when test="criterion.listValue">
|
|
|
- and ${criterion.condition}
|
|
|
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
- #{listItem}
|
|
|
- </foreach>
|
|
|
- </when>
|
|
|
- </choose>
|
|
|
- </foreach>
|
|
|
- </trim>
|
|
|
- </if>
|
|
|
- </foreach>
|
|
|
- </where>
|
|
|
- </sql>
|
|
|
- <sql id="Base_Column_List">
|
|
|
+ <sql id="Base_Column_List" >
|
|
|
permission_id, system_id
|
|
|
</sql>
|
|
|
- <select id="selectByExample" parameterType="com.zheng.upms.dao.model.UpmsPermissionExample" resultMap="BaseResultMap">
|
|
|
+ <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.zheng.upms.dao.model.UpmsPermissionExample" >
|
|
|
select
|
|
|
- <if test="distinct">
|
|
|
+ <if test="distinct" >
|
|
|
distinct
|
|
|
</if>
|
|
|
<include refid="Base_Column_List" />
|
|
|
from upms_permission
|
|
|
- <if test="_parameter != null">
|
|
|
+ <if test="_parameter != null" >
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
</if>
|
|
|
- <if test="orderByClause != null">
|
|
|
+ <if test="orderByClause != null" >
|
|
|
order by ${orderByClause}
|
|
|
</if>
|
|
|
- <if test="limit != null">
|
|
|
- <if test="offset != null">
|
|
|
+ <if test="limit != null" >
|
|
|
+ <if test="offset != null" >
|
|
|
limit ${offset}, ${limit}
|
|
|
</if>
|
|
|
- <if test="offset == null">
|
|
|
+ <if test="offset == null" >
|
|
|
limit ${limit}
|
|
|
</if>
|
|
|
</if>
|
|
|
</select>
|
|
|
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from upms_permission
|
|
|
where permission_id = #{permissionId,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
|
|
delete from upms_permission
|
|
|
where permission_id = #{permissionId,jdbcType=INTEGER}
|
|
|
</delete>
|
|
|
- <delete id="deleteByExample" parameterType="com.zheng.upms.dao.model.UpmsPermissionExample">
|
|
|
+ <delete id="deleteByExample" parameterType="com.zheng.upms.dao.model.UpmsPermissionExample" >
|
|
|
delete from upms_permission
|
|
|
- <if test="_parameter != null">
|
|
|
+ <if test="_parameter != null" >
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
</if>
|
|
|
</delete>
|
|
|
- <insert id="insert" parameterType="com.zheng.upms.dao.model.UpmsPermission">
|
|
|
- <selectKey keyProperty="permissionId" order="AFTER" resultType="java.lang.Integer">
|
|
|
+ <insert id="insert" parameterType="com.zheng.upms.dao.model.UpmsPermission" >
|
|
|
+ <selectKey resultType="java.lang.Integer" keyProperty="permissionId" order="AFTER" >
|
|
|
SELECT LAST_INSERT_ID()
|
|
|
</selectKey>
|
|
|
insert into upms_permission (system_id)
|
|
|
values (#{systemId,jdbcType=INTEGER})
|
|
|
</insert>
|
|
|
- <insert id="insertSelective" parameterType="com.zheng.upms.dao.model.UpmsPermission">
|
|
|
- <selectKey keyProperty="permissionId" order="AFTER" resultType="java.lang.Integer">
|
|
|
+ <insert id="insertSelective" parameterType="com.zheng.upms.dao.model.UpmsPermission" >
|
|
|
+ <selectKey resultType="java.lang.Integer" keyProperty="permissionId" order="AFTER" >
|
|
|
SELECT LAST_INSERT_ID()
|
|
|
</selectKey>
|
|
|
insert into upms_permission
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="systemId != null">
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="systemId != null" >
|
|
|
system_id,
|
|
|
</if>
|
|
|
</trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="systemId != null">
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="systemId != null" >
|
|
|
#{systemId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
- <select id="countByExample" parameterType="com.zheng.upms.dao.model.UpmsPermissionExample" resultType="java.lang.Integer">
|
|
|
+ <select id="countByExample" parameterType="com.zheng.upms.dao.model.UpmsPermissionExample" resultType="java.lang.Integer" >
|
|
|
select count(*) from upms_permission
|
|
|
- <if test="_parameter != null">
|
|
|
+ <if test="_parameter != null" >
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
</if>
|
|
|
</select>
|
|
|
- <update id="updateByExampleSelective" parameterType="map">
|
|
|
+ <update id="updateByExampleSelective" parameterType="map" >
|
|
|
update upms_permission
|
|
|
- <set>
|
|
|
- <if test="record.permissionId != null">
|
|
|
+ <set >
|
|
|
+ <if test="record.permissionId != null" >
|
|
|
permission_id = #{record.permissionId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
- <if test="record.systemId != null">
|
|
|
+ <if test="record.systemId != null" >
|
|
|
system_id = #{record.systemId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
</set>
|
|
|
- <if test="_parameter != null">
|
|
|
+ <if test="_parameter != null" >
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
</if>
|
|
|
</update>
|
|
|
- <update id="updateByExample" parameterType="map">
|
|
|
+ <update id="updateByExample" parameterType="map" >
|
|
|
update upms_permission
|
|
|
set permission_id = #{record.permissionId,jdbcType=INTEGER},
|
|
|
system_id = #{record.systemId,jdbcType=INTEGER}
|
|
|
- <if test="_parameter != null">
|
|
|
+ <if test="_parameter != null" >
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
</if>
|
|
|
</update>
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="com.zheng.upms.dao.model.UpmsPermission">
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.zheng.upms.dao.model.UpmsPermission" >
|
|
|
update upms_permission
|
|
|
- <set>
|
|
|
- <if test="systemId != null">
|
|
|
+ <set >
|
|
|
+ <if test="systemId != null" >
|
|
|
system_id = #{systemId,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
</set>
|
|
|
where permission_id = #{permissionId,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
- <update id="updateByPrimaryKey" parameterType="com.zheng.upms.dao.model.UpmsPermission">
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.zheng.upms.dao.model.UpmsPermission" >
|
|
|
update upms_permission
|
|
|
set system_id = #{systemId,jdbcType=INTEGER}
|
|
|
where permission_id = #{permissionId,jdbcType=INTEGER}
|