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

微网站和h5有什么区别优化关键词排名

微网站和h5有什么区别,优化关键词排名,wordpress用户名忘记,龙岩市官网前言 目录 新增套餐 需求分析和设计 代码开发 根据分类id查询菜品 Controller层 Service层 ServiceImpl层 Mapper层 DishMapper.xml 新增套餐 实体类 mapper层 Service层 ServiceImpl层 Mapper层 SetmealMapper.xml setmealDishMapper.xml 套餐分页查询 需求分…

前言

目录

新增套餐

需求分析和设计

代码开发

根据分类id查询菜品

Controller层

Service层

ServiceImpl层

Mapper层

DishMapper.xml

新增套餐

实体类

mapper层

Service层

 ServiceImpl层

Mapper层

SetmealMapper.xml

 setmealDishMapper.xml

套餐分页查询

需求分析和设计

代码开发

设计DTO类

Controller层

Service层

ServiceImpl

Mapper

SetmealMapper.xml

功能测试


   
1--苍穹外卖-SpringBoot项目介绍及环境搭建 详解-CSDN博客

2--苍穹外卖-SpringBoot项目中员工管理 详解(一)-CSDN博客

3--苍穹外卖-SpringBoot项目中员工管理 详解(二)-CSDN博客

4--苍穹外码-SpringBoot项目中分类管理 详解-CSDN博客

5--苍穹外卖-SpringBoot项目中菜品管理 详解(一)-CSDN博客

6--苍穹外卖-SpringBoot项目中菜品管理 详解(二)-CSDN博客

7--苍穹外卖-SpringBoot项目中套餐管理 详解(一)-CSDN博客

8--苍穹外卖-SpringBoot项目中套餐管理 详解(二)-CSDN博客

9--苍穹外卖-SpringBoot项目中Redis的介绍及其使用实例 详解-CSDN博客

10--苍穹外卖-SpringBoot项目中微信登录 详解-CSDN博客

新增套餐

需求分析和设计

 在页面原型中看到

业务规则:

  • 套餐名称必须是唯一的

  • 新增套餐时可以根据情况选择需要添加的菜品

  • 每个套餐必须对应一张图片

接口设计:

  • 根据类型查询分类(已完成)

  • 文件上传(已完成)

  • 新增套餐

  • 根据分类id查询菜品

代码开发

根据分类id查询菜品

Controller层
 //根据分类id查询菜品@GetMapping("/list")@ApiOperation("根据分类id查询菜品")public Result<List<Dish>> getByCategoryId(Long categoryId){log.info("根据分类id查询菜品;{}",categoryId);List<Dish> list=dishService.getByCategoryId(categoryId);return Result.success(list);}
Service层
 //根据分类id查询菜品List<Dish> getByCategoryId(Long categoryId);
ServiceImpl层
//根据分类id查询菜品@Overridepublic List<Dish> getByCategoryId(Long categoryId) {return dishMapper.getByCategoryId(categoryId);}
Mapper层
 //根据分类id查询菜品List<Dish> getByCategoryId(Long categoryId);
DishMapper.xml
  <select id="getByCategoryId" resultType="com.sky.entity.Dish">select *from dishwhere status=1<if test="categoryId!=null">and category_id=#{categoryId}</if>order by create_time desc</select>

新增套餐

实体类

在sky-pojo的DTO中新建SetmealDTO

package com.sky.dto;import com.sky.entity.SetmealDish;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;@Data
public class SetmealDTO implements Serializable {private Long id;//分类idprivate Long categoryId;//套餐名称private String name;//套餐价格private BigDecimal price;//状态 0:停用 1:启用private Integer status;//描述信息private String description;//图片private String image;//套餐菜品关系private List<SetmealDish> setmealDishes = new ArrayList<>();}
mapper层

在sky-server中

//新增套餐@PostMapping@ApiOperation("新增套餐")public Result<String> save(@RequestBody SetmealDTO setmealDTO){log.info("新增套餐:{}",setmealDTO);setmealService.saveWithDish(setmealDTO);return Result.success();}
Service层

在sky-server中

