add mold product
parent
87e34e30ac
commit
d7745a285c
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.mold.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||
|
||||
@Schema(description = "管理后台 - 模具 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MoldProductRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32278")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2336")
|
||||
private Long productId;
|
||||
@Schema(description = "产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "2336")
|
||||
@ExcelProperty("产品")
|
||||
private String productName;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "型号id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15258")
|
||||
@ExcelProperty("型号id")
|
||||
private Long brandId;
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.dataobject.mold;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 模具产品 DO
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@TableName("erp_mold_brand_product")
|
||||
@KeySequence("erp_mold_brand_product_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MoldBrandProductDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 型号ID
|
||||
*/
|
||||
private Long brandId;
|
||||
/**
|
||||
* 产品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.mysql.mold;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldBrandProductDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 模具产品 Mapper
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Mapper
|
||||
public interface MoldBrandProductMapper extends BaseMapperX<MoldBrandProductDO> {
|
||||
|
||||
default PageResult<MoldBrandProductDO> selectPage(PageParam reqVO, Long brandId) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MoldBrandProductDO>()
|
||||
.eq(MoldBrandProductDO::getBrandId, brandId)
|
||||
.orderByDesc(MoldBrandProductDO::getId));
|
||||
}
|
||||
|
||||
default int deleteByBrandId(Long brandId) {
|
||||
return delete(MoldBrandProductDO::getBrandId, brandId);
|
||||
}
|
||||
default List<MoldBrandProductDO> selectList(MoldBrandProductDO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<MoldBrandProductDO>()
|
||||
.eqIfPresent(MoldBrandProductDO::getProductId, reqVO.getProductId())
|
||||
.eqIfPresent(MoldBrandProductDO::getBrandId, reqVO.getBrandId())
|
||||
.orderByDesc(MoldBrandProductDO::getId));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue