dataease-dm/backend/src/main/java/io/dataease/base/mapper/SysAuthDetailMapper.xml
2021-05-18 16:07:19 +08:00

291 lines
11 KiB
XML

<?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="io.dataease.base.mapper.SysAuthDetailMapper">
<resultMap id="BaseResultMap" type="io.dataease.base.domain.SysAuthDetail">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="auth_id" jdbcType="VARCHAR" property="authId" />
<result column="privilege_name" jdbcType="VARCHAR" property="privilegeName" />
<result column="privilege_type" jdbcType="INTEGER" property="privilegeType" />
<result column="privilege_value" jdbcType="INTEGER" property="privilegeValue" />
<result column="privilege_extend" jdbcType="VARCHAR" property="privilegeExtend" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</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">
id, auth_id, privilege_name, privilege_type, privilege_value, privilege_extend, remark,
create_user, create_time, update_time
</sql>
<select id="selectByExample" parameterType="io.dataease.base.domain.SysAuthDetailExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_auth_detail
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_auth_detail
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from sys_auth_detail
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.dataease.base.domain.SysAuthDetailExample">
delete from sys_auth_detail
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.dataease.base.domain.SysAuthDetail">
insert into sys_auth_detail (id, auth_id, privilege_name,
privilege_type, privilege_value, privilege_extend,
remark, create_user, create_time,
update_time)
values (#{id,jdbcType=VARCHAR}, #{authId,jdbcType=VARCHAR}, #{privilegeName,jdbcType=VARCHAR},
#{privilegeType,jdbcType=INTEGER}, #{privilegeValue,jdbcType=INTEGER}, #{privilegeExtend,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.SysAuthDetail">
insert into sys_auth_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="authId != null">
auth_id,
</if>
<if test="privilegeName != null">
privilege_name,
</if>
<if test="privilegeType != null">
privilege_type,
</if>
<if test="privilegeValue != null">
privilege_value,
</if>
<if test="privilegeExtend != null">
privilege_extend,
</if>
<if test="remark != null">
remark,
</if>
<if test="createUser != null">
create_user,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="authId != null">
#{authId,jdbcType=VARCHAR},
</if>
<if test="privilegeName != null">
#{privilegeName,jdbcType=VARCHAR},
</if>
<if test="privilegeType != null">
#{privilegeType,jdbcType=INTEGER},
</if>
<if test="privilegeValue != null">
#{privilegeValue,jdbcType=INTEGER},
</if>
<if test="privilegeExtend != null">
#{privilegeExtend,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createUser != null">
#{createUser,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.dataease.base.domain.SysAuthDetailExample" resultType="java.lang.Long">
select count(*) from sys_auth_detail
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_auth_detail
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.authId != null">
auth_id = #{record.authId,jdbcType=VARCHAR},
</if>
<if test="record.privilegeName != null">
privilege_name = #{record.privilegeName,jdbcType=VARCHAR},
</if>
<if test="record.privilegeType != null">
privilege_type = #{record.privilegeType,jdbcType=INTEGER},
</if>
<if test="record.privilegeValue != null">
privilege_value = #{record.privilegeValue,jdbcType=INTEGER},
</if>
<if test="record.privilegeExtend != null">
privilege_extend = #{record.privilegeExtend,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_auth_detail
set id = #{record.id,jdbcType=VARCHAR},
auth_id = #{record.authId,jdbcType=VARCHAR},
privilege_name = #{record.privilegeName,jdbcType=VARCHAR},
privilege_type = #{record.privilegeType,jdbcType=INTEGER},
privilege_value = #{record.privilegeValue,jdbcType=INTEGER},
privilege_extend = #{record.privilegeExtend,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
create_user = #{record.createUser,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.SysAuthDetail">
update sys_auth_detail
<set>
<if test="authId != null">
auth_id = #{authId,jdbcType=VARCHAR},
</if>
<if test="privilegeName != null">
privilege_name = #{privilegeName,jdbcType=VARCHAR},
</if>
<if test="privilegeType != null">
privilege_type = #{privilegeType,jdbcType=INTEGER},
</if>
<if test="privilegeValue != null">
privilege_value = #{privilegeValue,jdbcType=INTEGER},
</if>
<if test="privilegeExtend != null">
privilege_extend = #{privilegeExtend,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.SysAuthDetail">
update sys_auth_detail
set auth_id = #{authId,jdbcType=VARCHAR},
privilege_name = #{privilegeName,jdbcType=VARCHAR},
privilege_type = #{privilegeType,jdbcType=INTEGER},
privilege_value = #{privilegeValue,jdbcType=INTEGER},
privilege_extend = #{privilegeExtend,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
create_user = #{createUser,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>