All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mapper.test.GcMenuMapper.xml Maven / Gradle / Ivy

The newest version!
<?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.github.wslxm.springbootplus2.manage.test.mapper.GcMenuMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="io.github.wslxm.springbootplus2.manage.test.model.entity.GcMenu">

        <id column="id" property="id"/>
        <result column="create_user" property="createUser"/>
        <result column="update_user" property="updateUser"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="deleted" property="deleted"/>
        <result column="version" property="version"/>
        <result column="pid" property="pid"/>
        <result column="name" property="name"/>
        <result column="two_url" property="twoUrl"/>
        <result column="url" property="url"/>
        <result column="icon" property="icon"/>
        <result column="sort" property="sort"/>
        <result column="root" property="root"/>
        <result column="disable" property="disable"/>
    </resultMap>

    <!-- 通用查询结果列: <include refid="Base_Column_List"></include> -->
    <sql id="Base_Column_List">

        t.id,
        t.create_user,
        t.update_user,
        t.create_time,
        t.update_time,
        t.deleted,
        t.version,
        t.pid,
        t.name,
        t.two_url,
        t.url,
        t.icon,
        t.sort,
        t.root,
        t.disable
    </sql>


    <!-- id 查询 -->
    <select id="findId" resultType="io.github.wslxm.springbootplus2.manage.test.model.vo.GcMenuVO">
        select
        <include refid="Base_Column_List"></include>
        from t_gc_menu t
        where t.deleted = 0
        t.id = #{id}
    </select>

    <!-- 全部查询 -->
    <select id="list" resultType="io.github.wslxm.springbootplus2.manage.test.model.vo.GcMenuVO">
        select
        <include refid="Base_Column_List"></include>
        from t_gc_menu t
        where t.deleted = 0

        <if test="query.pid != null and query.pid  != ''">
            and t.pid = #{query.pid}
        </if>
        <if test="query.name != null and query.name  != ''">
            and t.`name` like concat(#{query.name},'%')
        </if>
        <if test="query.disable != null">
            and t.`disable` = #{query.disable}
        </if>
        order by t.create_time desc
    </select>

</mapper>





© 2015 - 2024 Weber Informatics LLC | Privacy Policy