dataease-dm/backend/src/main/java/io/dataease/base/mapper/PanelLinkMapper.xml
2021-12-19 14:46:33 +08:00

188 lines
6.7 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.PanelLinkMapper">
<resultMap id="BaseResultMap" type="io.dataease.base.domain.PanelLink">
<result column="resource_id" jdbcType="VARCHAR" property="resourceId" />
<result column="valid" jdbcType="BIT" property="valid" />
<result column="enable_pwd" jdbcType="BIT" property="enablePwd" />
<result column="pwd" jdbcType="VARCHAR" property="pwd" />
<result column="over_time" jdbcType="BIGINT" property="overTime" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
</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">
resource_id, `valid`, enable_pwd, pwd, over_time, user_id
</sql>
<select id="selectByExample" parameterType="io.dataease.base.domain.PanelLinkExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from panel_link
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<delete id="deleteByExample" parameterType="io.dataease.base.domain.PanelLinkExample">
delete from panel_link
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.dataease.base.domain.PanelLink">
insert into panel_link (resource_id, `valid`, enable_pwd,
pwd, over_time, user_id
)
values (#{resourceId,jdbcType=VARCHAR}, #{valid,jdbcType=BIT}, #{enablePwd,jdbcType=BIT},
#{pwd,jdbcType=VARCHAR}, #{overTime,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.PanelLink">
insert into panel_link
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="resourceId != null">
resource_id,
</if>
<if test="valid != null">
`valid`,
</if>
<if test="enablePwd != null">
enable_pwd,
</if>
<if test="pwd != null">
pwd,
</if>
<if test="overTime != null">
over_time,
</if>
<if test="userId != null">
user_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="resourceId != null">
#{resourceId,jdbcType=VARCHAR},
</if>
<if test="valid != null">
#{valid,jdbcType=BIT},
</if>
<if test="enablePwd != null">
#{enablePwd,jdbcType=BIT},
</if>
<if test="pwd != null">
#{pwd,jdbcType=VARCHAR},
</if>
<if test="overTime != null">
#{overTime,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.dataease.base.domain.PanelLinkExample" resultType="java.lang.Long">
select count(*) from panel_link
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update panel_link
<set>
<if test="record.resourceId != null">
resource_id = #{record.resourceId,jdbcType=VARCHAR},
</if>
<if test="record.valid != null">
`valid` = #{record.valid,jdbcType=BIT},
</if>
<if test="record.enablePwd != null">
enable_pwd = #{record.enablePwd,jdbcType=BIT},
</if>
<if test="record.pwd != null">
pwd = #{record.pwd,jdbcType=VARCHAR},
</if>
<if test="record.overTime != null">
over_time = #{record.overTime,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update panel_link
set resource_id = #{record.resourceId,jdbcType=VARCHAR},
`valid` = #{record.valid,jdbcType=BIT},
enable_pwd = #{record.enablePwd,jdbcType=BIT},
pwd = #{record.pwd,jdbcType=VARCHAR},
over_time = #{record.overTime,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
</mapper>