<?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.ruoyi.interfaces.mapper.PtMapMapper">
    <resultMap id="BaseResultMap" type="com.ruoyi.interfaces.domain.PtMap">
        <id column="MAP_ID" jdbcType="VARCHAR" property="mapId"/>
        <result column="MAP_CODE" jdbcType="VARCHAR" property="mapCode"/>
        <result column="MAP_NAME" jdbcType="VARCHAR" property="mapName"/>
        <result column="MAP_URL" jdbcType="VARCHAR" property="mapUrl"/>
        <result column="MAP_CATE" jdbcType="VARCHAR" property="mapCate"/>
        <result column="MAP_CACHE" jdbcType="VARCHAR" property="mapCache"/>
        <result column="MAP_FORMAT" jdbcType="VARCHAR" property="mapFormat"/>
        <result column="MAP_TYPE" jdbcType="VARCHAR" property="mapType"/>
        <result column="MAP_STYLE" jdbcType="VARCHAR" property="mapStyle"/>
        <result column="MAP_VERSION" jdbcType="VARCHAR" property="mapVersion"/>
        <result column="MAP_NOTE" jdbcType="VARCHAR" property="mapNote"/>
        <result column="PUB_DATE" jdbcType="TIMESTAMP" property="pubDate"/>
        <result column="PUB_USERID" jdbcType="VARCHAR" property="pubUserid"/>
        <result column="PUB_USERNAME" jdbcType="VARCHAR" property="pubUsername"/>
        <result column="MAP_SOURCE" jdbcType="VARCHAR" property="mapSource"/>
        <result column="THUMB" jdbcType="VARCHAR" property="thumb"/>
    </resultMap>

    <sql id="Base_Column_List">
        MAP_ID
        , MAP_CODE, MAP_NAME, MAP_URL, MAP_CATE, MAP_CACHE, MAP_FORMAT, MAP_TYPE, MAP_STYLE,
    MAP_VERSION, MAP_NOTE, PUB_DATE, PUB_USERID, PUB_USERNAME, MAP_SOURCE,THUMB
    </sql>

    <insert id="insert" parameterType="com.ruoyi.interfaces.domain.PtMap">
        insert into PT_MAP (MAP_ID, MAP_CODE, MAP_NAME,
                            MAP_URL, MAP_CATE, MAP_CACHE,
                            MAP_FORMAT, MAP_TYPE, MAP_STYLE,
                            MAP_VERSION, MAP_NOTE, PUB_DATE,
                            PUB_USERID, PUB_USERNAME, MAP_SOURCE, THUMB)
        values (#{mapId,jdbcType=VARCHAR}, #{mapCode,jdbcType=VARCHAR}, #{mapName,jdbcType=VARCHAR},
                #{mapUrl,jdbcType=VARCHAR}, #{mapCate,jdbcType=VARCHAR}, #{mapCache,jdbcType=VARCHAR},
                #{mapFormat,jdbcType=VARCHAR}, #{mapType,jdbcType=VARCHAR}, #{mapStyle,jdbcType=VARCHAR},
                #{mapVersion,jdbcType=VARCHAR}, #{mapNote,jdbcType=VARCHAR}, #{pubDate,jdbcType=TIMESTAMP},
                #{pubUserid,jdbcType=VARCHAR}, #{pubUsername,jdbcType=VARCHAR}, #{mapSource,jdbcType=VARCHAR},
                #{thumb,jdbcType=VARCHAR})
    </insert>

    <select id="selectAll" parameterType="com.ruoyi.interfaces.domain.PtMap" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from PT_MAP
        <where>
            <if test="mapName !=null and mapName !=''">
                and MAP_NAME like #{mapName}
            </if>
            <if test="mapCate !=null and mapCate !=''">
                and MAP_CATE = #{mapCate}
            </if>
        </where>
    </select>
    <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from PT_MAP
        where MAP_ID = #{mapId,jdbcType=VARCHAR}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
        delete
        from PT_MAP
        where MAP_ID = #{mapId,jdbcType=VARCHAR}
    </delete>

    <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.interfaces.domain.PtMap">
        update PT_MAP
        <set>
            <if test="mapCode != null">
                MAP_CODE = #{mapCode,jdbcType=VARCHAR},
            </if>
            <if test="mapName != null">
                MAP_NAME = #{mapName,jdbcType=VARCHAR},
            </if>
            <if test="mapUrl != null">
                MAP_URL = #{mapUrl,jdbcType=VARCHAR},
            </if>
            <if test="mapCate != null">
                MAP_CATE = #{mapCate,jdbcType=VARCHAR},
            </if>
            <if test="mapCache != null">
                MAP_CACHE = #{mapCache,jdbcType=VARCHAR},
            </if>
            <if test="mapFormat != null">
                MAP_FORMAT = #{mapFormat,jdbcType=VARCHAR},
            </if>
            <if test="mapType != null">
                MAP_TYPE = #{mapType,jdbcType=VARCHAR},
            </if>
            <if test="mapStyle != null">
                MAP_STYLE = #{mapStyle,jdbcType=VARCHAR},
            </if>
            <if test="mapVersion != null">
                MAP_VERSION = #{mapVersion,jdbcType=VARCHAR},
            </if>
            <if test="mapNote != null">
                MAP_NOTE = #{mapNote,jdbcType=VARCHAR},
            </if>
            <if test="pubDate != null">
                PUB_DATE = #{pubDate,jdbcType=TIMESTAMP},
            </if>
            <if test="pubUserid != null">
                PUB_USERID = #{pubUserid,jdbcType=VARCHAR},
            </if>
            <if test="pubUsername != null">
                PUB_USERNAME = #{pubUsername,jdbcType=VARCHAR},
            </if>
            <if test="mapSource != null">
                MAP_SOURCE = #{mapSource,jdbcType=VARCHAR},
            </if>
            <if test="thumb != null">
                THUMB = #{thumb,jdbcType=VARCHAR},
            </if>
        </set>
        where MAP_ID = #{mapId,jdbcType=VARCHAR}
    </update>

    <!--  <update id="updateByPrimaryKey" parameterType="com.ruoyi.interfaces.domain.PtMap">
        update PT_MAP
        set MAP_CODE = #{mapCode,jdbcType=VARCHAR},
          MAP_NAME = #{mapName,jdbcType=VARCHAR},
          MAP_URL = #{mapUrl,jdbcType=VARCHAR},
          MAP_CATE = #{mapCate,jdbcType=VARCHAR},
          MAP_CACHE = #{mapCache,jdbcType=VARCHAR},
          MAP_FORMAT = #{mapFormat,jdbcType=VARCHAR},
          MAP_TYPE = #{mapType,jdbcType=VARCHAR},
          MAP_STYLE = #{mapStyle,jdbcType=VARCHAR},
          MAP_VERSION = #{mapVersion,jdbcType=VARCHAR},
          MAP_NOTE = #{mapNote,jdbcType=VARCHAR},
          PUB_DATE = #{pubDate,jdbcType=TIMESTAMP},
          PUB_USERID = #{pubUserid,jdbcType=VARCHAR},
          PUB_USERNAME = #{pubUsername,jdbcType=VARCHAR},
          MAP_SOURCE = #{mapSource,jdbcType=VARCHAR}
        where MAP_ID = #{mapId,jdbcType=VARCHAR}
      </update>-->

    <cache/>
</mapper>
