master
parent
95f140bff0
commit
add4f9d5e6
|
@ -147,12 +147,25 @@ create table tb_import(
|
|||
list_id int(11) comment '表单编号' primary key auto_increment,
|
||||
merch_id int(11) comment '商品编号',
|
||||
merch_name varchar(20) comment '商品名称',
|
||||
merch_type varchar(10) comment '商品类型',
|
||||
type_ids varchar(10) comment '商品类型',
|
||||
merch_price decimal(4,2) comment '价格',
|
||||
plan_num int(4) comment '计划进货数',
|
||||
import_date date comment '进货日期',
|
||||
provide_id varchar(10) comment '供货商编号'
|
||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='进货表';
|
||||
insert into tb_import (merch_id, merch_name, type_ids, merch_price, plan_num, import_date, provide_id) values ('1','青芒',1,20,400,'2023-11-20 9:00',1);
|
||||
select list_id,merch_id, merch_name, type_ids, merch_price, plan_num, import_date, provide_id from tb_import;
|
||||
|
||||
-- 供货商表
|
||||
drop table if exists tb_provide;
|
||||
create table tb_provide(
|
||||
provide_id int(11) comment '供货商编号' primary key auto_increment,
|
||||
provide_name varchar(55) comment '供货商名称'
|
||||
)ENGINE=InnoDB DEFAULT CHARSET = utf8 COLLATE=utf8_general_ci COMMENT='供货商表';
|
||||
insert into tb_provide (provide_name) values ('供货商1');
|
||||
insert into tb_provide (provide_name) values ('供货商2');
|
||||
insert into tb_provide (provide_name) values ('供货商3');
|
||||
select provide_id, provide_name from tb_provide;
|
||||
|
||||
-- 销售表
|
||||
drop table if exists tb_sale_list;
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
package com.bwie.common.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.common.domain
|
||||
* @Description TODO 进货
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/24
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class Import {
|
||||
/**
|
||||
* 表单编号
|
||||
*/
|
||||
private Integer listId;
|
||||
/**
|
||||
* 商品编号
|
||||
*/
|
||||
private Integer merchId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String merchName;
|
||||
/**
|
||||
*商品类型
|
||||
*/
|
||||
private String typeIds;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private BigDecimal merchPrice;
|
||||
/**
|
||||
* 计划进货数
|
||||
*/
|
||||
private Integer planNum;
|
||||
/**
|
||||
* 进货日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date importDate;
|
||||
/**
|
||||
* 供货商编号
|
||||
*/
|
||||
private String provideId;
|
||||
}
|
|
@ -2,11 +2,14 @@ package com.bwie.common.domain;
|
|||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
|
@ -17,6 +20,8 @@ import java.util.Date;
|
|||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@Getter
|
||||
@Setter
|
||||
public class Merch implements Serializable {
|
||||
/**
|
||||
* 商品编号
|
||||
|
@ -29,7 +34,7 @@ public class Merch implements Serializable {
|
|||
/**
|
||||
* 商品类型
|
||||
*/
|
||||
private Integer merchType;
|
||||
private String typeIds;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
package com.bwie.common.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.common.domain
|
||||
* @Description TODO 退货
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/24
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class Returns {
|
||||
/**
|
||||
* 表单编号
|
||||
*/
|
||||
private Integer listId;
|
||||
/**
|
||||
* 商品编号
|
||||
*/
|
||||
private Integer merchId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String merchName;
|
||||
/**
|
||||
*商品类型
|
||||
*/
|
||||
private String typeIds;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private BigDecimal merchPrice;
|
||||
/**
|
||||
* 计划退货数
|
||||
*/
|
||||
private Integer planNum;
|
||||
/**
|
||||
* 进货日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date returnsDate;
|
||||
/**
|
||||
* 供货商编号
|
||||
*/
|
||||
private String provideId;
|
||||
}
|
|
@ -1,7 +1,12 @@
|
|||
package com.bwie.common.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAlias;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.common.domain
|
||||
|
@ -11,17 +16,24 @@ import lombok.Data;
|
|||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class Type {
|
||||
public class Type implements Serializable {
|
||||
/**
|
||||
* 类型Id
|
||||
*/
|
||||
@JsonAlias(value = "id")
|
||||
private Integer typeId;
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
@JsonAlias(value = "label")
|
||||
private String typeName;
|
||||
/**
|
||||
* 父级Id
|
||||
*/
|
||||
private Integer categoryId;
|
||||
|
||||
/**
|
||||
* 子级集合
|
||||
*/
|
||||
private List<Type> children;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
package com.bwie.common.domain.request;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.common.domain
|
||||
* @Description TODO
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/20
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class CustomerRequest {
|
||||
/**
|
||||
* 客户编号
|
||||
*/
|
||||
private Integer customerId;
|
||||
/**
|
||||
* 客户姓名
|
||||
*/
|
||||
private String customerName;
|
||||
/**
|
||||
* 会员等级
|
||||
*/
|
||||
private Integer vipGrade;
|
||||
|
||||
private Integer pageNum = 1;
|
||||
private Integer pageSize = 5;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.bwie.common.domain.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.common.domain.request
|
||||
* @Description TODO
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/24
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ImportRequest {
|
||||
private Integer pageNum = 1;
|
||||
private Integer pageSize = 5;
|
||||
}
|
|
@ -1,6 +1,10 @@
|
|||
package com.bwie.common.domain.request;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
|
@ -11,6 +15,8 @@ import lombok.Data;
|
|||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@Getter
|
||||
@Setter
|
||||
public class MerchRequest {
|
||||
|
||||
/**
|
||||
|
@ -24,7 +30,16 @@ public class MerchRequest {
|
|||
/**
|
||||
* 商品类型
|
||||
*/
|
||||
private Integer merchType;
|
||||
private String typeIds;
|
||||
|
||||
/**
|
||||
* 库存初始数量
|
||||
*/
|
||||
private Integer startNum;
|
||||
/**
|
||||
* 库存最大数量
|
||||
*/
|
||||
private Integer endNum;
|
||||
|
||||
private Integer pageNum = 1;
|
||||
private Integer pageSize = 5;
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
package com.bwie.common.domain.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.common.domain.request
|
||||
* @Description TODO
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/24
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ReturnsRequest {
|
||||
private Integer pageNum = 1;
|
||||
private Integer pageSize = 5;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.bwie.common.domain.response;
|
||||
|
||||
import com.bwie.common.domain.Customer;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.common.domain.response
|
||||
* @Description TODO
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/20
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class CustomerResponse extends Customer {
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.bwie.common.domain.response;
|
||||
|
||||
import com.bwie.common.domain.Import;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.common.domain.response
|
||||
* @Description TODO
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/24
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ImportResponse extends Import {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.bwie.common.domain.response;
|
||||
|
||||
import com.bwie.common.domain.Returns;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.common.domain.response
|
||||
* @Description TODO
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/26
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ReturnsResponse extends Returns {
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package com.bwie.manage.controller;
|
||||
|
||||
import com.bwie.common.domain.Customer;
|
||||
import com.bwie.common.domain.request.CustomerRequest;
|
||||
import com.bwie.common.domain.response.CustomerResponse;
|
||||
import com.bwie.common.result.PageResult;
|
||||
import com.bwie.common.result.Result;
|
||||
import com.bwie.manage.service.CustomerService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.manage.controller
|
||||
* @Description TODO
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/20
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/customer")
|
||||
public class CustomerController {
|
||||
|
||||
@Autowired
|
||||
private CustomerService customerService;
|
||||
|
||||
@PostMapping("/listCustomer")
|
||||
public Result<PageResult<CustomerResponse>> listCustomer(@RequestBody CustomerRequest customerRequest){
|
||||
return customerService.listCustomer(customerRequest);
|
||||
}
|
||||
|
||||
@PostMapping("/listVip")
|
||||
public Result<PageResult<CustomerResponse>> listVip(@RequestBody CustomerRequest customerRequest){
|
||||
return customerService.listVip(customerRequest);
|
||||
}
|
||||
|
||||
@PostMapping("/addClient")
|
||||
public Result add(@RequestBody Customer customer){
|
||||
customerService.add(customer);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@GetMapping("/findByClientId/{customerId}")
|
||||
public Result findById(@PathVariable("customerId") Integer customerId){
|
||||
CustomerResponse customer = customerService.findById(customerId);
|
||||
return Result.success(customer);
|
||||
}
|
||||
|
||||
@PutMapping("/updateClient")
|
||||
public Result update(@RequestBody Customer customer){
|
||||
customerService.update(customer);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@DeleteMapping("/delClient/{customerId}")
|
||||
public Result del(@PathVariable("customerId") Integer customerId){
|
||||
customerService.del(customerId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@DeleteMapping("/batchDelClient/{customerIds}")
|
||||
public Result batchDel(@PathVariable("customerIds") Integer[] customerIds){
|
||||
customerService.batchDel(customerIds);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.bwie.manage.controller;
|
||||
|
||||
import com.bwie.common.domain.Import;
|
||||
import com.bwie.common.domain.request.ImportRequest;
|
||||
import com.bwie.common.domain.response.ImportResponse;
|
||||
import com.bwie.common.result.PageResult;
|
||||
import com.bwie.common.result.Result;
|
||||
import com.bwie.manage.service.ImportService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.manage.controller
|
||||
* @Description TODO
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/24
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/import")
|
||||
public class ImportController {
|
||||
|
||||
@Autowired
|
||||
private ImportService importService;
|
||||
|
||||
@PostMapping("/listImport")
|
||||
public Result<PageResult<ImportResponse>> list(@RequestBody ImportRequest importRequest){
|
||||
return importService.list(importRequest);
|
||||
}
|
||||
|
||||
@PostMapping("/addImport")
|
||||
public Result add(@RequestBody Import imports){
|
||||
importService.add(imports);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
|
@ -62,4 +62,6 @@ public class ManageController {
|
|||
managerService.batchDel(empIds);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
// @PostMapping("/")
|
||||
}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package com.bwie.manage.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.bwie.common.domain.Merch;
|
||||
import com.bwie.common.domain.Type;
|
||||
import com.bwie.common.domain.request.MerchRequest;
|
||||
import com.bwie.common.domain.response.MerchResponse;
|
||||
import com.bwie.common.result.PageResult;
|
||||
|
@ -9,6 +12,8 @@ import com.bwie.manage.service.MerchService;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.manage.controller
|
||||
|
@ -58,4 +63,10 @@ public class MerchController {
|
|||
merchService.batchDel(merchIds);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@GetMapping("/findTypes")
|
||||
public Result<List<Type>> findTypes(){
|
||||
List<Type> types = merchService.findTypes();
|
||||
return Result.success(types);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
package com.bwie.manage.controller;
|
||||
|
||||
import com.bwie.common.domain.Returns;
|
||||
import com.bwie.common.domain.request.ReturnsRequest;
|
||||
import com.bwie.common.domain.response.ReturnsResponse;
|
||||
import com.bwie.common.result.PageResult;
|
||||
import com.bwie.common.result.Result;
|
||||
import com.bwie.manage.service.ReturnsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.manage.controller
|
||||
* @Description TODO
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/24
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/returns")
|
||||
public class ReturnsController {
|
||||
|
||||
@Autowired
|
||||
private ReturnsService returnsService;
|
||||
|
||||
@PostMapping("/listReturns")
|
||||
public Result<PageResult<ReturnsResponse>> list(@RequestBody ReturnsRequest returnsRequest){
|
||||
return returnsService.list(returnsRequest);
|
||||
}
|
||||
|
||||
@PostMapping("/addReturns")
|
||||
public Result add(@RequestBody Returns returns){
|
||||
returnsService.add(returns);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package com.bwie.manage.mapper;
|
||||
|
||||
import com.bwie.common.domain.Customer;
|
||||
import com.bwie.common.domain.request.CustomerRequest;
|
||||
import com.bwie.common.domain.response.CustomerResponse;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.manage.mapper
|
||||
* @Description TODO
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/20
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface CustomerMapper {
|
||||
|
||||
/**
|
||||
* 客户列表
|
||||
* @param customerRequest
|
||||
* @return
|
||||
*/
|
||||
List<CustomerResponse> listClient(CustomerRequest customerRequest);
|
||||
|
||||
/**
|
||||
* 会员列表
|
||||
* @param customerRequest
|
||||
* @return
|
||||
*/
|
||||
List<CustomerResponse> listVip(CustomerRequest customerRequest);
|
||||
|
||||
/**
|
||||
* 新增客户信息
|
||||
* @param customer
|
||||
*/
|
||||
void add(Customer customer);
|
||||
|
||||
/**
|
||||
* 客户信息详情
|
||||
* @param customerId
|
||||
* @return
|
||||
*/
|
||||
CustomerResponse findById(@Param("customerId") Integer customerId);
|
||||
|
||||
/**
|
||||
* 编辑客户信息
|
||||
* @param customer
|
||||
*/
|
||||
void update(Customer customer);
|
||||
|
||||
/**
|
||||
* 删除客户信息
|
||||
* @param customerId
|
||||
*/
|
||||
void del(@Param("customerId") Integer customerId);
|
||||
|
||||
/**
|
||||
* 批量删除客户信息
|
||||
* @param customerIds
|
||||
*/
|
||||
void batchDel(@Param("customerIds") Integer[] customerIds);
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.bwie.manage.mapper;
|
||||
|
||||
import com.bwie.common.domain.Import;
|
||||
import com.bwie.common.domain.request.ImportRequest;
|
||||
import com.bwie.common.domain.response.ImportResponse;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.manage.mapper
|
||||
* @Description TODO
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/24
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface ImportMapper {
|
||||
/**
|
||||
* 进货记录
|
||||
* @param importRequest
|
||||
* @return
|
||||
*/
|
||||
List<ImportResponse> list(ImportRequest importRequest);
|
||||
|
||||
/**
|
||||
* 新增进货记录
|
||||
* @param imports
|
||||
*/
|
||||
void add(Import imports);
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package com.bwie.manage.mapper;
|
||||
|
||||
import com.bwie.common.domain.Merch;
|
||||
import com.bwie.common.domain.Type;
|
||||
import com.bwie.common.domain.request.MerchRequest;
|
||||
import com.bwie.common.domain.response.MerchResponse;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
@ -55,4 +56,10 @@ public interface MerchMapper {
|
|||
* @param merchIds
|
||||
*/
|
||||
void batchDel(@Param("merchIds") Integer[] merchIds);
|
||||
|
||||
/**
|
||||
* 商品分类下拉框
|
||||
* @return
|
||||
*/
|
||||
List<Type> findTypes();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
package com.bwie.manage.mapper;
|
||||
|
||||
import com.bwie.common.domain.Returns;
|
||||
import com.bwie.common.domain.request.ReturnsRequest;
|
||||
import com.bwie.common.domain.response.ReturnsResponse;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.manage.mapper
|
||||
* @Description TODO
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/26
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface ReturnsMapper {
|
||||
/**
|
||||
* 退货记录
|
||||
* @param returnsRequest
|
||||
* @return
|
||||
*/
|
||||
List<ReturnsResponse> list(ReturnsRequest returnsRequest);
|
||||
|
||||
/**
|
||||
* 添加退货记录
|
||||
* @param returns
|
||||
*/
|
||||
void add(Returns returns);
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.bwie.manage.service;
|
||||
|
||||
import com.bwie.common.domain.Customer;
|
||||
import com.bwie.common.domain.request.CustomerRequest;
|
||||
import com.bwie.common.domain.response.CustomerResponse;
|
||||
import com.bwie.common.result.PageResult;
|
||||
import com.bwie.common.result.Result;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.manage.service
|
||||
* @Description TODO
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/20
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface CustomerService {
|
||||
/**
|
||||
* 客户分页列表
|
||||
* @param customerRequest
|
||||
* @return
|
||||
*/
|
||||
Result<PageResult<CustomerResponse>> listCustomer(CustomerRequest customerRequest);
|
||||
|
||||
/**
|
||||
* 会员分页列表
|
||||
* @param customerRequest
|
||||
* @return
|
||||
*/
|
||||
Result<PageResult<CustomerResponse>> listVip(CustomerRequest customerRequest);
|
||||
|
||||
/**
|
||||
* 新增客户信息
|
||||
* @param customer
|
||||
*/
|
||||
void add(Customer customer);
|
||||
|
||||
/**
|
||||
* 客户详情
|
||||
* @param customerId
|
||||
* @return
|
||||
*/
|
||||
CustomerResponse findById(Integer customerId);
|
||||
|
||||
/**
|
||||
* 编辑客户信息
|
||||
* @param customer
|
||||
*/
|
||||
void update(Customer customer);
|
||||
|
||||
/**
|
||||
* 删除客户信息
|
||||
* @param customerId
|
||||
*/
|
||||
void del(Integer customerId);
|
||||
|
||||
/**
|
||||
* 批量删除客户信息
|
||||
* @param customerIds
|
||||
*/
|
||||
void batchDel(Integer[] customerIds);
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.bwie.manage.service;
|
||||
|
||||
import com.bwie.common.domain.Import;
|
||||
import com.bwie.common.domain.request.ImportRequest;
|
||||
import com.bwie.common.domain.response.ImportResponse;
|
||||
import com.bwie.common.result.PageResult;
|
||||
import com.bwie.common.result.Result;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.manage.service
|
||||
* @Description TODO
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/24
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface ImportService {
|
||||
/**
|
||||
* 进货记录分页列表
|
||||
* @param importRequest
|
||||
* @return
|
||||
*/
|
||||
Result<PageResult<ImportResponse>> list(ImportRequest importRequest);
|
||||
|
||||
/**
|
||||
* 添加进货记录
|
||||
* @param imports
|
||||
*/
|
||||
void add(Import imports);
|
||||
}
|
|
@ -1,11 +1,14 @@
|
|||
package com.bwie.manage.service;
|
||||
|
||||
import com.bwie.common.domain.Merch;
|
||||
import com.bwie.common.domain.Type;
|
||||
import com.bwie.common.domain.request.MerchRequest;
|
||||
import com.bwie.common.domain.response.MerchResponse;
|
||||
import com.bwie.common.result.PageResult;
|
||||
import com.bwie.common.result.Result;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.manage.service
|
||||
|
@ -52,4 +55,10 @@ public interface MerchService {
|
|||
* @param merchIds
|
||||
*/
|
||||
void batchDel(Integer[] merchIds);
|
||||
|
||||
/**
|
||||
* 商品分类下拉框
|
||||
* @return
|
||||
*/
|
||||
List<Type> findTypes();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
package com.bwie.manage.service;
|
||||
|
||||
import com.bwie.common.domain.Returns;
|
||||
import com.bwie.common.domain.request.ReturnsRequest;
|
||||
import com.bwie.common.domain.response.ReturnsResponse;
|
||||
import com.bwie.common.result.PageResult;
|
||||
import com.bwie.common.result.Result;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.manage.service
|
||||
* @Description TODO
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/26
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface ReturnsService {
|
||||
/**
|
||||
* 退货记录
|
||||
* @param returnsRequest
|
||||
* @return
|
||||
*/
|
||||
Result<PageResult<ReturnsResponse>> list(ReturnsRequest returnsRequest);
|
||||
|
||||
/**
|
||||
* 添加退货记录
|
||||
* @param returns
|
||||
*/
|
||||
void add(Returns returns);
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
package com.bwie.manage.service.impl;
|
||||
|
||||
import com.bwie.common.domain.Customer;
|
||||
import com.bwie.common.domain.request.CustomerRequest;
|
||||
import com.bwie.common.domain.response.CustomerResponse;
|
||||
import com.bwie.common.result.PageResult;
|
||||
import com.bwie.common.result.Result;
|
||||
import com.bwie.manage.mapper.CustomerMapper;
|
||||
import com.bwie.manage.service.CustomerService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.manage.service.impl
|
||||
* @Description TODO
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/20
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
public class CustomerServiceImpl implements CustomerService {
|
||||
|
||||
@Autowired
|
||||
private
|
||||
CustomerMapper customerMapper;
|
||||
|
||||
@Override
|
||||
public Result<PageResult<CustomerResponse>> listCustomer(CustomerRequest customerRequest) {
|
||||
PageHelper.startPage(customerRequest.getPageNum(), customerRequest.getPageSize());
|
||||
List<CustomerResponse> clients = customerMapper.listClient(customerRequest);
|
||||
PageInfo<CustomerResponse> info = new PageInfo<>(clients);
|
||||
return PageResult.toResult(info.getTotal(), clients);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<PageResult<CustomerResponse>> listVip(CustomerRequest customerRequest) {
|
||||
PageHelper.startPage(customerRequest.getPageNum(), customerRequest.getPageSize());
|
||||
List<CustomerResponse> clients = customerMapper.listVip(customerRequest);
|
||||
PageInfo<CustomerResponse> info = new PageInfo<>(clients);
|
||||
return PageResult.toResult(info.getTotal(), clients);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(Customer customer) {
|
||||
customerMapper.add(customer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomerResponse findById(Integer customerId) {
|
||||
return customerMapper.findById(customerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Customer customer) {
|
||||
customerMapper.update(customer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void del(Integer customerId) {
|
||||
customerMapper.del(customerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchDel(Integer[] customerIds) {
|
||||
customerMapper.batchDel(customerIds);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.bwie.manage.service.impl;
|
||||
|
||||
import com.bwie.common.domain.Import;
|
||||
import com.bwie.common.domain.request.ImportRequest;
|
||||
import com.bwie.common.domain.response.ImportResponse;
|
||||
import com.bwie.common.result.PageResult;
|
||||
import com.bwie.common.result.Result;
|
||||
import com.bwie.manage.mapper.ImportMapper;
|
||||
import com.bwie.manage.service.ImportService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.manage.service.impl
|
||||
* @Description TODO
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/24
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
public class ImportServiceImpl implements ImportService {
|
||||
|
||||
@Autowired
|
||||
private ImportMapper importMapper;
|
||||
|
||||
@Override
|
||||
public Result<PageResult<ImportResponse>> list(ImportRequest importRequest) {
|
||||
PageHelper.startPage(importRequest.getPageNum(), importRequest.getPageSize());
|
||||
List<ImportResponse> list = importMapper.list(importRequest);
|
||||
PageInfo<ImportResponse> info = new PageInfo<>(list);
|
||||
return PageResult.toResult(info.getTotal(), list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(Import imports) {
|
||||
imports.setImportDate(new Date());
|
||||
importMapper.add(imports);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
package com.bwie.manage.service.impl;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.bwie.common.domain.Merch;
|
||||
import com.bwie.common.domain.Type;
|
||||
import com.bwie.common.domain.request.MerchRequest;
|
||||
import com.bwie.common.domain.response.MerchResponse;
|
||||
import com.bwie.common.result.PageResult;
|
||||
|
@ -9,10 +11,18 @@ import com.bwie.manage.mapper.MerchMapper;
|
|||
import com.bwie.manage.service.MerchService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
import org.apache.tomcat.util.net.NioChannel;
|
||||
import org.apache.tomcat.util.net.NioEndpoint;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
|
@ -60,4 +70,42 @@ public class MerchServiceImpl implements MerchService {
|
|||
public void batchDel(Integer[] merchIds) {
|
||||
merchMapper.batchDel(merchIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Type> findTypes() {
|
||||
// 获取所有分类
|
||||
List<Type> types = merchMapper.findTypes();
|
||||
|
||||
// 使用stream流筛选和转化
|
||||
return types.stream()
|
||||
.filter(type -> type.getCategoryId().equals(NumberUtils.INTEGER_ZERO)) // 获取分类中第一级分类
|
||||
// 将每个一级分类的子级放入children集合中
|
||||
.map(first -> {
|
||||
// 判断一级分类是否为空,不为空返回对象,为空返回空对象
|
||||
first.setChildren(getChildren(first.getTypeId(), types).isEmpty() ? null : getChildren(first.getTypeId(), types));
|
||||
return first;
|
||||
})
|
||||
// 转换类型为List
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 递归调用,获取指定父分类的子分类
|
||||
private List<Type> getChildren(Integer parentId, List<Type> types) {
|
||||
// 过滤出categoryId等于parentId的子分类
|
||||
List<Type> collect = types.stream()
|
||||
.filter(type -> parentId.equals(type.getCategoryId()))
|
||||
// 递归调用,获取子分类的子分类(二级分类)
|
||||
.map(second -> {
|
||||
// 判断二级分类是否为空,不为空返回对象,为空返回空对象
|
||||
second.setChildren(getChildren(second.getTypeId(), types).isEmpty() ? null : getChildren(second.getTypeId(), types));
|
||||
return second;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
return collect;
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
int available = System.in.available();
|
||||
System.out.printf("a" + available);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
package com.bwie.manage.service.impl;
|
||||
|
||||
import com.bwie.common.domain.Returns;
|
||||
import com.bwie.common.domain.request.ReturnsRequest;
|
||||
import com.bwie.common.domain.response.ReturnsResponse;
|
||||
import com.bwie.common.result.PageResult;
|
||||
import com.bwie.common.result.Result;
|
||||
import com.bwie.manage.mapper.ReturnsMapper;
|
||||
import com.bwie.manage.service.ReturnsService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ProjectName: GG-market
|
||||
* @PackageName: com.bwie.manage.service.impl
|
||||
* @Description TODO
|
||||
* @Author LiYonJie
|
||||
* @Date 2023/11/24
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
public class ReturnsServiceImpl implements ReturnsService {
|
||||
|
||||
@Autowired
|
||||
private ReturnsMapper returnsMapper;
|
||||
|
||||
@Override
|
||||
public Result<PageResult<ReturnsResponse>> list(ReturnsRequest returnsRequest) {
|
||||
PageHelper.startPage(returnsRequest.getPageNum(), returnsRequest.getPageSize());
|
||||
List<ReturnsResponse> list = returnsMapper.list(returnsRequest);
|
||||
PageInfo<ReturnsResponse> info = new PageInfo<>(list);
|
||||
return PageResult.toResult(info.getTotal(), list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(Returns returns) {
|
||||
returns.setReturnsDate(new Date());
|
||||
returnsMapper.add(returns);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
<?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">
|
||||
<!-- mybatis数据层 namespace命名空间-->
|
||||
<mapper namespace="com.bwie.manage.mapper.CustomerMapper">
|
||||
|
||||
<sql id="selectCustomerVo">
|
||||
select customer_id, customer_name, customer_age, customer_gender, customer_address, customer_tel,vip_grade,reg_date from tb_customer
|
||||
</sql>
|
||||
|
||||
<select id="listClient" resultType="com.bwie.common.domain.response.CustomerResponse">
|
||||
<include refid="selectCustomerVo"/>
|
||||
<where>
|
||||
vip_grade = 0
|
||||
<if test="null != customerId">
|
||||
and customer_id = #{customerId}
|
||||
</if>
|
||||
<if test="null != customerName and '' !=customerName">
|
||||
and customer_name like concat('%',#{customerName},'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="listVip" resultType="com.bwie.common.domain.response.CustomerResponse">
|
||||
<include refid="selectCustomerVo"/>
|
||||
<where>
|
||||
vip_grade != 0
|
||||
<if test="null != customerId">
|
||||
and customer_id = #{customerId}
|
||||
</if>
|
||||
<if test="null != customerName and '' !=customerName">
|
||||
and customer_name like concat('%',#{customerName},'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="add">
|
||||
insert into tb_customer
|
||||
<trim prefix="(" suffix=")" >
|
||||
<if test="null != customerName and '' != customerName">customer_name,</if>
|
||||
<if test="null != customerAge">customer_age,</if>
|
||||
<if test="null != customerGender">customer_gender,</if>
|
||||
<if test="null != customerAddress and '' != customerAddress">customer_address,</if>
|
||||
<if test="null != customerTel and '' != customerTel">customer_tel</if>
|
||||
</trim>
|
||||
values
|
||||
<trim prefix="(" suffix=")">
|
||||
<if test="null != customerName and '' != customerName">#{customerName},</if>
|
||||
<if test="null != customerAge">#{customerAge},</if>
|
||||
<if test="null != customerGender">#{customerGender},</if>
|
||||
<if test="null != customerAddress and '' != customerAddress">#{customerAddress},</if>
|
||||
<if test="null != customerTel and '' != customerTel">#{customerTel}</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="findById" resultType="com.bwie.common.domain.response.CustomerResponse">
|
||||
<include refid="selectCustomerVo"/> where customer_id = #{customerId}
|
||||
</select>
|
||||
|
||||
<update id="update">
|
||||
update tb_customer
|
||||
<set>
|
||||
<if test="null != customerName and '' != customerName">customer_name = #{customerName},</if>
|
||||
<if test="null != customerAge">customer_age = #{customerAge},</if>
|
||||
<if test="null != customerGender">customer_gender = #{customerGender},</if>
|
||||
<if test="null != customerAddress and '' != customerAddress">customer_address = #{customerAddress},</if>
|
||||
<if test="null != customerTel and '' != customerTel">customer_tel = #{customerTel},</if>
|
||||
<if test="null != vipGrade">vip_grade = #{vipGrade},</if>
|
||||
<if test="null != regDate">reg_date = #{regDate}</if>
|
||||
</set>
|
||||
where customer_id = #{customerId}
|
||||
</update>
|
||||
|
||||
<delete id="del">
|
||||
delete from tb_customer where customer_id = #{customerId}
|
||||
</delete>
|
||||
|
||||
<delete id="batchDel">
|
||||
delete from tb_customer where customer_id in
|
||||
<foreach collection="customerIds" item="customerId" open="(" close=")" separator=",">
|
||||
#{customerId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,16 @@
|
|||
<?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">
|
||||
<!-- mybatis数据层 namespace命名空间-->
|
||||
<mapper namespace="com.bwie.manage.mapper.ImportMapper">
|
||||
|
||||
<select id="list" resultType="com.bwie.common.domain.response.ImportResponse">
|
||||
select list_id,merch_id, merch_name, type_ids, merch_price, plan_num, import_date, provide_id from tb_import
|
||||
</select>
|
||||
|
||||
<insert id="add">
|
||||
insert into tb_import (merch_id, merch_name, type_ids, merch_price, plan_num, import_date, provide_id)
|
||||
values (#{merchId},#{merchName},#{typeIds},#{merchPrice},#{planNum},#{importDate},#{provideId})
|
||||
</insert>
|
||||
</mapper>
|
|
@ -5,39 +5,59 @@
|
|||
<!-- mybatis数据层 namespace命名空间-->
|
||||
<mapper namespace="com.bwie.manage.mapper.MerchMapper">
|
||||
|
||||
<resultMap type="com.bwie.common.domain.Merch" id="MerchResult">
|
||||
<id property="merchId" column="merch_id" />
|
||||
<result property="merchName" column="merch_name" />
|
||||
<result property="typeIds" column="type_ids" />
|
||||
<result property="merchPrice" column="merch_price" />
|
||||
<result property="barCode" column="bar_code" />
|
||||
<result property="salesProPrice" column="sales_pro_price" />
|
||||
<result property="factoryId" column="factory_id" />
|
||||
<result property="provideId" column="provide_id" />
|
||||
<result property="merchDeadTime" column="merch_dead_time" />
|
||||
<result property="merchNum" column="merch_num" />
|
||||
<result property="merchSta" column="merch_sta" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMerchVo">
|
||||
select
|
||||
m.merch_id, m.merch_name,m.merch_type,
|
||||
m.merch_id, m.merch_name,m.type_ids,
|
||||
t.type_name, m.merch_price,
|
||||
m.bar_code, m.sales_pro_price,
|
||||
m.factory_id, m.provide_id,
|
||||
m.merch_dead_time, m.merch_num,
|
||||
m.merch_sta
|
||||
from tb_merch m
|
||||
left join tb_type t on m.merch_type = t.type_id
|
||||
left join tb_type t on SUBSTRING_INDEX(m.type_ids, ',', -1) = t.type_id
|
||||
</sql>
|
||||
|
||||
<select id="list" resultType="com.bwie.common.domain.response.MerchResponse">
|
||||
<select id="list" resultType="com.bwie.common.domain.response.MerchResponse" resultMap="MerchResult">
|
||||
<include refid="selectMerchVo"/>
|
||||
<where>
|
||||
<if test="null != merchId">
|
||||
and m.merch_id = #{merchId}
|
||||
</if>
|
||||
<if test="null != merchType">
|
||||
and m.merch_type = #{merchType}
|
||||
<if test="null != typeIds and '' != typeIds">
|
||||
and t.type_id = #{typeIds}
|
||||
</if>
|
||||
<if test="null != merchName and '' != merchName">
|
||||
and m.merch_name like concat('%',#{merchName},'%')
|
||||
</if>
|
||||
<if test="null != startNum">
|
||||
and <![CDATA[ m.merch_num >= #{startNum} ]]>
|
||||
</if>
|
||||
<if test="null != endNum">
|
||||
and <![CDATA[ m.merch_num <= #{endNum} ]]>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="add">
|
||||
insert into tb_merch (merch_name, merch_type, merch_price, bar_code, sales_pro_price, factory_id, provide_id, merch_dead_time, merch_num, merch_sta)
|
||||
values (#{merchName},#{merchType},#{merchPrice},#{barCode},#{salesProPrice},#{factoryId},#{provideId},#{merchDeadTime},#{merchNum},#{merchSta})
|
||||
<insert id="add" useGeneratedKeys="true" keyProperty="merchId">
|
||||
insert into tb_merch (merch_name, type_ids, merch_price, bar_code, sales_pro_price, factory_id, provide_id, merch_dead_time, merch_num, merch_sta)
|
||||
values (#{merchName},#{typeIds},#{merchPrice},#{barCode},#{salesProPrice},#{factoryId},#{provideId},#{merchDeadTime},#{merchNum},#{merchSta})
|
||||
</insert>
|
||||
|
||||
<select id="findById" resultType="com.bwie.common.domain.Merch">
|
||||
<select id="findById" resultType="com.bwie.common.domain.Merch" resultMap="MerchResult">
|
||||
<include refid="selectMerchVo"/> where m.merch_id = #{merchId}
|
||||
</select>
|
||||
|
||||
|
@ -45,7 +65,7 @@
|
|||
update tb_merch
|
||||
<set>
|
||||
merch_name = #{merchName},
|
||||
merch_type = #{merchType},
|
||||
type_ids = #{typeIds},
|
||||
merch_price = #{merchPrice},
|
||||
bar_code = #{barCode},
|
||||
sales_pro_price = #{salesProPrice},
|
||||
|
@ -68,4 +88,8 @@
|
|||
#{merchId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="findTypes" resultType="com.bwie.common.domain.Type">
|
||||
select type_id, type_name, category_id from tb_type
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<?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">
|
||||
<!-- mybatis数据层 namespace命名空间-->
|
||||
<mapper namespace="com.bwie.manage.mapper.ReturnsMapper">
|
||||
|
||||
<select id="list" resultType="com.bwie.common.domain.response.ReturnsResponse">
|
||||
select list_id,merch_id, merch_name, type_ids, merch_price, plan_num, returns_date, provide_id from tb_returns
|
||||
</select>
|
||||
|
||||
<insert id="add">
|
||||
insert into tb_returns (merch_id, merch_name, type_ids, merch_price, plan_num, returns_date, provide_id)
|
||||
values (#{merchId},#{merchName},#{typeIds},#{merchPrice},#{planNum},#{returnsDate},#{provideId})
|
||||
</insert>
|
||||
</mapper>
|
Loading…
Reference in New Issue