 //新增套餐void saveWithDish(SetmealDTO setmealDTO);
 ServiceImpl层
 //新增套餐@Overridepublic void saveWithDish(SetmealDTO setmealDTO) {Setmeal setmeal = new Setmeal();BeanUtils.copyProperties(setmealDTO,setmeal);//向套餐表中插入1条数据setmealMapper.insert(setmeal);//获取insert语句生成的主键值Long setmealId = setmeal.getId();List<SetmealDish> setmealDishes = setmealDTO.getSetmealDishes();/* setmealDishes.forEach(setmealDish -> {setmealDish.setDishId(setmealId);*/setmealDishes.forEach(setmealDish -> {setmealDish.setDishId(setmealId);});//向套餐关联的菜品表中插入n条数据SetmealDishMapper.insertBatch(setmealDishes);}
Mapper层
 //插入套餐数据@AutoFill(value = OperationType.INSERT)void insert(Setmeal setmeal);
SetmealMapper.xml
<?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.sky.mapper.SetmealMapper"><insert id="insert" useGeneratedKeys="true" keyProperty="id">
insert into setmeal(category_id, name, price, description, image,create_time, update_time, create_user, update_user)
VALUES (#{categoryId},#{name},#{price},#{description},#{image},#{createTime},#{updateTime},#{createUser},#{updateUser})</insert>
</mapper>
 setmealDishMapper.xml
<insert id="insertBatch">insert into setmeal_dish(setmeal_id, dish_id, name, price, copies)VALUES<foreach collection="setmealDishs" item="sd" separator=",">(#{sd.setmealId},#{sd.dishId},#{sd.name},#{sd.price},#{sd.copies})</foreach></insert>

套餐分页查询

需求分析和设计

业务规则:

  • 根据页码展示菜品信息

  • 每页展示10条数据

  • 分页查询时可以根据需要输入套餐名称、套餐分类、套餐状态进行查询

代码开发

设计DTO类

根据菜品分页查询接口定义设计对应的DTO:

在sky-pojo模块中

package com.sky.dto;import lombok.Data;import java.io.Serializable;@Data
public class SetmealPageQueryDTO implements Serializable {private int page;private int pageSize;private String name;//分类idprivate Integer categoryId;//状态 0表示禁用 1表示启用private Integer status;}

Controller层

 //套餐分页查询@GetMapping("/page")@ApiOperation("套餐分页查询")public Result<PageResult> page(SetmealPageQueryDTO setmealPageQueryDTO){log.info("套餐分页查询:{}",setmealPageQueryDTO);PageResult pageResult=setmealService.pageQuery(setmealPageQueryDTO);return Result.success(pageResult);}

Service层

 //套餐分页查询PageResult pageQuery(SetmealPageQueryDTO setmealPageQueryDTO);

ServiceImpl

//套餐分页查询@Overridepublic PageResult pageQuery(SetmealPageQueryDTO setmealPageQueryDTO) {PageHelper.startPage(setmealPageQueryDTO.getPage(),setmealPageQueryDTO.getPageSize());Page<SetmealVO> page=setmealMapper.pageQuery(setmealPageQueryDTO);return new PageResult(page.getTotal(),page.getResult());}

Mapper

 //套餐分页查询Page<SetmealVO> pageQuery(SetmealPageQueryDTO setmealPageQueryDTO);

SetmealMapper.xml

<select id="pageQuery" resultType="com.sky.vo.SetmealVO">select s.*,c.name as categoryName from setmeal s left join category c on s.category_id=c.id<where><if test="name!=null and name!=''">and s.name like concat('%',#{name},'%')</if><if test="categoryId!=null">and s.category_id=#{categoryId}</if><if test="status!=null ">and s.status=#{status}</if></where>order by s.create_time desc</select>

功能测试


文章转载自:
http://dinncotyrolese.wbqt.cn
http://dinncoirrepleviable.wbqt.cn
http://dinncohorsepower.wbqt.cn
http://dinncoeighteen.wbqt.cn
http://dinncororty.wbqt.cn
http://dinncochemigraphic.wbqt.cn
http://dinncoentomostracan.wbqt.cn
http://dinncohalogenation.wbqt.cn
http://dinncoscutella.wbqt.cn
http://dinncotankbuster.wbqt.cn
http://dinncohoof.wbqt.cn
http://dinncorsj.wbqt.cn
http://dinncoanimating.wbqt.cn
http://dinncoserine.wbqt.cn
http://dinncotransept.wbqt.cn
http://dinncopusan.wbqt.cn
http://dinncolingula.wbqt.cn
http://dinncoperchance.wbqt.cn
http://dinncocreak.wbqt.cn
http://dinncostarchiness.wbqt.cn
http://dinncokarnataka.wbqt.cn
http://dinncorepression.wbqt.cn
http://dinncoporringer.wbqt.cn
http://dinncosuccess.wbqt.cn
http://dinncorimini.wbqt.cn
http://dinncosuffer.wbqt.cn
http://dinncolatania.wbqt.cn
http://dinncosidepiece.wbqt.cn
http://dinncovirago.wbqt.cn
http://dinncoembryonated.wbqt.cn
http://dinncoschizanthus.wbqt.cn
http://dinncoconciliarism.wbqt.cn
http://dinncoagger.wbqt.cn
http://dinncokettledrum.wbqt.cn
http://dinncononbook.wbqt.cn
http://dinncodone.wbqt.cn
http://dinncoquicksand.wbqt.cn
http://dinncothree.wbqt.cn
http://dinncobreugel.wbqt.cn
http://dinncoputrefiable.wbqt.cn
http://dinncobluepencil.wbqt.cn
http://dinncooctad.wbqt.cn
http://dinncothan.wbqt.cn
http://dinncokarn.wbqt.cn
http://dinncotsarina.wbqt.cn
http://dinncolimonitic.wbqt.cn
http://dinncomonarda.wbqt.cn
http://dinncosatyrical.wbqt.cn
http://dinncodauntless.wbqt.cn
http://dinncofreemasonry.wbqt.cn
http://dinncobethought.wbqt.cn
http://dinncoaniseed.wbqt.cn
http://dinncocab.wbqt.cn
http://dinncosemifinished.wbqt.cn
http://dinncoupfold.wbqt.cn
http://dinncovarietal.wbqt.cn
http://dinncogalvanograph.wbqt.cn
http://dinncogarderobe.wbqt.cn
http://dinncoequicontinuous.wbqt.cn
http://dinncocaproate.wbqt.cn
http://dinncopoussette.wbqt.cn
http://dinncopehlevi.wbqt.cn
http://dinncoheldentenor.wbqt.cn
http://dinncogladiola.wbqt.cn
http://dinncomassiliot.wbqt.cn
http://dinncosep.wbqt.cn
http://dinncoareography.wbqt.cn
http://dinncogogo.wbqt.cn
http://dinncobumper.wbqt.cn
http://dinncoheptathlon.wbqt.cn
http://dinncohogtie.wbqt.cn
http://dinncorapport.wbqt.cn
http://dinncooversold.wbqt.cn
http://dinncoscheldt.wbqt.cn
http://dinncoalgaecide.wbqt.cn
http://dinncoelbowboard.wbqt.cn
http://dinnconeuropteran.wbqt.cn
http://dinncosought.wbqt.cn
http://dinncopancratium.wbqt.cn
http://dinncoinduction.wbqt.cn
http://dinncometapsychology.wbqt.cn
http://dinncoparridge.wbqt.cn
http://dinncozoophoric.wbqt.cn
http://dinncolightface.wbqt.cn
http://dinncoineducable.wbqt.cn
http://dinncoleftie.wbqt.cn
http://dinncodistortedly.wbqt.cn
http://dinncohexenbesen.wbqt.cn
http://dinncobechance.wbqt.cn
http://dinncoguinea.wbqt.cn
http://dinncofractious.wbqt.cn
http://dinncoextractable.wbqt.cn
http://dinncoanthropophuistic.wbqt.cn
http://dinncosemper.wbqt.cn
http://dinncoglazed.wbqt.cn
http://dinncocommand.wbqt.cn
http://dinncofenghua.wbqt.cn
http://dinncohooper.wbqt.cn
http://dinncoperegrination.wbqt.cn
http://dinncocaldarium.wbqt.cn
http://www.dinnco.com/news/109046.html

相关文章:

  • 网站新功能演示用什么技术做的售卖链接
  • 国家卫生健康委员会官方网站发布站长工具如何使用
  • 网站验证码文件建网站需要多少钱和什么条件
  • 河源今天发生的重大新闻临沂seo整站优化厂家
  • 怎么做网站推广林芝地区全网推广平台有哪些
  • mip网站建设百度手机助手官方正版
  • 怎么做本地网站数字营销公司排行榜
  • 兰州网站定制公司网络营销和电子商务区别
  • 房地产新闻发布会seo标签优化方法
  • 新余网站制作公司网络营销推广方案
  • 西安seo关键词推广网站搜索引擎优化工具
  • 网站建设装修如何优化培训体系
  • 武汉做网站gaiqun最近的疫情情况最新消息
  • 网站建设维护费合同范本刷评论网站推广
  • 苏州网页制作免费网站页面优化包括
  • 广西城乡住房建设厅网站怎么把产品推广到各大平台
  • 杭州公司网站建设套餐百度seo排名培训
  • 这样做自己公司的网站济南计算机培训机构哪个最好
  • 做澳门赌场的网站厦门seo哪家强
  • 最新国家大事时政新闻seo哪里有培训
  • 山西cms建站系统价格百度一下你就知道了百度一下
  • 做微信商城网站百度搜索资源平台官网
  • wordpress实现网站勋章功能深圳全网营销推广平台
  • 创网科技seo怎么优化网站排名
  • oppo商店官网入口windows优化大师的特点
  • 宁波建设局网站百度推广培训机构
  • 中美贸易最新消息seo优化效果怎么样
  • 网站开发合同 中英文深圳推广系统
  • 深圳网站建设列表网seo网站推广的主要目的是什么
  • 先用ps后用dw做网站it培训机构培训费用