dev798
parent
8db83ee2fb
commit
03920a8058
|
@ -42,7 +42,7 @@ public class MallProductInfoController extends BaseController
|
|||
/**
|
||||
* 查询商品信息列表
|
||||
*/
|
||||
@RequiresPermissions("product:attrInfo:list")
|
||||
@RequiresPermissions("product:info:list")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(MallProductInfo mallProductRuleAttrInfo){
|
||||
PageInfo<MallProductInfo> info=mallProductInfoService.list(mallProductRuleAttrInfo);
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
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("/test")
|
||||
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));
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.nuyu.product.domain.MallProductInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -11,6 +12,7 @@ import java.util.List;
|
|||
* @author muyu
|
||||
* @date 2024-05-06
|
||||
*/
|
||||
@Mapper
|
||||
public interface MallProductInfoMapper
|
||||
{
|
||||
/**
|
||||
|
@ -61,5 +63,5 @@ public interface MallProductInfoMapper
|
|||
*/
|
||||
public int deleteMallProductInfoByIds(Long[] ids);
|
||||
|
||||
List<MallProductInfo> list(MallProductInfo mallProductRuleAttrInfo);
|
||||
List<MallProductInfo> list(MallProductInfo mallProductInfo);
|
||||
}
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
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);
|
||||
}
|
|
@ -101,9 +101,9 @@ public class MallProductInfoServiceImpl implements MallProductInfoService
|
|||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<MallProductInfo> list(MallProductInfo mallProductRuleAttrInfo) {
|
||||
PageHelper.startPage(mallProductRuleAttrInfo.getPageNum(),mallProductRuleAttrInfo.getPageSize());
|
||||
List<MallProductInfo> products = mallProductInfoMapper.list(mallProductRuleAttrInfo);
|
||||
public PageInfo<MallProductInfo> list(MallProductInfo mallProductInfo) {
|
||||
PageHelper.startPage(mallProductInfo.getPageNum(),mallProductInfo.getPageSize());
|
||||
List<MallProductInfo> products = mallProductInfoMapper.list(mallProductInfo);
|
||||
PageInfo<MallProductInfo> pageInfo = new PageInfo<>(products);
|
||||
return pageInfo;
|
||||
}
|
||||
|
|
|
@ -1,65 +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.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);
|
||||
}
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
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);
|
||||
}
|
|
@ -44,6 +44,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.nuyu.product.domain.MallProductInfo">
|
||||
<include refid="selectMallProductInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertMallProductInfo" parameterType="com.nuyu.product.domain.MallProductInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into mall_product_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
|
@ -1,26 +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.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>
|
Loading…
Reference in New Issue