品牌列表

dev798
wxy 2024-04-28 08:59:08 +08:00
parent 52f73f312c
commit ed4e2cb188
50 changed files with 1803 additions and 123 deletions

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.muyu</groupId>
<artifactId>muyu-modules-file</artifactId>
<version>3.6.3</version>
</parent>
<artifactId>muyu-file-common</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- SpringCloud Alibaba Nacos -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- SpringCloud Alibaba Nacos Config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- SpringCloud Alibaba Sentinel -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<!-- SpringBoot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- FastDFS -->
<dependency>
<groupId>com.github.tobato</groupId>
<artifactId>fastdfs-client</artifactId>
</dependency>
<!-- Minio -->
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>${minio.version}</version>
</dependency>
<!-- MuYu Common Swagger -->
<dependency>
<groupId>com.muyu</groupId>
<artifactId>muyu-common-swagger</artifactId>
</dependency>
<!-- MuYu Common System-->
<dependency>
<groupId>com.muyu</groupId>
<artifactId>muyu-common-system</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,50 @@
package com.muyu.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
*
*
* @author ruoyi
*/
public class SysFile
{
/**
*
*/
private String name;
/**
*
*/
private String url;
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public String getUrl()
{
return url;
}
public void setUrl(String url)
{
this.url = url;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("name", getName())
.append("url", getUrl())
.toString();
}
}

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.muyu</groupId>
<artifactId>muyu-modules-file</artifactId>
<version>3.6.3</version>
</parent>
<artifactId>muyu-file-remote</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.muyu</groupId>
<artifactId>muyu-file-common</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,33 @@
package com.muyu.remote;
import com.muyu.common.core.constant.ServiceNameConstants;
import com.muyu.common.core.domain.R;
import com.muyu.common.system.domain.SysFile;
import com.muyu.common.system.remote.factory.RemoteFileFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
/**
*
*
* @author ruoyi
*/
@FeignClient(contextId = "remoteFileService", value = ServiceNameConstants.FILE_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class)
public interface RemoteFileService
{
/**
*
*
* @param file
* @return
*/
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public R<SysFile> upload(@RequestPart(value = "file") MultipartFile file);
}

View File

@ -0,0 +1,35 @@
package com.muyu.remote.factory;
import com.muyu.common.core.domain.R;
import com.muyu.common.system.domain.SysFile;
import com.muyu.remote.RemoteFileService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
/**
*
*
* @author ruoyi
*/
@Component
public class RemoteFileFallbackFactory implements FallbackFactory<RemoteFileService>
{
private static final Logger log = LoggerFactory.getLogger(RemoteFileFallbackFactory.class);
@Override
public RemoteFileService create(Throwable throwable)
{
log.error("文件服务调用失败:{}", throwable.getMessage());
return new RemoteFileService()
{
@Override
public R<SysFile> upload(MultipartFile file)
{
return R.fail("上传文件失败:" + throwable.getMessage());
}
};
}
}

View File

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.muyu</groupId>
<artifactId>muyu-modules-file</artifactId>
<version>3.6.3</version>
</parent>
<artifactId>muyu-file-server</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.muyu</groupId>
<artifactId>muyu-file-common</artifactId>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- 加入maven deploy插件当在deploy时忽略些model-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -7,6 +7,12 @@
<artifactId>muyu-modules</artifactId>
<version>3.6.3</version>
</parent>
<packaging>pom</packaging>
<modules>
<module>muyu-file-common</module>
<module>muyu-file-remote</module>
<module>muyu-file-server</module>
</modules>
<modelVersion>4.0.0</modelVersion>
<artifactId>muyu-modules-file</artifactId>

View File

@ -74,6 +74,13 @@ public class GenController extends BaseController {
return getDataTable(list);
}
@GetMapping("/db/databaseNameList")
public Result<List<String>> databaseNameList () {
List<String> list = genTableService.databaseNameList();
return Result.success(list);
}
/**
*
*/

View File

@ -89,4 +89,6 @@ public interface GenTableMapper extends BaseMapper<GenTable> {
* @return
*/
int deleteGenTableByIds (Long[] ids);
List<String> databaseNameList();
}

View File

@ -401,6 +401,11 @@ public class GenTableServiceImpl implements IGenTableService {
}
}
@Override
public List<String> databaseNameList() {
return genTableMapper.databaseNameList();
}
/**
*
*

View File

@ -128,4 +128,6 @@ public interface IGenTableService {
* @param genTable
*/
void validateEdit (GenTable genTable);
List<String> databaseNameList();
}

View File

