admin管理员组

文章数量:1530085

今天学习到了做一个三级联动,还要可以进行模糊查询,看了很多CSDN的文章,写的都不太清楚,对于俺这种小白极为不友好,看到这个大佬的文章,非常感谢,自己就照抄了一波 链接

SQL

CREATE TABLE `equipment` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `name` varchar(50) NOT NULL COMMENT '名称',
  `model` varchar(50) DEFAULT NULL COMMENT '型号',
  `unit_price` int(10) DEFAULT NULL COMMENT '产品单价',
  `parent_id` bigint(20) DEFAULT '0' COMMENT '父设备ID',
  `order_num` int(4) DEFAULT '0' COMMENT '显示排序',
  `type` char(1) DEFAULT '' COMMENT '设备类型(M类型 C系列 F产品)',
  `remark` varchar(500) DEFAULT '' COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8 COMMENT='备注类型管理表'

mapper.xml 就是最普通的查询所有

    <select id="selectEquipmentList" parameterType="Equipment" resultMap="EquipmentResult">
        <include refid="selectEquipmentVo"/>
        <where>
            <if test="name != null  and name != ''"> and `name` like concat('%', #{name}, '%')</if>
            <if test="model != null  and model != ''"> and model = #{model}</if>
            <if test="parentId != null  and parentId != ''"> and parentId = #{parent_id}</if>
            <if test="id != null  and id != ''"> and id = #{id}</if>
            <if test="type != null  and type != ''"> and `type` = #{type}</if>
        </where>
    </select>

mapper.java

public List<Equipment> selectEquipmentList

本文标签: 模糊分页菜单SpringBoot