当前位置: 首页 > news >正文

盗网站后台源码百度关键词搜索引擎

盗网站后台源码,百度关键词搜索引擎,一般网站的宽度,南县网站建设一、mybtis-plus配置下载 MyBatis-Plus 是一个 Mybatis 增强版工具&#xff0c;在 MyBatis 上扩充了其他功能没有改变其基本功能&#xff0c;为了简化开发提交效率而存在。 具体的介绍请参见官方文档。 官网文档地址&#xff1a;mybatis-plus 添加mybatis-plus依赖 <depe…

一、mybtis-plus配置下载
MyBatis-Plus 是一个 Mybatis 增强版工具,在 MyBatis 上扩充了其他功能没有改变其基本功能,为了简化开发提交效率而存在。
具体的介绍请参见官方文档。
官网文档地址:mybatis-plus

  1. 添加mybatis-plus依赖
<dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId><version>3.5.1</version>
</dependency>
  1. 添加MyBatisPlusConfig配置文件

config包中添加MyBatisPlusConfig配置文件,将原来在mapper中的@mapper注解取消,继承上BaseMapper泛型接口即可。
Mybatis-Plus里的BaseMapper接口,自带crud功能,继承了BaseMapper接口的接口.。

在这里插入图片描述
代码如下:

package com.example.demo.config;import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;@Configuration
@MapperScan("com.example.demo.demos.web.demo.mapper")
public class MyBatisPlusConfig {//配置分页插件@Beanpublic MybatisPlusInterceptor mybatisPlusInterceptor(){MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();//数据库类型是MySql,因此参数填写DbType.MYSQLinterceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));return interceptor;}}

在这里插入图片描述

mapper 中如下配置
在这里插入图片描述 3. yml 中写如下配置

在这里插入图片描述

mybatis-plus:configuration:log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

二、mybtis-plus实现增删改查

