<?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">
    <id 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" />
  </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
  </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>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from panel_link
    where resource_id = #{resourceId,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from panel_link
    where resource_id = #{resourceId,jdbcType=VARCHAR}
  </delete>
  <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)
    values (#{resourceId,jdbcType=VARCHAR}, #{valid,jdbcType=BIT}, #{enablePwd,jdbcType=BIT}, 
      #{pwd,jdbcType=VARCHAR})
  </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>
    </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>
    </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>
    </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}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.PanelLink">
    update panel_link
    <set>
      <if test="valid != null">
        `valid` = #{valid,jdbcType=BIT},
      </if>
      <if test="enablePwd != null">
        enable_pwd = #{enablePwd,jdbcType=BIT},
      </if>
      <if test="pwd != null">
        pwd = #{pwd,jdbcType=VARCHAR},
      </if>
    </set>
    where resource_id = #{resourceId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.PanelLink">
    update panel_link
    set `valid` = #{valid,jdbcType=BIT},
      enable_pwd = #{enablePwd,jdbcType=BIT},
      pwd = #{pwd,jdbcType=VARCHAR}
    where resource_id = #{resourceId,jdbcType=VARCHAR}
  </update>
</mapper>