@ -249,6 +249,13 @@
order by c.sort
</select>
<select id="databaseNameList" resultType="java.lang.String">
SELECT table_schema AS databasename
FROM information_schema.tables
WHERE table_schema NOT IN ("information_schema", "mysql", "performance_schema")
GROUP BY table_schema;
</select>
<insert id="insertGenTable" parameterType="com.muyu.gen.domain.GenTable" useGeneratedKeys="true" keyProperty="tableId">
insert into gen_table (
<if test="tableName != null">table_name,</if>

View File

@ -0,0 +1,125 @@
package com.nuyu.product.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.muyu.common.core.annotation.Excel;
import com.muyu.common.core.web.domain.BaseEntity;
/**
* mall_product_brand_info
*
* @author wangxinyuan
* @date 2024-04-27
*/
public class MallProductBrandInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** ID */
private Long id;
/** 品牌名称 */
@Excel(name = "品牌名称")
private String name;
/** 品牌描述 */
@Excel(name = "品牌描述")
private String productDesc;
/** 品牌介绍 */
@Excel(name = "品牌介绍")
private String content;
/** 品牌logo */
@Excel(name = "品牌logo")
private String logo;
/** 品牌状态 */
@Excel(name = "品牌状态")
private String status;
/** 乐观锁 */
@Excel(name = "乐观锁")
private Long revision;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setProductDesc(String productDesc)
{
this.productDesc = productDesc;
}
public String getProductDesc()
{
return productDesc;
}
public void setContent(String content)
{
this.content = content;
}
public String getContent()
{
return content;
}
public void setLogo(String logo)
{
this.logo = logo;
}
public String getLogo()
{
return logo;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setRevision(Long revision)
{
this.revision = revision;
}
public Long getRevision()
{
return revision;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("productDesc", getProductDesc())
.append("content", getContent())
.append("logo", getLogo())
.append("status", getStatus())
.append("revision", getRevision())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,168 @@
package com.nuyu.product.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.muyu.common.core.annotation.Excel;
import com.muyu.common.core.web.domain.BaseEntity;
/**
* mall_product_type_info
*
* @author muyu
* @date 2024-04-27
*/
public class MallProductTypeInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 分类id */
private Long catId;
/** 分类名称 */
@Excel(name = "分类名称")
private String name;
/** 父分类id */
@Excel(name = "父分类id")
private Long parentCid;
/** 层级 */
@Excel(name = "层级")
private Long catLevel;
/** 是否显示[0-不显示1显示] */
@Excel(name = "是否显示[0-不显示1显示]")
private Integer showStatus;
/** 排序 */
@Excel(name = "排序")
private Long sort;
/** 图标地址 */
@Excel(name = "图标地址")
private String icon;
/** 计量单位 */
@Excel(name = "计量单位")
private String productUnit;
/** 商品数量 */
@Excel(name = "商品数量")
private Long productCount;
/** 乐观锁 */
@Excel(name = "乐观锁")
private Long revision;
public void setCatId(Long catId)
{
this.catId = catId;
}
public Long getCatId()
{
return catId;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setParentCid(Long parentCid)
{
this.parentCid = parentCid;
}
public Long getParentCid()
{
return parentCid;
}
public void setCatLevel(Long catLevel)
{
this.catLevel = catLevel;
}
public Long getCatLevel()
{
return catLevel;
}
public void setShowStatus(Integer showStatus)
{
this.showStatus = showStatus;
}
public Integer getShowStatus()
{
return showStatus;
}
public void setSort(Long sort)
{
this.sort = sort;
}
public Long getSort()
{
return sort;
}
public void setIcon(String icon)
{
this.icon = icon;
}
public String getIcon()
{
return icon;
}
public void setProductUnit(String productUnit)
{
this.productUnit = productUnit;
}
public String getProductUnit()
{
return productUnit;
}
public void setProductCount(Long productCount)
{
this.productCount = productCount;
}
public Long getProductCount()
{
return productCount;
}
public void setRevision(Long revision)
{
this.revision = revision;
}
public Long getRevision()
{
return revision;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("catId", getCatId())
.append("name", getName())
.append("parentCid", getParentCid())
.append("catLevel", getCatLevel())
.append("showStatus", getShowStatus())
.append("sort", getSort())
.append("icon", getIcon())
.append("productUnit", getProductUnit())
.append("productCount", getProductCount())
.append("revision", getRevision())
.toString();
}
}

View File

@ -0,0 +1,26 @@
package com.nuyu.product.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author: wangxinyuan
* @Date: 2024/4/26 11:22
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Pur {
private Integer purId;
private String purName;
private String purSex;
private String purScore;
private String imagesUrl;
}

View File

@ -1,6 +1,8 @@
package com.nuyu.product.req;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author: wangxinyuan
@ -8,7 +10,18 @@ import lombok.Data;
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BookReq {
private Integer bookId;
private String name;
private String bookSex;
private String bookAge;
private Integer pageSize=3;
private Integer pageNum=1;

View File

@ -1,45 +0,0 @@
package com.muyu.product.controller;
import com.github.pagehelper.PageInfo;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.test.admin.Book;
import com.muyu.common.core.web.domain.AjaxResult;
import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.product.service.BookService;
import com.nuyu.product.req.BookReq;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import static com.muyu.common.core.web.domain.AjaxResult.success;
/**
* @Author: wangxinyuan
* @Date: 2024/4/23 7:33
*/
@RestController
@RequestMapping("/info")
public class BookController {
@Autowired
private BookService bookService;
@ApiOperation("查询信息")
@RequiresPermissions("product:info:list")
@GetMapping("/list")
public AjaxResult queryProduct(BookReq bookReq){
PageInfo<Book> pageInfo = bookService.queryProduct(bookReq);
return success(pageInfo);
}
}

View File

@ -0,0 +1,120 @@
package com.muyu.product.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.github.pagehelper.PageInfo;
import com.muyu.common.core.web.domain.AjaxResult;
import com.muyu.product.service.MallProductBrandInfoService;
import com.nuyu.product.domain.MallProductBrandInfo;
import com.nuyu.product.domain.MallProductTypeInfo;
import com.nuyu.product.req.BookReq;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.muyu.common.log.annotation.Log;
import com.muyu.common.log.enums.BusinessType;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author wangxinyuan
* @date 2024-04-27
*/
@RestController
@RequestMapping("/brand")
public class MallProductBrandInfoController extends BaseController
{
@Autowired
private MallProductBrandInfoService mallProductBrandInfoService;
/**
*
*/
@GetMapping("/test")
@RequiresPermissions("product:brand:test")
public Result<TableDataInfo<MallProductBrandInfo>> list(MallProductBrandInfo mallProductBrandInfo)
{
startPage();
List<MallProductBrandInfo> list = mallProductBrandInfoService.selectMallProductBrandInfoList(mallProductBrandInfo);
return getDataTable(list);
}
@ApiOperation("三级分类列表")
@GetMapping("/list")
@RequiresPermissions("product:brand:list")
public AjaxResult list(BookReq bookReq){
PageInfo<MallProductBrandInfo> info=mallProductBrandInfoService.list(bookReq);
return AjaxResult.success(info);
}
/**
*
*/
@RequiresPermissions("product:brand:export")
@Log(title = "商品品牌", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MallProductBrandInfo mallProductBrandInfo)
{
List<MallProductBrandInfo> list = mallProductBrandInfoService.selectMallProductBrandInfoList(mallProductBrandInfo);
ExcelUtil<MallProductBrandInfo> util = new ExcelUtil<MallProductBrandInfo>(MallProductBrandInfo.class);
util.exportExcel(response, list, "商品品牌数据");
}
/**
*
*/
@RequiresPermissions("product:brand:query")
@GetMapping(value = "/{id}")
public Result getInfo(@PathVariable("id") Long id)
{
return success(mallProductBrandInfoService.selectMallProductBrandInfoById(id));
}
/**
*
*/
@RequiresPermissions("product:brand:add")
@Log(title = "商品品牌", businessType = BusinessType.INSERT)
@PostMapping
public Result add(@RequestBody MallProductBrandInfo mallProductBrandInfo)
{
return toAjax(mallProductBrandInfoService.insertMallProductBrandInfo(mallProductBrandInfo));
}
/**
*
*/
@RequiresPermissions("product:brand:edit")
@Log(title = "商品品牌", businessType = BusinessType.UPDATE)
@PutMapping
public Result edit(@RequestBody MallProductBrandInfo mallProductBrandInfo)
{
return toAjax(mallProductBrandInfoService.updateMallProductBrandInfo(mallProductBrandInfo));
}
/**
*
*/
@RequiresPermissions("product:brand:remove")
@Log(title = "商品品牌", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public Result remove(@PathVariable Long[] ids)
{
return toAjax(mallProductBrandInfoService.deleteMallProductBrandInfoByIds(ids));
}
}

View File

@ -0,0 +1,124 @@
package com.muyu.product.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.github.pagehelper.PageInfo;
import com.muyu.common.core.web.domain.AjaxResult;
import com.muyu.product.service.MallProductTypeInfoService;
import com.nuyu.product.domain.MallProductTypeInfo;
import com.nuyu.product.dto.Pur;
import com.nuyu.product.req.BookReq;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.muyu.common.log.annotation.Log;
import com.muyu.common.log.enums.BusinessType;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author muyu
* @date 2024-04-27
*/
@RestController
@RequestMapping("/type")
public class MallProductTypeInfoController extends BaseController
{
@Autowired
private MallProductTypeInfoService mallProductTypeInfoService;
/**
*
*/
/**
*
*/
@GetMapping("/test")
@RequiresPermissions("product:type:test")
public Result<TableDataInfo<MallProductTypeInfo>> list(MallProductTypeInfo mallProductTypeInfo)
{
startPage();
List<MallProductTypeInfo> list = mallProductTypeInfoService.selectMallProductTypeInfoList(mallProductTypeInfo);
return getDataTable(list);
}
@ApiOperation("三级分类列表")
@GetMapping("/list")
@RequiresPermissions("product:type:list")
public AjaxResult list(BookReq bookReq){
PageInfo<MallProductTypeInfo> info=mallProductTypeInfoService.list(bookReq);
return AjaxResult.success(info);
}
/**
*
*/
@RequiresPermissions("product:type:export")
@Log(title = "商品三级分类", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MallProductTypeInfo mallProductTypeInfo)
{
List<MallProductTypeInfo> list = mallProductTypeInfoService.selectMallProductTypeInfoList(mallProductTypeInfo);
ExcelUtil<MallProductTypeInfo> util = new ExcelUtil<MallProductTypeInfo>(MallProductTypeInfo.class);
util.exportExcel(response, list, "商品三级分类数据");
}
/**
*
*/
@RequiresPermissions("product:type:query")
@GetMapping(value = "/{catId}")
public Result getInfo(@PathVariable("catId") Long catId)
{
return success(mallProductTypeInfoService.selectMallProductTypeInfoByCatId(catId));
}
/**
*
*/
@RequiresPermissions("product:type:add")
@Log(title = "商品三级分类", businessType = BusinessType.INSERT)
@PostMapping
public Result add(@RequestBody MallProductTypeInfo mallProductTypeInfo)
{
return toAjax(mallProductTypeInfoService.insertMallProductTypeInfo(mallProductTypeInfo));
}
/**
*
*/
@RequiresPermissions("product:type:edit")
@Log(title = "商品三级分类", businessType = BusinessType.UPDATE)
@PutMapping
public Result edit(@RequestBody MallProductTypeInfo mallProductTypeInfo)
{
return toAjax(mallProductTypeInfoService.updateMallProductTypeInfo(mallProductTypeInfo));
}
/**
*
*/
@RequiresPermissions("product:type:remove")
@Log(title = "商品三级分类", businessType = BusinessType.DELETE)
@DeleteMapping("/{catIds}")
public Result remove(@PathVariable Long[] catIds)
{
return toAjax(mallProductTypeInfoService.deleteMallProductTypeInfoByCatIds(catIds));
}
}

View File

@ -0,0 +1,84 @@
package com.muyu.product.controller;
import com.github.pagehelper.PageInfo;
import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.core.web.domain.AjaxResult;
import com.muyu.common.log.enums.BusinessType;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.product.service.PurService;
import com.nuyu.product.dto.Pur;
import com.nuyu.product.req.BookReq;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.muyu.common.log.annotation.Log;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* @Author: wangxinyuan
* @Date: 2024/4/26 11:23
*/
@RestController
@RequestMapping("/info")
public class PurController {
@Autowired
private PurService purService;
@ApiOperation("测试")
@GetMapping("/list")
@RequiresPermissions("product:info:list")
public AjaxResult list(BookReq bookReq){
PageInfo<Pur>info=purService.list(bookReq);
return AjaxResult.success(info);
}
/**
*
*/
@RequiresPermissions("product:info:export")
@Log(title = "数据pur", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Pur pur)
{
List<Pur> list = purService.selectPur(pur);
ExcelUtil<Pur> util = new ExcelUtil<Pur>(Pur.class);
util.exportExcel(response, list, "pur数据");
}
/**
*
*/
@RequiresPermissions("product:info:add")
@Log(title = "测试", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Pur pur)
{
return AjaxResult.success(purService.insertPur(pur));
}
/**
*
*/
@RequiresPermissions("product:info:query")
@GetMapping(value = "/{purId}")
public AjaxResult getInfo(@PathVariable("purId") Long purId)
{
return AjaxResult.success(purService.selectPurByPurId(purId));
}
/**
*
*/
@RequiresPermissions("product:info:remove")
@Log(title = "1", businessType = BusinessType.DELETE)
@DeleteMapping("/{purIds}")
public AjaxResult remove(@PathVariable Long[] purIds)
{
return AjaxResult.success(purService.deletePurByPurIds(purIds));
}
}

View File

@ -1,19 +0,0 @@
package com.muyu.product.mapper;
import com.muyu.common.core.test.admin.Book;
import com.nuyu.product.req.BookReq;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @Author: wangxinyuan
* @Date: 2024/4/23 7:33
*/
@Mapper
public interface BookMapper {
List<Book> queryProduct(BookReq bookReq);
}

View File

@ -0,0 +1,68 @@
package com.muyu.product.mapper;
import com.nuyu.product.domain.MallProductBrandInfo;
import com.nuyu.product.req.BookReq;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* Mapper
* @author wangxinyuan
* @date 2024-04-27
*/
@Mapper
public interface MallProductBrandInfoMapper
{
/**
*
*
* @param id
* @return
*/
public MallProductBrandInfo selectMallProductBrandInfoById(Long id);
/**
*
*
* @param mallProductBrandInfo
* @return
*/
public List<MallProductBrandInfo> selectMallProductBrandInfoList(MallProductBrandInfo mallProductBrandInfo);
/**
*
*
* @param mallProductBrandInfo
* @return
*/
public int insertMallProductBrandInfo(MallProductBrandInfo mallProductBrandInfo);
/**
*
*
* @param mallProductBrandInfo
* @return
*/
public int updateMallProductBrandInfo(MallProductBrandInfo mallProductBrandInfo);
/**
*
*
* @param id
* @return
*/
public int deleteMallProductBrandInfoById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteMallProductBrandInfoByIds(Long[] ids);
List<MallProductBrandInfo> list(BookReq bookReq);
}

View File

@ -0,0 +1,68 @@
package com.muyu.product.mapper;
import com.nuyu.product.domain.MallProductTypeInfo;
import com.nuyu.product.req.BookReq;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* Mapper
*
* @author muyu
* @date 2024-04-27
*/
@Mapper
public interface MallProductTypeInfoMapper
{
/**
*
*
* @param catId
* @return
*/
public MallProductTypeInfo selectMallProductTypeInfoByCatId(Long catId);
/**
*
*
* @param mallProductTypeInfo
* @return
*/
public List<MallProductTypeInfo> selectMallProductTypeInfoList(MallProductTypeInfo mallProductTypeInfo);
/**
*
*
* @param mallProductTypeInfo
* @return
*/
public int insertMallProductTypeInfo(MallProductTypeInfo mallProductTypeInfo);
/**
*
*
* @param mallProductTypeInfo
* @return
*/
public int updateMallProductTypeInfo(MallProductTypeInfo mallProductTypeInfo);
/**
*
*
* @param catId
* @return
*/
public int deleteMallProductTypeInfoByCatId(Long catId);
/**
*
*
* @param catIds
* @return
*/
public int deleteMallProductTypeInfoByCatIds(Long[] catIds);
List<MallProductTypeInfo> list(BookReq bookReq);
}

View File

@ -0,0 +1,24 @@
package com.muyu.product.mapper;
import com.nuyu.product.dto.Pur;
import com.nuyu.product.req.BookReq;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @Author: wangxinyuan
* @Date: 2024/4/26 11:23
*/
@Mapper
public interface PurMapper {
List<Pur> list(BookReq bookReq);
String selectPurByPurId(Long purId);
String deletePurByPurIds(Long[] purIds);
List<Pur> selectPur(Pur pur);
String insertPur(Pur pur);
}

View File

@ -1,15 +0,0 @@
package com.muyu.product.service;
import com.github.pagehelper.PageInfo;
import com.muyu.common.core.test.admin.Book;
import com.nuyu.product.req.BookReq;
/**
* @Author: wangxinyuan
* @Date: 2024/4/23 7:33
*/
public interface BookService {
PageInfo<Book> queryProduct(BookReq bookReq);
}

View File

@ -1,32 +0,0 @@
package com.muyu.product.service.Impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.muyu.common.core.test.admin.Book;
import com.muyu.product.mapper.BookMapper;
import com.muyu.product.service.BookService;
import com.nuyu.product.req.BookReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Author: wangxinyuan
* @Date: 2024/4/23 7:33
*/
@Service
public class BookServiceImpl implements BookService {
@Autowired
private BookMapper bookMapper;
@Override
public PageInfo<Book> queryProduct(BookReq bookReq) {
PageHelper.startPage(bookReq.getPageNum(),bookReq.getPageSize());
List<Book> products = bookMapper.queryProduct(bookReq);
PageInfo<Book> pageInfo = new PageInfo<>(products);
return pageInfo;
}
}

View File

@ -0,0 +1,109 @@
package com.muyu.product.service.Impl;
import java.util.List;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.muyu.common.core.utils.DateUtils;
import com.muyu.product.mapper.MallProductBrandInfoMapper;
import com.muyu.product.service.MallProductBrandInfoService;
import com.nuyu.product.domain.MallProductBrandInfo;
import com.nuyu.product.domain.MallProductTypeInfo;
import com.nuyu.product.req.BookReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Service
*
* @author wangxinyuan
* @date 2024-04-27
*/
@Service
public class MallProductBrandInfoServiceImpl implements MallProductBrandInfoService
{
@Autowired
private MallProductBrandInfoMapper mallProductBrandInfoMapper;
/**
*
*
* @param id
* @return
*/
@Override
public MallProductBrandInfo selectMallProductBrandInfoById(Long id)
{
return mallProductBrandInfoMapper.selectMallProductBrandInfoById(id);
}
/**
*
*
* @param mallProductBrandInfo
* @return
*/
@Override
public List<MallProductBrandInfo> selectMallProductBrandInfoList(MallProductBrandInfo mallProductBrandInfo)
{
return mallProductBrandInfoMapper.selectMallProductBrandInfoList(mallProductBrandInfo);
}
/**
*
*
* @param mallProductBrandInfo
* @return
*/
@Override
public int insertMallProductBrandInfo(MallProductBrandInfo mallProductBrandInfo)
{
mallProductBrandInfo.setCreateTime(DateUtils.getNowDate());
return mallProductBrandInfoMapper.insertMallProductBrandInfo(mallProductBrandInfo);
}
/**
*
*
* @param mallProductBrandInfo
* @return
*/
@Override
public int updateMallProductBrandInfo(MallProductBrandInfo mallProductBrandInfo)
{
mallProductBrandInfo.setUpdateTime(DateUtils.getNowDate());
return mallProductBrandInfoMapper.updateMallProductBrandInfo(mallProductBrandInfo);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteMallProductBrandInfoByIds(Long[] ids)
{
return mallProductBrandInfoMapper.deleteMallProductBrandInfoByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteMallProductBrandInfoById(Long id)
{
return mallProductBrandInfoMapper.deleteMallProductBrandInfoById(id);
}
@Override
public PageInfo<MallProductBrandInfo> list(BookReq bookReq) {
PageHelper.startPage(bookReq.getPageNum(),bookReq.getPageSize());
List<MallProductBrandInfo> products = mallProductBrandInfoMapper.list(bookReq);
PageInfo<MallProductBrandInfo> pageInfo = new PageInfo<>(products);
return pageInfo;
}
}

View File

@ -0,0 +1,110 @@
package com.muyu.product.service.Impl;
import java.util.List;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.muyu.product.service.MallProductTypeInfoService;
import com.nuyu.product.domain.MallProductTypeInfo;
import com.nuyu.product.dto.Pur;
import com.nuyu.product.req.BookReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.muyu.product.mapper.MallProductTypeInfoMapper;
/**
* Service
*
* @author muyu
* @date 2024-04-27
*/
@Service
public class MallProductTypeInfoServiceImpl implements MallProductTypeInfoService
{
@Autowired
private MallProductTypeInfoMapper mallProductTypeInfoMapper;
/**
*
*
* @param catId
* @return
*/
@Override
public MallProductTypeInfo selectMallProductTypeInfoByCatId(Long catId)
{
return mallProductTypeInfoMapper.selectMallProductTypeInfoByCatId(catId);
}
/**
*
*
* @param mallProductTypeInfo
* @return
*/
@Override
public List<MallProductTypeInfo> selectMallProductTypeInfoList(MallProductTypeInfo mallProductTypeInfo)
{
return (List<MallProductTypeInfo>) mallProductTypeInfoMapper.selectMallProductTypeInfoList(mallProductTypeInfo);
}
/**
*
*
* @param mallProductTypeInfo
* @return
*/
@Override
public int insertMallProductTypeInfo(MallProductTypeInfo mallProductTypeInfo)
{
return mallProductTypeInfoMapper.insertMallProductTypeInfo(mallProductTypeInfo);
}
/**
*
*
* @param mallProductTypeInfo
* @return
*/
@Override
public int updateMallProductTypeInfo(MallProductTypeInfo mallProductTypeInfo)
{
return mallProductTypeInfoMapper.updateMallProductTypeInfo(mallProductTypeInfo);
}
/**
*
*
* @param catIds
* @return
*/
@Override
public int deleteMallProductTypeInfoByCatIds(Long[] catIds)
{
return mallProductTypeInfoMapper.deleteMallProductTypeInfoByCatIds(catIds);
}
/**
*
*
* @param catId
* @return
*/
@Override
public int deleteMallProductTypeInfoByCatId(Long catId)
{
return mallProductTypeInfoMapper.deleteMallProductTypeInfoByCatId(catId);
}
@Override
public PageInfo<MallProductTypeInfo> list(BookReq bookReq) {
PageHelper.startPage(bookReq.getPageNum(),bookReq.getPageSize());
List<MallProductTypeInfo> products = mallProductTypeInfoMapper.list(bookReq);
PageInfo<MallProductTypeInfo> pageInfo = new PageInfo<>(products);
return pageInfo;
}
}

View File

@ -0,0 +1,65 @@
package com.muyu.product.service.Impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.muyu.common.core.test.admin.Book;
import com.muyu.product.mapper.PurMapper;
import com.muyu.product.service.PurService;
import com.nuyu.product.dto.Pur;
import com.nuyu.product.req.BookReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Author: wangxinyuan
* @Date: 2024/4/26 11:23
*/
@Service
public class PurServiceImpl implements PurService {
@Autowired
private PurMapper purMapper;
@Override
public PageInfo<Pur> list(BookReq bookReq) {
PageHelper.startPage(bookReq.getPageNum(),bookReq.getPageSize());
List<Pur> products = purMapper.list(bookReq);
PageInfo<Pur> pageInfo = new PageInfo<>(products);
return pageInfo;
}
/**
*
*
* @param purId
* @return
*/
// @Override
// public Pur selectPurByPurId(Long purId)
// {
// return purMapper.selectPurByPurId(purId);
// }
@Override
public String selectPurByPurId(Long purId) {
return purMapper.selectPurByPurId(purId);
}
@Override
public String deletePurByPurIds(Long[] purIds) {
return purMapper.deletePurByPurIds(purIds);
}
@Override
public List<Pur> selectPur(Pur pur) {
return purMapper.selectPur(pur);
}
@Override
public String insertPur(Pur pur) {
return purMapper.insertPur(pur);
}
}

View File

@ -0,0 +1,68 @@
package com.muyu.product.service;
import com.github.pagehelper.PageInfo;
import com.nuyu.product.domain.MallProductBrandInfo;
import com.nuyu.product.req.BookReq;
import java.util.List;
/**
* Service
*
* @author wangxinyuan
* @date 2024-04-27
*/
public interface MallProductBrandInfoService
{
/**
*
*
* @param id
* @return
*/
public MallProductBrandInfo selectMallProductBrandInfoById(Long id);
/**
*
*
* @param mallProductBrandInfo
* @return
*/
public List<MallProductBrandInfo> selectMallProductBrandInfoList(MallProductBrandInfo mallProductBrandInfo);
/**
*
*
* @param mallProductBrandInfo
* @return
*/
public int insertMallProductBrandInfo(MallProductBrandInfo mallProductBrandInfo);
/**
*
*
* @param mallProductBrandInfo
* @return
*/
public int updateMallProductBrandInfo(MallProductBrandInfo mallProductBrandInfo);
/**
*
*
* @param ids
* @return
*/
public int deleteMallProductBrandInfoByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteMallProductBrandInfoById(Long id);
//列表
PageInfo<MallProductBrandInfo> list(BookReq bookReq);
}

View File

@ -0,0 +1,67 @@
package com.muyu.product.service;
import com.github.pagehelper.PageInfo;
import com.nuyu.product.domain.MallProductTypeInfo;
import com.nuyu.product.req.BookReq;
import java.util.List;
/**
* Service
*
* @author muyu
* @date 2024-04-27
*/
public interface MallProductTypeInfoService
{
/**
*
*
* @param catId
* @return
*/
public MallProductTypeInfo selectMallProductTypeInfoByCatId(Long catId);
/**
*
*
* @param mallProductTypeInfo
* @return
*/
public List<MallProductTypeInfo> selectMallProductTypeInfoList(MallProductTypeInfo mallProductTypeInfo);
/**
*
*
* @param mallProductTypeInfo
* @return
*/
public int insertMallProductTypeInfo(MallProductTypeInfo mallProductTypeInfo);
/**
*
*
* @param mallProductTypeInfo
* @return
*/
public int updateMallProductTypeInfo(MallProductTypeInfo mallProductTypeInfo);
/**
*
*
* @param catIds
* @return
*/
public int deleteMallProductTypeInfoByCatIds(Long[] catIds);
/**
*
*
* @param catId
* @return
*/
public int deleteMallProductTypeInfoByCatId(Long catId);
PageInfo<MallProductTypeInfo> list(BookReq bookReq);
}

View File

@ -0,0 +1,24 @@
package com.muyu.product.service;
import com.github.pagehelper.PageInfo;
import com.nuyu.product.dto.Pur;
import com.nuyu.product.req.BookReq;
import java.util.List;
/**
* @Author: wangxinyuan
* @Date: 2024/4/26 11:23
*/
public interface PurService {
PageInfo<Pur> list(BookReq bookReq);
String selectPurByPurId(Long purId);
String deletePurByPurIds(Long[] purIds);
List<Pur> selectPur(Pur pur);
String insertPur(Pur pur);
}

View File

@ -0,0 +1,99 @@
<?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.muyu.product.mapper.MallProductBrandInfoMapper">
<resultMap type="com.nuyu.product.domain.MallProductBrandInfo" id="MallProductBrandInfoResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="productDesc" column="product_desc" />
<result property="content" column="content" />
<result property="logo" column="logo" />
<result property="status" column="status" />
<result property="revision" column="revision" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectMallProductBrandInfoVo">
select id, name, product_desc, content, logo, status, revision, create_by, create_time, update_by, update_time from mall_product_brand_info
</sql>
<select id="selectMallProductBrandInfoList" parameterType="com.nuyu.product.domain.MallProductBrandInfo" resultMap="MallProductBrandInfoResult">
<include refid="selectMallProductBrandInfoVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
</where>
</select>
<select id="selectMallProductBrandInfoById" parameterType="Long" resultMap="MallProductBrandInfoResult">
<include refid="selectMallProductBrandInfoVo"/>
where id = #{id}
</select>
<select id="list" resultType="com.nuyu.product.domain.MallProductBrandInfo">
<include refid="selectMallProductBrandInfoVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
</where>
</select>
<insert id="insertMallProductBrandInfo" parameterType="com.nuyu.product.domain.MallProductBrandInfo" useGeneratedKeys="true" keyProperty="id">
insert into mall_product_brand_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="productDesc != null">product_desc,</if>
<if test="content != null">content,</if>
<if test="logo != null">logo,</if>
<if test="status != null">status,</if>
<if test="revision != null">revision,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="productDesc != null">#{productDesc},</if>
<if test="content != null">#{content},</if>
<if test="logo != null">#{logo},</if>
<if test="status != null">#{status},</if>
<if test="revision != null">#{revision},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateMallProductBrandInfo" parameterType="com.nuyu.product.domain.MallProductBrandInfo">
update mall_product_brand_info
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="productDesc != null">product_desc = #{productDesc},</if>
<if test="content != null">content = #{content},</if>
<if test="logo != null">logo = #{logo},</if>
<if test="status != null">status = #{status},</if>
<if test="revision != null">revision = #{revision},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMallProductBrandInfoById" parameterType="Long">
delete from mall_product_brand_info where id = #{id}
</delete>
<delete id="deleteMallProductBrandInfoByIds" parameterType="String">
delete from mall_product_brand_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,93 @@
<?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.muyu.product.mapper.MallProductTypeInfoMapper">
<resultMap type="com.nuyu.product.domain.MallProductTypeInfo" id="MallProductTypeInfoResult">
<result property="catId" column="cat_id" />
<result property="name" column="name" />
<result property="parentCid" column="parent_cid" />
<result property="catLevel" column="cat_level" />
<result property="showStatus" column="show_status" />
<result property="sort" column="sort" />
<result property="icon" column="icon" />
<result property="productUnit" column="product_unit" />
<result property="productCount" column="product_count" />
<result property="revision" column="revision" />
</resultMap>
<sql id="selectMallProductTypeInfoVo">
select cat_id, name, parent_cid, cat_level, show_status, sort, icon, product_unit, product_count, revision from mall_product_type_info
</sql>
<select id="selectMallProductTypeInfoList" parameterType="com.nuyu.product.domain.MallProductTypeInfo" resultMap="MallProductTypeInfoResult">
<include refid="selectMallProductTypeInfoVo"/>
<where>
</where>
</select>
<select id="selectMallProductTypeInfoByCatId" parameterType="Long" resultMap="MallProductTypeInfoResult">
<include refid="selectMallProductTypeInfoVo"/>
where cat_id = #{catId}
</select>
<select id="list" resultType="com.nuyu.product.domain.MallProductTypeInfo">
<include refid="selectMallProductTypeInfoVo"/>
<where>
</where>
</select>
<insert id="insertMallProductTypeInfo" parameterType="com.nuyu.product.domain.MallProductTypeInfo" useGeneratedKeys="true" keyProperty="catId">
insert into mall_product_type_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="parentCid != null">parent_cid,</if>
<if test="catLevel != null">cat_level,</if>
<if test="showStatus != null">show_status,</if>
<if test="sort != null">sort,</if>
<if test="icon != null">icon,</if>
<if test="productUnit != null">product_unit,</if>
<if test="productCount != null">product_count,</if>
<if test="revision != null">revision,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="parentCid != null">#{parentCid},</if>
<if test="catLevel != null">#{catLevel},</if>
<if test="showStatus != null">#{showStatus},</if>
<if test="sort != null">#{sort},</if>
<if test="icon != null">#{icon},</if>
<if test="productUnit != null">#{productUnit},</if>
<if test="productCount != null">#{productCount},</if>
<if test="revision != null">#{revision},</if>
</trim>
</insert>
<update id="updateMallProductTypeInfo" parameterType="com.nuyu.product.domain.MallProductTypeInfo">
update mall_product_type_info
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="parentCid != null">parent_cid = #{parentCid},</if>
<if test="catLevel != null">cat_level = #{catLevel},</if>
<if test="showStatus != null">show_status = #{showStatus},</if>
<if test="sort != null">sort = #{sort},</if>
<if test="icon != null">icon = #{icon},</if>
<if test="productUnit != null">product_unit = #{productUnit},</if>
<if test="productCount != null">product_count = #{productCount},</if>
<if test="revision != null">revision = #{revision},</if>
</trim>
where cat_id = #{catId}
</update>
<delete id="deleteMallProductTypeInfoByCatId" parameterType="Long">
delete from mall_product_type_info where cat_id = #{catId}
</delete>
<delete id="deleteMallProductTypeInfoByCatIds" parameterType="String">
delete from mall_product_type_info where cat_id in
<foreach item="catId" collection="array" open="(" separator="," close=")">
#{catId}
</foreach>
</delete>
</mapper>

View File

@ -1,11 +0,0 @@
<?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.muyu.product.mapper.BookMapper">
<select id="queryProduct" resultType="com.muyu.common.core.test.admin.Book">
select * from book
</select>
</mapper>

View File

@ -0,0 +1,26 @@
<?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.muyu.product.mapper.PurMapper">
<insert id="insertPur">
INSERT INTO `product`.`pur` (`images_url`, `pur_name`, `pur_sex`, `pur_score`) VALUES (#{imagesUrl}, #{purName}, #{purSex}, #{purScore});
</insert>
<delete id="deletePurByPurIds">
delete from pur where pur_id = #{purId}
</delete>
<select id="list" resultType="com.nuyu.product.dto.Pur">
select * from pur
</select>
<select id="selectPurByPurId" resultType="java.lang.String">
select * from pur where pur_id = 1
</select>
<select id="selectPur" resultType="com.nuyu.product.dto.Pur">
select * from pur
</select>
</mapper>

21
pom.xml
View File

@ -11,7 +11,7 @@
<name>muyu</name>
<description>微服务系统</description>
<url>http://www.muyu.vip</url>
<properties>
<muyu.version>3.6.3</muyu.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@ -150,6 +150,25 @@
<version>${muyu.version}</version>
</dependency>
<!-- 核心模块 -->
<dependency>
<groupId>com.muyu</groupId>
<artifactId>muyu-file-common</artifactId>
<version>${muyu.version}</version>
</dependency>
<dependency>
<groupId>com.muyu</groupId>
<artifactId>muyu-file-remote</artifactId>
<version>${muyu.version}</version>
</dependency>
<dependency>
<groupId>com.muyu</groupId>
<artifactId>muyu-file-server</artifactId>
<version>${muyu.version}</version>
</dependency>
<!-- 接口模块 -->
<dependency>
<groupId>com.muyu</groupId>