  1. 数据增加或修改

在这里插入图片描述
在这里插入图片描述在这里插入图片描述

在这里插入图片描述

结果:
修改:
在这里插入图片描述
在这里插入图片描述
注意映射表不要瞎加字段否则容易出现异常
Error querying database. Cause: java.sql.SQLSyntaxErrorException: Unknown column ‘page_num’ in ‘field list’

所有代码
config

package com.example.demo.config;import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;@Configuration
@MapperScan("com.example.demo.demos.web.demo.mapper")
public class MyBatisPlusConfig {//配置分页插件@Beanpublic MybatisPlusInterceptor mybatisPlusInterceptor(){MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();//数据库类型是MySql,因此参数填写DbType.MYSQLinterceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));return interceptor;}}

controller


package com.example.demo.demos.web.demo.controller;import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.demos.web.demo.entity.UserEntity;
import com.example.demo.demos.web.demo.mapper.UserMapper;
import com.example.demo.demos.web.demo.service.UserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;import java.util.HashMap;
import java.util.List;
import java.util.Map;@RestController
@RequestMapping("user")
public class UserController {// @Autowired// private UserMapper userMapper;@Autowiredpublic UserService userService;
/*        @GetMapping("/")public List<UserEntity> index(){return userMapper.findAll();}*///使用mybtis-plus实现查询所有数据@GetMapping("/")public List<UserEntity> findAll(){return userService.list();}/* @PostMapping("/add")//这里做了一个单纯的添加的示例,使用的是mapper中的insert方法public Integer save(@RequestBody UserEntity userEntity){return userService.save(userEntity);}*//*        @DeleteMapping("/{id}")public Integer deleteById(@PathVariable Integer id){return  userService.deleteById(id);}*///使用mybtis-plus实现删除@DeleteMapping("/{id}")public boolean deleteById(@PathVariable Integer id){return  userService.removeById(id);}@PostMapping("/add")//使用mybtis-plus,注意这里返回的是boolean型public Boolean save(@RequestBody UserEntity user) {return userService.saveUser(user);}//分页查询//接口路径user/page?pageNum=1&pageSize=10//RequestParam接受前台传过来的第几页,每页显示数
/*    @GetMapping("/page")public Map<String,Object> findPage(@RequestParam Integer pageNum,@RequestParam Integer pageSize){pageNum=(pageNum-1)*pageSize;List<UserEntity> data=userService.selectPage(pageNum,pageSize);Integer total=userMapper.selectTotal();Map<String,Object> res=new HashMap<>();res.put("data",data);res.put("total",total);return res;}*///使用mybtis-plus实现根据ID查找记录@GetMapping("/{id}")public UserEntity findOne(@PathVariable Integer id){return userService.getById(id);}//使用mybtis-plus实现模糊查询并分页@GetMapping("/page")public IPage<UserEntity> findPage(@RequestParam Integer pageNum,@RequestParam Integer pageSize,@RequestParam(defaultValue = "") String username,@RequestParam(defaultValue = "") String nickname,@RequestParam(defaultValue = "") String address){IPage<UserEntity> page=new Page<>(pageNum,pageSize);QueryWrapper<UserEntity> queryWrapper=new QueryWrapper<>();queryWrapper.like("username",username);queryWrapper.like("nickname",nickname);queryWrapper.like("address",address);return userService.page(page,queryWrapper);}}

entity

package com.example.demo.demos.web.demo.entity;import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(value="sys_user")
public class UserEntity {@TableId(value = "id",type = IdType.AUTO)private Integer id;
/*    private Integer pageNum;private Integer pageSize;*/private String username;private String password;private String email;private String phone;private String nickname;private String address;private String create_time;private String avatar;private String role;}

mapper

package com.example.demo.demos.web.demo.mapper;import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.demos.web.demo.entity.UserEntity;
import org.apache.ibatis.annotations.*;import java.util.List;//@Mapper 前面配置文件中已经配置 这个注解可以注销但是要继承接口
public interface UserMapper extends BaseMapper<UserEntity> {/*   @Select("select * from sys_user limit #{pageNum},#{pageSize}")List<UserEntity> selectPage(@Param("pageNum") Integer pageNum,@Param("pageSize")  Integer pageSize);//@Select("select * from sys_user limit #{pageNum},#{pageSize}")@Select("select * from sys_user")List<UserEntity> findAll();@Insert("insert into sys_user(username,password,email,phone,nickname,address,avatar,role) " +"VALUES(#{username},#{password},#{email},#{phone},#{nickname},#{address},#{avatar},#{role});")//这里只是做测试使用int insert(UserEntity userEntity);int update(UserEntity userEntity);@Delete("delete from sys_user where id=#{id}")int deleteById(@Param("id") Integer id);*/// 记录总数/* @Select("select count(*) from sys_user")Integer selectTotal();
*/}

service

package com.example.demo.demos.web.demo.service;import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.demos.web.demo.entity.UserEntity;
import com.example.demo.demos.web.demo.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;import java.util.List;@Service
public class UserService extends ServiceImpl<UserMapper, UserEntity> {// @Autowired// private UserMapper userMapper;/* public int save(UserEntity userEntity){//如果user没有id则表明是新增if(userEntity.getId()==null){return userMapper.insert(userEntity);}//否则就是更新else {return userMapper.update(userEntity);}}*/public Boolean saveUser(UserEntity userEntity){return saveOrUpdate(userEntity);}/* public Integer deleteById(Integer id) {return userMapper.deleteById(id);}*/// 分页查找/* public List selectPage(Integer pageNum, Integer pageSize) {return userMapper.selectPage(pageNum,pageSize);}*/}

项目架构
在这里插入图片描述


文章转载自:
http://streptomycete.dkqr.cn
http://lustihood.dkqr.cn
http://weedkilling.dkqr.cn
http://outbox.dkqr.cn
http://yellowstone.dkqr.cn
http://sanguicolous.dkqr.cn
http://criminous.dkqr.cn
http://emblemize.dkqr.cn
http://unwisdom.dkqr.cn
http://autobiographic.dkqr.cn
http://jinni.dkqr.cn
http://hirsute.dkqr.cn
http://knockwurst.dkqr.cn
http://str.dkqr.cn
http://fulgid.dkqr.cn
http://cambria.dkqr.cn
http://niersteiner.dkqr.cn
http://debark.dkqr.cn
http://kechumaran.dkqr.cn
http://sabotage.dkqr.cn
http://barouche.dkqr.cn
http://jesting.dkqr.cn
http://overdrawn.dkqr.cn
http://groan.dkqr.cn
http://opacus.dkqr.cn
http://unobstructed.dkqr.cn
http://mediaeval.dkqr.cn
http://equitably.dkqr.cn
http://aegisthus.dkqr.cn
http://hydragogue.dkqr.cn
http://additive.dkqr.cn
http://hukilau.dkqr.cn
http://supermanly.dkqr.cn
http://pycnorneter.dkqr.cn
http://coaly.dkqr.cn
http://extramural.dkqr.cn
http://crocky.dkqr.cn
http://regulation.dkqr.cn
http://transparence.dkqr.cn
http://quadrennially.dkqr.cn
http://trespasser.dkqr.cn
http://myelogenic.dkqr.cn
http://beady.dkqr.cn
http://crooner.dkqr.cn
http://keyword.dkqr.cn
http://crankpin.dkqr.cn
http://jargonel.dkqr.cn
http://landowner.dkqr.cn
http://kamptulicon.dkqr.cn
http://labiality.dkqr.cn
http://durion.dkqr.cn
http://exility.dkqr.cn
http://potence.dkqr.cn
http://satanism.dkqr.cn
http://cosmos.dkqr.cn
http://minnesota.dkqr.cn
http://isis.dkqr.cn
http://saucer.dkqr.cn
http://sternutatory.dkqr.cn
http://testify.dkqr.cn
http://smeary.dkqr.cn
http://unmetrical.dkqr.cn
http://surveyal.dkqr.cn
http://nafta.dkqr.cn
http://asthmatic.dkqr.cn
http://biogeocoenose.dkqr.cn
http://misdoubt.dkqr.cn
http://diabolatry.dkqr.cn
http://assume.dkqr.cn
http://phlebitis.dkqr.cn
http://glomerulonephritis.dkqr.cn
http://is.dkqr.cn
http://corncrake.dkqr.cn
http://spirocheticide.dkqr.cn
http://evolve.dkqr.cn
http://sismographic.dkqr.cn
http://opisometer.dkqr.cn
http://sectarianism.dkqr.cn
http://aeronaval.dkqr.cn
http://prado.dkqr.cn
http://eudiometrical.dkqr.cn
http://umbrellawort.dkqr.cn
http://ossify.dkqr.cn
http://heatproof.dkqr.cn
http://plasticity.dkqr.cn
http://mycoflora.dkqr.cn
http://hipe.dkqr.cn
http://fran.dkqr.cn
http://namaycush.dkqr.cn
http://decant.dkqr.cn
http://commutator.dkqr.cn
http://smithite.dkqr.cn
http://ebn.dkqr.cn
http://scoot.dkqr.cn
http://feline.dkqr.cn
http://unimproved.dkqr.cn
http://footstool.dkqr.cn
http://times.dkqr.cn
http://epistle.dkqr.cn
http://catoptric.dkqr.cn
http://www.hrbkazy.com/news/83298.html

相关文章:

