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

商品管理图片更换实现

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.java1234.mapper.ProductMapper"><resultMap id="productResult" type="com.java1234.entity.Product"><association property="type" column="typeId" select="com.java1234.mapper.SmallTypeMapper.findById"></association></resultMap><select id="list" parameterType="Map" resultMap="productResult">select * from t_product<where><if test="name!=null and name!='' ">and name like concat('%',#{name},'%')</if></where><if test="start!=null and pageSize!=null ">limit #{start},#{pageSize}</if></select><select id="getTotal" parameterType="Map" resultType="Long">select count(*) from t_product<where><if test="name!=null and name!='' ">and name like concat('%',#{name},'%')</if></where></select><insert id="add" parameterType="com.java1234.entity.Product">insert into t_product values(null,#{name},#{price},#{stock},#{proPic},#{hot},#{swiper},#{swiperPic},#{swiperSort},#{type.id},null,#{productIntroImgs},#{productParaImgs},#{description});</insert><update id="update" parameterType="com.java1234.entity.Product">update t_product<set><if test="name!=null and name!=''">name=#{name},</if><if test="price!=null">price=#{price},</if><if test="stock!=null">stock=#{stock},</if><if test="type!=null and type.id!=null">typeId=#{type.id},</if><if test="proPic!=null and proPic!=''">proPic=#{proPic},</if><if test="description!=null and description!=''">description=#{description},</if><if test="productIntroImgs!=null and productIntroImgs!=''">productIntroImgs=#{productIntroImgs},</if><if test="productParaImgs!=null and productParaImgs!=''">productParaImgs=#{productParaImgs},</if><if test="swiperPic!=null and swiperPic!=''">swiperPic=#{swiperPic},</if><if test="swiperSort!=null">swiperSort=#{swiperSort},</if></set>where id=#{id}</update><select id="findById" parameterType="Integer" resultMap="productResult">select * from t_product where id=#{id}</select></mapper>
package com.java1234.controller.admin;import com.java1234.entity.*;
import com.java1234.service.IProductService;
import com.java1234.util.DateUtil;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;import java.io.File;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;/*** 管理端-商品Controller控制器* @author java1234_小锋* @site www.java1234.com* @company 南通小锋网络科技有限公司* @create 2022-02-14 6:54*/
@RestController
@RequestMapping("/admin/product")
public class AdminProductController {@Autowiredprivate IProductService productService;@Value("${productImagesFilePath}")private String productImagesFilePath;/*** 根据条件分页查询* @param pageBean* @return*/@RequestMapping("/list")public R list(@RequestBody PageBean pageBean){System.out.println(pageBean);Map<String,Object> map=new HashMap<>();map.put
http://www.lryc.cn/news/228356.html

相关文章:

  • SDL2 加载图片
  • 监控和数据采集软件架构和详细设计
  • 链动2+1模式系统开发之区域代理深度解析
  • Amazon Bedrock | 大语言模型CLAUDE 2体验
  • 通讯协议学习之路(实践部分):IIC开发实践
  • 『亚马逊云科技产品测评』活动征文|搭建带有“弱”图像处理功能的流媒体服务器
  • 正交矩阵的定义
  • K8S集群etcd 某个节点数据不一致如何修复 —— 筑梦之路
  • selenium/webdriver运行原理与机制
  • 论文阅读[121]使用CAE+XGBoost从荧光光谱中检测和识别饮用水中的有机污染物
  • Juniper SRX PPPoE配置
  • 虚拟仪器软件结构VISA
  • /etc/init.d/functions: Syntax error: “(“ unexpected (expecting “done“)
  • Google/微端/Amazon/IBM四个厂家在分布式里面提供的服务总结
  • 计网:第一章 概述
  • RT-DETR算法优化改进:新颖的多尺度卷积注意力(MSCA),即插即用,助力小目标检测 | NeurIPS2022
  • 基于遗传算法改进的GRNN多输入多输出回归预测,基于多目标遗传算法+GRNN的帕累托前沿求解,基于遗传工具箱调用GRNN模型的多目标求解
  • vue2按需导入Element(vite打包)
  • 力扣117双周赛
  • SPI简介及FPGA通用MOSI模块实现
  • K8S篇之K8S详解
  • 进博会再现上亿大单 EZZ携手HIC海橙嗨选签署2024年度合作备忘录
  • 深度学习基于python+TensorFlow+Django的花朵识别系统
  • Azure 机器学习 - 机器学习中的企业安全和治理
  • Unity - 各向异性 - 丝绸材质
  • MySQL中UUID主键的优化
  • Python实现WOA智能鲸鱼优化算法优化BP神经网络分类模型(BP神经网络分类算法)项目实战
  • Rust语言代码示例
  • 【SpringBoot3+Vue3】一【基础篇】
  • 麒麟信安登录央视,深度展现为中国信息安全铸“魂”之路