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

南宁做网站在哪了宁波网站建设企业网站制作

南宁做网站在哪了,宁波网站建设企业网站制作,福州企业网站制作,上传下载网站模板目录 手摸手2-springboot编写基础的增删改查创建controller层添加service层接口service层实现添加mapper层mapper层对应的sql添加扫描注解,对应sql文件的目录 手摸手2-springboot编写基础的增删改查 创建controller层 实现 test 表中的添加、修改、删除及列表查询接口#x… 目录 手摸手2-springboot编写基础的增删改查创建controller层添加service层接口service层实现添加mapper层mapper层对应的sql添加扫描注解,对应sql文件的目录 手摸手2-springboot编写基础的增删改查 创建controller层 实现 test 表中的添加、修改、删除及列表查询接口未分页) package com.onejson.ojmall.controller;import com.onejson.ojmall.entity.TestEntity; import com.onejson.ojmall.entity.dto.TestDTO; import com.onejson.ojmall.entity.vo.TestVO; import com.onejson.ojmall.service.ITestService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*;import javax.annotation.Resource; import java.util.List;/*** 测试表** author 微信公众号 onejson* date 2023-08-11*/ RestController RequestMapping(path /test, produces application/json;charsetUTF-8) Api(value /test, tags 测试表, produces application/json;charsetUTF-8) public class TestController{Resourceprivate ITestService testService;/*** 查询列表*/ApiOperation(value 条件查询列表分页, notes 条件查询列表分页)GetMapping(/list)public ListTestEntity list(TestEntity sysTest) {return testService.selectTestList(sysTest);}/*** 新增*/ApiOperation(value 新增)PostMappingpublic boolean add(Validated RequestBody TestDTO testDTO) {return testService.insertTest(testDTO);}/*** 修改*/ApiOperation(value 更新)PutMappingpublic boolean edit(RequestBody TestDTO testDTO) {return testService.updateTest(testDTO);}/*** 详情*/ApiOperation(value 详情)GetMapping(value /{id})public TestVO getInfo(PathVariable(id) Integer id) {return testService.getTestById(id);}/*** 删除*/ApiOperation(value 删除)DeleteMapping(/{ids})public boolean remove(PathVariable Integer[] ids) {return testService.removeTestByIds(ids);}}添加service层接口 package com.onejson.ojmall.service;import com.baomidou.mybatisplus.extension.service.IService; import com.onejson.ojmall.entity.TestEntity; import com.onejson.ojmall.entity.dto.TestDTO; import com.onejson.ojmall.entity.vo.TestVO;import java.util.List;/*** 测试表** author 微信公众号 onejson* date 2023-08-11 11:24:47*/ public interface ITestService extends IServiceTestEntity {/*** 查询测试表列表** param testEntity 测试表Entity类* return list列表*/ListTestEntity selectTestList(TestEntity testEntity);/*** 新增测试表** param testDTO 测试表DTO类* return 结果*/boolean insertTest(TestDTO testDTO);/*** 更新测试表** param testDTO 测试表DTO类* return 结果*/boolean updateTest(TestDTO testDTO);/*** 详情测试表** param id id值* return 结果*/TestVO getTestById(Integer id);/*** 删除测试表** param ids id数组* return 结果*/boolean removeTestByIds(Integer[] ids);}service层实现 package com.onejson.ojmall.service.impl;import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.onejson.ojmall.entity.TestEntity; import com.onejson.ojmall.entity.dto.TestDTO; import com.onejson.ojmall.entity.vo.TestVO; import com.onejson.ojmall.mapper.TestMapper; import com.onejson.ojmall.service.ITestService; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional;import javax.annotation.Resource; import java.util.Arrays; import java.util.List;/*** 测试表** author 微信公众号 onejson* date 2023-08-11*/ Service Transactional public class TestServiceImpl extends ServiceImplTestMapper, TestEntity implements ITestService {Resourceprivate TestMapper testMapper;/*** 查询测试表列表** param testEntity 测试表Entity类* return 测试表*/Overridepublic ListTestEntity selectTestList(TestEntity testEntity) {return testMapper.selectTestList(testEntity);}/*** 新增测试表** param testDTO 测试表DTO类* return 结果*/Overridepublic boolean insertTest(TestDTO testDTO) {TestEntity testInfoEntity new TestEntity();BeanUtils.copyProperties(testDTO, testInfoEntity);return this.save(testInfoEntity);}/*** 更新测试表** param testDTO 测试表DTO类* return 结果*/Overridepublic boolean updateTest(TestDTO testDTO) {TestEntity testInfoEntity new TestEntity();BeanUtils.copyProperties(testDTO, testInfoEntity);return this.updateById(testInfoEntity);}/*** 详情测试表** param id id值* return 结果*/Overridepublic TestVO getTestById(Integer id) {TestEntity testEntity this.getById(id);TestVO testVO new TestVO();BeanUtils.copyProperties(testEntity, testVO);return testVO;}/*** 删除测试表** param ids id数组* return 结果*/Overridepublic boolean removeTestByIds(Integer[] ids) {return this.removeByIds(Arrays.asList(ids));}}添加mapper层 package com.onejson.ojmall.mapper;import com.baomidou.mybatisplus.core.mapper.BaseMapper;import com.onejson.ojmall.entity.TestEntity; import org.apache.ibatis.annotations.Mapper;import java.util.List;/*** 测试表** author 微信公众号 onejson* date 2023-08-11 11:24:47*/ Mapper public interface TestMapper extends BaseMapperTestEntity {/*** 查询测试表列表** param testEntity 测试表Entity类* return list列表*/ListTestEntity selectTestList(TestEntity testEntity);/*** 统计测试表个数** param testEntity 测试表Entity类* return 符合条件的记录个数*/Integer countTest(TestEntity testEntity);}mapper层对应的sql ?xml version1.0 encodingUTF-8? !DOCTYPE mapper PUBLIC -//mybatis.org//DTD Mapper 3.0//EN http://mybatis.org/dtd/mybatis-3-mapper.dtdmapper namespacecom.onejson.ojmall.mapper.TestMapper!-- 可根据自己的需求是否要使用 --resultMap typecom.onejson.ojmall.entity.TestEntity idtestMapresult propertyid columnid/result propertytitle columntitle//resultMapsql idselectTestselect *from test/sqlsql idwhereTestwhereif testid !null and id !AND id #{id,jdbcTypeVARCHAR}/ifif testtitle !null and title !AND title #{title,jdbcTypeVARCHAR}/if/where/sqlselect idselectTestList parameterTypecom.onejson.ojmall.entity.TestEntity resultMaptestMapinclude refidselectTest/include refidwhereTest//selectselect idcountTest parameterTypecom.onejson.ojmall.entity.TestEntity resultTypejava.lang.IntegerSELECT count(*)FROM (include refidselectTest/include refidwhereTest/) a/select/mapper添加扫描注解,对应sql文件的目录 MapperScan(com.onejson.ojmall.mapper)
http://www.pierceye.com/news/115471/