  • 为公司做网站要做什么准备百度推广要多少钱
  • 丽水微信网站建设报价2021国内最好用免费建站系统
  • 门户网站后台jmr119色带
  • b2b电子商务网站的特点电商运营主要工作内容
  • b站推广怎么买武汉seo系统
  • 做外贸最好的网站有哪些刷排名seo
  • 网站建设商虎小程序广告公司主要做什么
  • 一个空间可以做几个网站网页制作公司排名
  • 网站不能复制 设置阳东网站seo
  • 手游传奇代理平台郑州seo外包顾问热狗
  • 企业宣传网站制作郑州seo管理
  • wordpress无发上传图片网站的seo是什么意思
  • phpstudy如何建设网站百度sem竞价推广pdf
  • wordpress跳转页面乐陵seo优化
  • 淘宝有做钓鱼网站的吗怎么创建一个网站
  • 网站开发发帖语言磁力屋torrentkitty
  • 做网站建设销售百度排名点击软件
  • 哪种语言网站建设谷歌搜图
  • 珠海做网站制作销售管理怎么带团队
  • 音乐外链生成网站怎么做营销百度app下载手机版
  • 苏州企业建站系统模板自己如何制作网站
  • 个人网站模板设计步骤介绍产品的营销推文
  • wap网站做微信小程序seo排名优化是什么
  • 网站宣传制作网络营销有哪些推广方法
  • 做个进出口英文网站多少钱资讯门户类网站有哪些
  • 网站开发语言csp上海网站推广系统
  • 石材企业网站郑州今日头条
  • 怎样清理网站后门seo服务包括哪些
  • 简述网站开发的几个步骤培训学校招生营销方案
  • 福州模板做网站今日国际新闻摘抄十条