<?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.PtServiceCateMapper">
    <resultMap id="BaseResultMap" type="com.ruoyi.interfaces.domain.PtServiceCate">
        <id column="CATE_ID" jdbcType="VARCHAR" property="cateId"/>
        <result column="CATE_PID" jdbcType="VARCHAR" property="catePid"/>
        <result column="NAME" jdbcType="VARCHAR" property="name"/>
        <result column="SEQ" jdbcType="DECIMAL" property="seq"/>
    </resultMap>
    <sql id="Base_Column_List">
        CATE_ID
        , CATE_PID, NAME, SEQ
    </sql>

    <!--查询数据列表-->
    <select id="selectAll" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from PT_SERVICE_CATE
    </select>

    <!--根据主键查询数据-->
    <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>

        from PT_SERVICE_CATE
        where CATE_ID = #{cateId,jdbcType=VARCHAR}
    </select>

    <!--根据主键更新数据-->
    <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.interfaces.domain.PtServiceCate">
        update PT_SERVICE_CATE
        <set>
            <if test="catePid != null">
                CATE_PID = #{catePid,jdbcType=VARCHAR},
            </if>
            <if test="name != null">
                NAME = #{name,jdbcType=VARCHAR},
            </if>
            <if test="seq != null">
                SEQ = #{seq,jdbcType=DECIMAL},
            </if>
        </set>
        where CATE_ID = #{cateId,jdbcType=VARCHAR}
    </update>

    <!--根据主键删除数据-->
    <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
        delete
        from PT_SERVICE_CATE
        where CATE_ID = #{cateId,jdbcType=VARCHAR}
    </delete>

    <!-- <update id="updateByPrimaryKey" parameterType="cn.com.goldenwater.app.pt.model.PtServiceCate">
       update PT_SERVICE_CATE
       set CATE_PID = #{catePid,jdbcType=VARCHAR},
         NAME = #{name,jdbcType=VARCHAR},
         SEQ = #{seq,jdbcType=DECIMAL}
       where CATE_ID = #{cateId,jdbcType=VARCHAR}
     </update>-->

    <insert id="insert" parameterType="com.ruoyi.interfaces.domain.PtServiceCate">
        insert into PT_SERVICE_CATE (CATE_ID, CATE_PID, NAME,
                                     SEQ)
        values (#{cateId,jdbcType=VARCHAR}, #{catePid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
                #{seq,jdbcType=DECIMAL})
    </insert>
    <!--  <insert id="insertSelective" parameterType="cn.com.goldenwater.app.pt.model.PtServiceCate">
        insert into PT_SERVICE_CATE
        <trim prefix="(" suffix=")" suffixOverrides=",">
          <if test="cateId != null">
            CATE_ID,
          </if>
          <if test="catePid != null">
            CATE_PID,
          </if>
          <if test="name != null">
            NAME,
          </if>
          <if test="seq != null">
            SEQ,
          </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
          <if test="cateId != null">
            #{cateId,jdbcType=VARCHAR},
          </if>
          <if test="catePid != null">
            #{catePid,jdbcType=VARCHAR},
          </if>
          <if test="name != null">
            #{name,jdbcType=VARCHAR},
          </if>
          <if test="seq != null">
            #{seq,jdbcType=DECIMAL},
          </if>
        </trim>
      </insert>
    -->
    <cache/>
</mapper>