相关文章:

  • 建站系统wordpress下载哪个公司的微信商城系统
  • 网站建设app开发合同深圳企业网站制作设计方案
  • 免费网站整站模板下载寻找做网站
  • 做此广告的网站做家纺的网站
  • 湖南畅想网站建设个人网站建设基本定位
  • 建站公司外包钓鱼网站怎么做
  • 个人网站logo需要备案吗鑫灵锐做网站多少钱
  • .xyz做网站怎么样网站产品预算
  • 建网站先要申请网址吗做网站给文件不侵权
  • 一元夺宝网站建设Wordpress 普通图片裁剪
  • 网站推广都有哪些自己有网站怎么优化
  • 宠物交易网站模板更改wordpress后台登录地址
  • 有电脑网站怎样建手机正规网络游戏平台
  • 网站抓取QQ获取系统cms监控手机客户端
  • 郑州网站推广价格优礼品网站模板
  • 百度指数不高的网站怎么优化网站图片类型
  • 北京专业做网站怎么样app软件开发摄像头
  • 网站建设导向erp系统软件免费版
  • 手表网站网站开发毕业设计文献综述
  • 台州网站制作维护关于微网站策划ppt怎么做
  • 网站建设中期目标开发app找那个公司
  • 跨境自建站模板网站内容和功能清单
  • 平面设计找素材的网站电子商务网站建设的步骤一般为(
  • 一个服务器可以备案几个网站凡科门店通怎么样
  • 房地产企业网站建设想给公司产品做个推广
  • 国外网站平台wordpress电脑安装教程
  • 网站开发合肥诚聘网站开发人员
  • 网站开发者模式怎么保存网站首页调用网站标题
  • 仿京东网站模板wordpress单页视差
  • php mysql 网站建设html5手机网站模板