初始化-第二次提交
parent
d36afca7f9
commit
8cce396954
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.product.domain.model.CategoryInfoSaveModel;
|
||||
import com.muyu.product.domain.req.CategoryInfoUpdReq;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
@ -13,11 +14,9 @@ import io.swagger.annotations.*;
|
|||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.product.domain.req.CategoryInfoQueryReq;
|
||||
import com.muyu.product.domain.req.CategoryInfoSaveReq;
|
||||
import com.muyu.product.domain.req.CategoryInfoEditReq;
|
||||
import com.muyu.common.core.web.domain.TreeEntity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
|
@ -92,7 +91,7 @@ public class CategoryInfo extends TreeEntity {
|
|||
/**
|
||||
* 修改构造器
|
||||
*/
|
||||
public static CategoryInfo editBuild(Long id, CategoryInfoEditReq categoryInfoEditReq){
|
||||
public static CategoryInfo editBuild(Long id, CategoryInfoUpdReq categoryInfoEditReq){
|
||||
return CategoryInfo.builder()
|
||||
.id(id)
|
||||
.name(categoryInfoEditReq.getName())
|
||||
|
|
|
@ -50,6 +50,9 @@ public class RuleInfo extends BaseEntity {
|
|||
@Excel(name = "规格状态")
|
||||
@ApiModelProperty(name = "规格状态", value = "规格状态")
|
||||
private String status;
|
||||
@Excel(name = "规格详情")
|
||||
@ApiModelProperty(name = "规格详情", value = "规格详情")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 查询构造器
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package com.muyu.product.domain.req;
|
||||
import com.muyu.product.domain.AttributeInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class AttributeUpdReq {
|
||||
/** 组名称 */
|
||||
private String name;
|
||||
|
||||
/** 状态 */
|
||||
private String states;
|
||||
|
||||
/**修改属性的信息**/
|
||||
private List<AttributeInfo> attributeList;
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class CategoryInfoUpdReq {
|
||||
/** 品类名称 */
|
||||
@ApiModelProperty(name = "品类名称", value = "品类名称", required = true)
|
||||
private String name;
|
||||
|
||||
/** 图片 */
|
||||
@ApiModelProperty(name = "图片", value = "图片", required = true)
|
||||
private String image;
|
||||
|
||||
/** 是否启用 */
|
||||
@ApiModelProperty(name = "是否启用", value = "是否启用", required = true)
|
||||
private String start;
|
||||
|
||||
/** 介绍 */
|
||||
@ApiModelProperty(name = "介绍", value = "介绍")
|
||||
private String introduction;
|
||||
/**商品属性组关联ID**/
|
||||
private List<Long> attributeGroupIdList;
|
||||
/**商品属性关联ID**/
|
||||
private List<Long> attributeIdList;
|
||||
/**商品品牌组关联ID**/
|
||||
private List<Long> brandGroupIdList;
|
||||
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.product.domain.model.RuleAttrAddModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
@ -8,6 +10,8 @@ import lombok.experimental.SuperBuilder;
|
|||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品规格对象 rule_info
|
||||
*
|
||||
|
@ -30,5 +34,12 @@ public class RuleInfoEditReq extends BaseEntity {
|
|||
/** 规格状态 */
|
||||
@ApiModelProperty(name = "规格状态", value = "规格状态")
|
||||
private String status;
|
||||
@Excel(name = "规格详情")
|
||||
@ApiModelProperty(name = "规格详情", value = "规格详情")
|
||||
private String remark;
|
||||
/**
|
||||
* 规格属性集合
|
||||
*/
|
||||
private List<RuleAttrAddModel> ruleAttrList;
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import com.muyu.product.domain.RuleAttrInfo;
|
||||
import com.muyu.product.domain.model.RuleAttrAddModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class RuleInfoUpdReq {
|
||||
/**
|
||||
* 规则名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 规格备注
|
||||
*/
|
||||
private String states;
|
||||
/**
|
||||
* 规格备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 规格属性集合
|
||||
*/
|
||||
private List<RuleAttrAddModel> ruleAttrList;
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package com.muyu.product.domain.resp;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.product.domain.AttributeInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 修改回显详细信息
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class AttributeGroupUpdResp {
|
||||
/** 属性组编号 */
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
@ApiModelProperty(name = "属性组编号", value = "属性组编号")
|
||||
private Long id;
|
||||
|
||||
/** 组名称 */
|
||||
@Excel(name = "组名称")
|
||||
@ApiModelProperty(name = "组名称", value = "组名称", required = true)
|
||||
private String name;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
@ApiModelProperty(name = "状态", value = "状态", required = true)
|
||||
private String states;
|
||||
|
||||
/**属性id集合**/
|
||||
private List<AttributeInfo> attributeList;
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.muyu.product.domain.resp;
|
||||
|
||||
import com.muyu.product.domain.model.RuleAttrAddModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class RuleInfoUpdResp {
|
||||
/**
|
||||
*规则id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 规则名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 规格备注
|
||||
*/
|
||||
private String states;
|
||||
/**
|
||||
* 规格备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 规格属性集合
|
||||
*/
|
||||
private List<RuleAttrAddModel> ruleAttrList;
|
||||
}
|
|
@ -4,7 +4,9 @@ import java.util.List;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.muyu.product.domain.model.AttributeGroupSaveModel;
|
||||
import com.muyu.product.domain.req.AttributeUpdReq;
|
||||
import com.muyu.product.domain.resp.AttributeGroupPageResp;
|
||||
import com.muyu.product.domain.resp.AttributeGroupUpdResp;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -74,8 +76,8 @@ public class AttributeGroupController extends BaseController {
|
|||
@RequiresPermissions("product:attributeGroup:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<AttributeGroup> getInfo(@PathVariable("id") Long id) {
|
||||
return Result.success(attributeGroupService.getById(id));
|
||||
public Result<AttributeGroupUpdResp> getInfo(@PathVariable("id") Long id) {
|
||||
return Result.success(attributeGroupService.getUpdById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -98,8 +100,8 @@ public class AttributeGroupController extends BaseController {
|
|||
@Log(title = "属性组", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("修改属性组")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody AttributeGroupEditReq attributeGroupEditReq) {
|
||||
return toAjax(attributeGroupService.updateById(AttributeGroup.editBuild(id,attributeGroupEditReq)));
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody AttributeUpdReq attributeUpdReq) {
|
||||
return toAjax(attributeGroupService.updateByattr(id,attributeUpdReq));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.muyu.product.domain.AttributeGroup;
|
|||
import com.muyu.product.domain.AttributeInfo;
|
||||
import com.muyu.product.domain.BrandInfo;
|
||||
import com.muyu.product.domain.model.CategoryInfoSaveModel;
|
||||
import com.muyu.product.domain.req.CategoryInfoUpdReq;
|
||||
import com.muyu.product.domain.resp.CategoryCommonElementResp;
|
||||
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
||||
import io.swagger.annotations.*;
|
||||
|
@ -112,8 +113,8 @@ public class CategoryInfoController extends BaseController {
|
|||
@Log(title = "品类信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("修改品类信息")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody CategoryInfoEditReq categoryInfoEditReq) {
|
||||
return toAjax(categoryInfoService.updateById(CategoryInfo.editBuild(id,categoryInfoEditReq)));
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody CategoryInfoUpdReq categoryInfoUpdReq) {
|
||||
return toAjax(categoryInfoService.updateById(id,categoryInfoUpdReq));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -124,8 +125,9 @@ public class CategoryInfoController extends BaseController {
|
|||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除品类信息")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(categoryInfoService.removeBatchByIds(ids));
|
||||
public Result<String> remove(@PathVariable Long ids) {
|
||||
Result i = categoryInfoService.removeBatchById(ids);
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import com.muyu.common.core.text.Convert;
|
||||
import com.muyu.product.domain.model.RuleInfoAddModel;
|
||||
import com.muyu.product.domain.resp.RuleInfoResp;
|
||||
import com.muyu.product.domain.resp.RuleInfoUpdResp;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -77,8 +78,8 @@ public class RuleInfoController extends BaseController {
|
|||
@RequiresPermissions("product:rule:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<RuleInfo> getInfo(@PathVariable("id") Long id) {
|
||||
return Result.success(ruleInfoService.getById(id));
|
||||
public Result<RuleInfoUpdResp> getInfo(@PathVariable("id") Long id) {
|
||||
return Result.success(ruleInfoService.selectById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -100,7 +101,9 @@ public class RuleInfoController extends BaseController {
|
|||
@PutMapping("/{id}")
|
||||
@ApiOperation("修改商品规格")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody RuleInfoEditReq ruleInfoEditReq) {
|
||||
return toAjax(ruleInfoService.updateById(RuleInfo.editBuild(id,ruleInfoEditReq)));
|
||||
// return toAjax(ruleInfoService.updateById(RuleInfo.editBuild(id,ruleInfoEditReq)));
|
||||
boolean result = ruleInfoService.updateById(id, ruleInfoEditReq);
|
||||
return result ? Result.success() : Result.error();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.product.mapper;
|
|||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.AsAttributeGroup;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 属性与组中间Mapper接口
|
||||
|
@ -12,4 +13,9 @@ import com.muyu.product.domain.AsAttributeGroup;
|
|||
*/
|
||||
public interface AsAttributeGroupMapper extends BaseMapper<AsAttributeGroup> {
|
||||
|
||||
void deleteAsAttributeGroup(Long id);
|
||||
|
||||
void updateAttributeById(@Param("id") Long id, @Param("name") String name, @Param("states") String states);
|
||||
|
||||
void addByGroup(@Param("id") Long id, @Param("id1") Long id1);
|
||||
}
|
||||
|
|
|
@ -12,4 +12,5 @@ import com.muyu.product.domain.AsCategoryAttributeGroup;
|
|||
*/
|
||||
public interface AsCategoryAttributeGroupMapper extends BaseMapper<AsCategoryAttributeGroup> {
|
||||
|
||||
void add(Long attributeGroupId, Long id);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.product.mapper;
|
|||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.AsCategoryAttribute;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 品类属性中间Mapper接口
|
||||
|
@ -12,4 +13,5 @@ import com.muyu.product.domain.AsCategoryAttribute;
|
|||
*/
|
||||
public interface AsCategoryAttributeMapper extends BaseMapper<AsCategoryAttribute> {
|
||||
|
||||
void add(@Param("attributeId") Long attributeId, @Param("id") Long id);
|
||||
}
|
||||
|
|
|
@ -12,4 +12,5 @@ import com.muyu.product.domain.AsCategoryBrand;
|
|||
*/
|
||||
public interface AsCategoryBrandMapper extends BaseMapper<AsCategoryBrand> {
|
||||
|
||||
void add(Long brandGroupId, Long id);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.CategoryInfo;
|
||||
import com.muyu.product.domain.ProjectInfo;
|
||||
import com.muyu.product.domain.req.CategoryInfoUpdReq;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 品类信息Mapper接口
|
||||
|
@ -12,4 +16,7 @@ import com.muyu.product.domain.CategoryInfo;
|
|||
*/
|
||||
public interface CategoryInfoMapper extends BaseMapper<CategoryInfo> {
|
||||
|
||||
Boolean updateById(@Param("id") Long id, @Param("categoryInfoUpdReq") CategoryInfoUpdReq categoryInfoUpdReq);
|
||||
|
||||
List<ProjectInfo> selectProjectInfoById(@Param("id") Long id);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.product.service;
|
|||
import java.util.List;
|
||||
import com.muyu.product.domain.AsAttributeGroup;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
|
||||
/**
|
||||
* 属性与组中间Service接口
|
||||
|
@ -19,4 +20,6 @@ public interface AsAttributeGroupService extends IService<AsAttributeGroup> {
|
|||
*/
|
||||
public List<AsAttributeGroup> list(AsAttributeGroup asAttributeGroup);
|
||||
|
||||
void addByGroup(@Param("id") Long id, @Param("id1") Long id1);
|
||||
|
||||
}
|
||||
|
|
|
@ -19,4 +19,5 @@ public interface AsCategoryAttributeGroupService extends IService<AsCategoryAttr
|
|||
*/
|
||||
public List<AsCategoryAttributeGroup> list(AsCategoryAttributeGroup asCategoryAttributeGroup);
|
||||
|
||||
void addByGroup(Long attributeGroupId, Long id);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.product.service;
|
|||
import java.util.List;
|
||||
import com.muyu.product.domain.AsCategoryAttribute;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 品类属性中间Service接口
|
||||
|
@ -19,4 +20,5 @@ public interface AsCategoryAttributeService extends IService<AsCategoryAttribute
|
|||
*/
|
||||
public List<AsCategoryAttribute> list(AsCategoryAttribute asCategoryAttribute);
|
||||
|
||||
void addByGroup(@Param("attributeId") Long attributeId, @Param("id") Long id);
|
||||
}
|
||||
|
|
|
@ -19,4 +19,5 @@ public interface AsCategoryBrandService extends IService<AsCategoryBrand> {
|
|||
*/
|
||||
public List<AsCategoryBrand> list(AsCategoryBrand asCategoryBrand);
|
||||
|
||||
void addByGroup(Long brandGroupId, Long id);
|
||||
}
|
||||
|
|
|
@ -5,25 +5,21 @@ import java.util.List;
|
|||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.product.domain.AttributeGroup;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.product.domain.AttributeInfo;
|
||||
import com.muyu.product.domain.model.AttributeGroupSaveModel;
|
||||
import com.muyu.product.domain.req.AttributeUpdReq;
|
||||
import com.muyu.product.domain.resp.AttributeGroupPageResp;
|
||||
import com.muyu.product.domain.resp.AttributeGroupUpdResp;
|
||||
|
||||
/**
|
||||
* 属性组Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
public interface AttributeGroupService extends IService<AttributeGroup> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param attributeGroup 分组对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
public TableDataInfo<AttributeGroupPageResp> page(AttributeGroup attributeGroup);
|
||||
|
||||
/**
|
||||
* 查询属性组列表
|
||||
*
|
||||
|
@ -31,12 +27,18 @@ public interface AttributeGroupService extends IService<AttributeGroup> {
|
|||
* @return 属性组集合
|
||||
*/
|
||||
public List<AttributeGroup> list(AttributeGroup attributeGroup);
|
||||
|
||||
/**
|
||||
* 保存
|
||||
* @param attributeGroupSaveModel 属性组保存模型
|
||||
* @return 是否成功
|
||||
*/
|
||||
public Boolean save(AttributeGroupSaveModel attributeGroupSaveModel);
|
||||
|
||||
/**
|
||||
* 根据id查询属性组的详情
|
||||
*/
|
||||
AttributeGroupUpdResp getUpdById(Long id);
|
||||
/**
|
||||
* 修改属性
|
||||
*/
|
||||
boolean updateByattr(Long id, AttributeUpdReq attributeUpdReq);
|
||||
}
|
||||
|
|
|
@ -2,12 +2,14 @@ package com.muyu.product.service;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.product.domain.AttributeGroup;
|
||||
import com.muyu.product.domain.AttributeInfo;
|
||||
import com.muyu.product.domain.BrandInfo;
|
||||
import com.muyu.product.domain.CategoryInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.product.domain.model.CategoryInfoSaveModel;
|
||||
import com.muyu.product.domain.req.CategoryInfoUpdReq;
|
||||
import com.muyu.product.domain.resp.CategoryCommonElementResp;
|
||||
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
||||
|
||||
|
@ -69,4 +71,9 @@ public interface CategoryInfoService extends IService<CategoryInfo> {
|
|||
CategoryCommonElementResp getTemplateAttributeByCateGoryId (Long cateGoryId);
|
||||
|
||||
public <T, AS> List<T> getCommon (Long categoryId, IService<AS> iService, IService<T> bsiService);
|
||||
|
||||
boolean updateById(Long id,CategoryInfoUpdReq categoryInfoUpdReq);
|
||||
|
||||
Result removeBatchById(Long ids);
|
||||
|
||||
}
|
||||
|
|
|
@ -6,8 +6,11 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
import com.muyu.product.domain.RuleInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.product.domain.model.RuleInfoAddModel;
|
||||
import com.muyu.product.domain.req.RuleInfoEditReq;
|
||||
import com.muyu.product.domain.req.RuleInfoQueryReq;
|
||||
import com.muyu.product.domain.req.RuleInfoUpdReq;
|
||||
import com.muyu.product.domain.resp.RuleInfoResp;
|
||||
import com.muyu.product.domain.resp.RuleInfoUpdResp;
|
||||
|
||||
/**
|
||||
* 商品规格Service接口
|
||||
|
@ -32,4 +35,14 @@ public interface RuleInfoService extends IService<RuleInfo> {
|
|||
public boolean save(RuleInfoAddModel ruleInfoAddModel);
|
||||
|
||||
TableDataInfo<RuleInfoResp> queryList (RuleInfoQueryReq ruleInfoQueryReq);
|
||||
/**
|
||||
* 规格id查询根据id
|
||||
*/
|
||||
RuleInfoUpdResp selectById(Long id);
|
||||
|
||||
/**
|
||||
* 通过id修改规格属性
|
||||
*/
|
||||
boolean updateById(Long id, RuleInfoEditReq ruleInfoEditReq);
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
|
||||
import com.muyu.common.core.utils.ObjUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.product.mapper.AsAttributeGroupMapper;
|
||||
import com.muyu.product.domain.AsAttributeGroup;
|
||||
|
@ -11,6 +12,8 @@ import com.muyu.product.service.AsAttributeGroupService;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 属性与组中间Service业务层处理
|
||||
*
|
||||
|
@ -20,6 +23,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
@Slf4j
|
||||
@Service
|
||||
public class AsAttributeGroupServiceImpl extends ServiceImpl<AsAttributeGroupMapper, AsAttributeGroup> implements AsAttributeGroupService {
|
||||
@Resource
|
||||
private AsAttributeGroupMapper asAttributeGroupMapper;
|
||||
|
||||
/**
|
||||
* 查询属性与组中间列表
|
||||
|
@ -42,4 +47,9 @@ public class AsAttributeGroupServiceImpl extends ServiceImpl<AsAttributeGroupMap
|
|||
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addByGroup(Long id, Long id1) {
|
||||
asAttributeGroupMapper.addByGroup(id,id1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
|
||||
import com.muyu.common.core.utils.ObjUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.product.mapper.AsCategoryAttributeGroupMapper;
|
||||
import com.muyu.product.domain.AsCategoryAttributeGroup;
|
||||
|
@ -11,6 +12,8 @@ import com.muyu.product.service.AsCategoryAttributeGroupService;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 品类属性组中间Service业务层处理
|
||||
*
|
||||
|
@ -21,6 +24,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
@Service
|
||||
public class AsCategoryAttributeGroupServiceImpl extends ServiceImpl<AsCategoryAttributeGroupMapper, AsCategoryAttributeGroup> implements AsCategoryAttributeGroupService {
|
||||
|
||||
@Resource
|
||||
private AsCategoryAttributeGroupMapper asCategoryAttributeGroupMapper;
|
||||
/**
|
||||
* 查询品类属性组中间列表
|
||||
*
|
||||
|
@ -40,10 +45,11 @@ public class AsCategoryAttributeGroupServiceImpl extends ServiceImpl<AsCategoryA
|
|||
queryWrapper.eq(AsCategoryAttributeGroup::getAttributeGroupId, asCategoryAttributeGroup.getAttributeGroupId());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addByGroup(Long attributeGroupId, Long id) {
|
||||
asCategoryAttributeGroupMapper.add(attributeGroupId,id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
|
||||
import com.muyu.common.core.utils.ObjUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.product.mapper.AsCategoryAttributeMapper;
|
||||
import com.muyu.product.domain.AsCategoryAttribute;
|
||||
|
@ -11,6 +12,8 @@ import com.muyu.product.service.AsCategoryAttributeService;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 品类属性中间Service业务层处理
|
||||
*
|
||||
|
@ -21,6 +24,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
@Service
|
||||
public class AsCategoryAttributeServiceImpl extends ServiceImpl<AsCategoryAttributeMapper, AsCategoryAttribute> implements AsCategoryAttributeService {
|
||||
|
||||
@Resource
|
||||
private AsCategoryAttributeMapper asCategoryAttributeMapper;
|
||||
/**
|
||||
* 查询品类属性中间列表
|
||||
*
|
||||
|
@ -40,10 +45,11 @@ public class AsCategoryAttributeServiceImpl extends ServiceImpl<AsCategoryAttrib
|
|||
queryWrapper.eq(AsCategoryAttribute::getAttributeId, asCategoryAttribute.getAttributeId());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addByGroup(Long attributeId, Long id) {
|
||||
asCategoryAttributeMapper.add(attributeId,id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,8 @@ import com.muyu.product.service.AsCategoryBrandService;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 品类品牌中间Service业务层处理
|
||||
*
|
||||
|
@ -21,6 +23,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
@Service
|
||||
public class AsCategoryBrandServiceImpl extends ServiceImpl<AsCategoryBrandMapper, AsCategoryBrand> implements AsCategoryBrandService {
|
||||
|
||||
@Resource
|
||||
private AsCategoryBrandMapper asCategoryBrandMapper;
|
||||
/**
|
||||
* 查询品类品牌中间列表
|
||||
*
|
||||
|
@ -40,10 +44,11 @@ public class AsCategoryBrandServiceImpl extends ServiceImpl<AsCategoryBrandMappe
|
|||
queryWrapper.eq(AsCategoryBrand::getBrandId, asCategoryBrand.getBrandId());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addByGroup(Long brandGroupId, Long id) {
|
||||
asCategoryBrandMapper.add(brandGroupId,id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,10 @@ import com.muyu.product.domain.AsAttributeGroup;
|
|||
import com.muyu.product.domain.AttributeGroup;
|
||||
import com.muyu.product.domain.AttributeInfo;
|
||||
import com.muyu.product.domain.model.AttributeGroupSaveModel;
|
||||
import com.muyu.product.domain.req.AttributeUpdReq;
|
||||
import com.muyu.product.domain.resp.AttributeGroupPageResp;
|
||||
import com.muyu.product.domain.resp.AttributeGroupUpdResp;
|
||||
import com.muyu.product.mapper.AsAttributeGroupMapper;
|
||||
import com.muyu.product.mapper.AttributeGroupMapper;
|
||||
import com.muyu.product.service.AsAttributeGroupService;
|
||||
import com.muyu.product.service.AttributeGroupService;
|
||||
|
@ -19,9 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 属性组Service业务层处理
|
||||
|
@ -34,10 +36,12 @@ import java.util.stream.Stream;
|
|||
public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper, AttributeGroup> implements AttributeGroupService {
|
||||
|
||||
@Autowired
|
||||
private AsAttributeGroupService attributeGroupService;
|
||||
private AsAttributeGroupService asAttributeGroupService;
|
||||
|
||||
@Autowired
|
||||
private AttributeInfoService attributeInfoService;
|
||||
@Resource
|
||||
private AsAttributeGroupMapper asAttributeGroupMapper;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
|
@ -86,9 +90,7 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
|
|||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param attributeGroupSaveModel 属性组保存模型
|
||||
*
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
|
@ -100,11 +102,55 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
|
|||
Long attributeGroupId = attributeGroup.getId();
|
||||
List<Long> attributeIdList = attributeGroupSaveModel.getAttributeIdList();
|
||||
|
||||
attributeGroupService.saveBatch(
|
||||
asAttributeGroupService.saveBatch(
|
||||
attributeIdList.stream()
|
||||
.map(attributeId -> AsAttributeGroup.buildGroup(attributeGroupId, attributeId))
|
||||
.toList()
|
||||
);
|
||||
return save;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttributeGroupUpdResp getUpdById(Long id) {
|
||||
//获取id
|
||||
AttributeGroup attributeGroup = this.getById(id);
|
||||
|
||||
LambdaQueryWrapper<AsAttributeGroup> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(AsAttributeGroup::getGroupId,id);
|
||||
|
||||
List<AsAttributeGroup> asAttributeGroupList = asAttributeGroupService.list(queryWrapper);
|
||||
List<Long> attributeIdList = asAttributeGroupList.stream()
|
||||
.map(AsAttributeGroup::getAttributeId)
|
||||
.toList();
|
||||
List<AttributeInfo> attributeInfoList = attributeInfoService.listByIds(attributeIdList);
|
||||
//转型
|
||||
return AttributeGroupUpdResp.builder()
|
||||
.id(attributeGroup.getId())
|
||||
.name(attributeGroup.getName())
|
||||
.states(attributeGroup.getStates())
|
||||
.attributeList(attributeInfoList)
|
||||
.build();
|
||||
}
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean updateByattr(Long id, AttributeUpdReq attributeUpdReq) {
|
||||
//修改属性组信息
|
||||
asAttributeGroupMapper.updateAttributeById(id,attributeUpdReq.getName(),attributeUpdReq.getStates());
|
||||
//删除中间表根据属性组id删除
|
||||
asAttributeGroupMapper.deleteAsAttributeGroup(id);
|
||||
//添加中间表
|
||||
attributeUpdReq.getAttributeList().stream().forEach(attributeList->{
|
||||
asAttributeGroupService.addByGroup(id,attributeList.getId());
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,12 +4,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.ObjUtils;
|
||||
import com.muyu.product.domain.*;
|
||||
import com.muyu.product.domain.base.CategoryBase;
|
||||
import com.muyu.product.domain.model.CategoryInfoSaveModel;
|
||||
import com.muyu.product.domain.model.TemplateAttributeGroupModel;
|
||||
import com.muyu.product.domain.model.TemplateAttributeModel;
|
||||
import com.muyu.product.domain.req.CategoryInfoUpdReq;
|
||||
import com.muyu.product.domain.resp.CategoryCommonElementResp;
|
||||
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
||||
import com.muyu.product.mapper.CategoryInfoMapper;
|
||||
|
@ -19,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
@ -57,6 +60,8 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
|||
|
||||
@Autowired
|
||||
private AttributeGroupService attributeGroupService;
|
||||
@Resource
|
||||
private CategoryInfoMapper categoryInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询品类信息列表
|
||||
|
@ -270,6 +275,56 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
|||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional /**解决事务问题**/
|
||||
public boolean updateById(Long id,CategoryInfoUpdReq categoryInfoUpdReq) {
|
||||
//修改品类信息
|
||||
Boolean b= categoryInfoMapper.updateById(id,categoryInfoUpdReq);
|
||||
//删除品类与属性,属性组,品牌关联表
|
||||
asCategoryAttributeService.remove(new LambdaQueryWrapper<AsCategoryAttribute>().eq(AsCategoryAttribute::getCategoryId,id));
|
||||
asCategoryAttributeGroupService.remove(new LambdaQueryWrapper<AsCategoryAttributeGroup>().eq(AsCategoryAttributeGroup::getCategoryId,id));
|
||||
asCategoryBrandService.remove(new LambdaQueryWrapper<AsCategoryBrand>().eq(AsCategoryBrand::getCategoryId,id));
|
||||
//添加新的关联数据(属性表)
|
||||
if(null!=categoryInfoUpdReq.getAttributeIdList()){
|
||||
categoryInfoUpdReq.getAttributeIdList().stream().forEach(attributeId -> {
|
||||
asCategoryAttributeService.addByGroup(attributeId,id);
|
||||
});
|
||||
}
|
||||
//添加新的关联数据(属性组表)
|
||||
if(null!=categoryInfoUpdReq.getAttributeGroupIdList()){
|
||||
categoryInfoUpdReq.getAttributeGroupIdList().stream().forEach(attributeGroupId -> {
|
||||
asCategoryAttributeGroupService.addByGroup(attributeGroupId,id);
|
||||
});
|
||||
}
|
||||
//添加新的关联数据(品类组表)
|
||||
if(null!=categoryInfoUpdReq.getBrandGroupIdList()){
|
||||
categoryInfoUpdReq.getBrandGroupIdList().stream().forEach(brandGroupId -> {
|
||||
asCategoryBrandService.addByGroup(brandGroupId,id);
|
||||
});
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result removeBatchById(Long ids) {
|
||||
//查询是否有子级
|
||||
//qw是plus的条件构造器,lqw是lambda表达式
|
||||
QueryWrapper<CategoryInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("parent_id",ids);
|
||||
List<CategoryInfo> list = categoryInfoMapper.selectList(queryWrapper);
|
||||
if(0==list.size()){
|
||||
//是否有商品关联关系
|
||||
List<ProjectInfo> list1= categoryInfoMapper.selectProjectInfoById(ids);
|
||||
if(0==list1.size()){
|
||||
//删除
|
||||
categoryInfoMapper.delete(new LambdaQueryWrapper<CategoryInfo>().eq(CategoryInfo::getId,ids));
|
||||
return Result.success("删除成功");
|
||||
}
|
||||
return Result.error("有商品关联关系,不能删除");
|
||||
}
|
||||
return Result.error("有子集,不能删除");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过品类ID获取父级以上的属性、属性组、品牌集合
|
||||
*
|
||||
|
|
|
@ -64,4 +64,5 @@ public class RuleAttrInfoServiceImpl extends ServiceImpl<RuleAttrInfoMapper, Rul
|
|||
queryWrapper.eq(RuleAttrInfo::getRuleId, ruleId);
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
|
@ -15,8 +16,11 @@ import com.muyu.common.security.utils.SecurityUtils;
|
|||
import com.muyu.product.domain.RuleAttrInfo;
|
||||
import com.muyu.product.domain.model.RuleAttrAddModel;
|
||||
import com.muyu.product.domain.model.RuleInfoAddModel;
|
||||
import com.muyu.product.domain.req.RuleInfoEditReq;
|
||||
import com.muyu.product.domain.req.RuleInfoQueryReq;
|
||||
import com.muyu.product.domain.req.RuleInfoUpdReq;
|
||||
import com.muyu.product.domain.resp.RuleInfoResp;
|
||||
import com.muyu.product.domain.resp.RuleInfoUpdResp;
|
||||
import com.muyu.product.service.RuleAttrInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -26,6 +30,9 @@ import com.muyu.product.domain.RuleInfo;
|
|||
import com.muyu.product.service.RuleInfoService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 商品规格Service业务层处理
|
||||
|
@ -39,6 +46,8 @@ public class RuleInfoServiceImpl extends ServiceImpl<RuleInfoMapper, RuleInfo>
|
|||
|
||||
@Autowired
|
||||
private RuleAttrInfoService ruleAttrInfoService;
|
||||
@Resource
|
||||
private RuleInfoMapper ruleInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询商品规格列表
|
||||
|
@ -107,4 +116,51 @@ public class RuleInfoServiceImpl extends ServiceImpl<RuleInfoMapper, RuleInfo>
|
|||
.total(isPage ? new PageInfo<>(list).getTotal() : 0)
|
||||
.build();
|
||||
}
|
||||
/**
|
||||
* 规格id查询根据id
|
||||
*/
|
||||
@Override
|
||||
public RuleInfoUpdResp selectById(Long id) {
|
||||
//获取id
|
||||
RuleInfo ruleInfo = this.getById(id);
|
||||
LambdaQueryWrapper<RuleAttrInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(RuleAttrInfo::getRuleId,id);
|
||||
|
||||
List<RuleAttrInfo> ruleAttrInfoList = ruleAttrInfoService.list(queryWrapper);
|
||||
|
||||
return RuleInfoUpdResp.builder()
|
||||
.id(ruleInfo.getId())
|
||||
.name(ruleInfo.getName())
|
||||
.remark(ruleInfo.getRemark())
|
||||
.ruleAttrList(ruleAttrInfoList.stream().map(RuleAttrAddModel::infoBuild).toList())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateById(Long id, RuleInfoEditReq ruleInfoEditReq) {
|
||||
//获取id
|
||||
boolean update = this.updateById(RuleInfo.editBuild(id,ruleInfoEditReq));
|
||||
//进行修改
|
||||
//判断是否修改 是则删除否则不删除
|
||||
if(update){
|
||||
LambdaQueryWrapper<RuleAttrInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(RuleAttrInfo::getRuleId,id);
|
||||
//根据id删除
|
||||
this.ruleAttrInfoService.remove(queryWrapper);
|
||||
//删除后再添加
|
||||
ruleAttrInfoService.saveBatch(
|
||||
ruleInfoEditReq.getRuleAttrList().stream()
|
||||
.map(ruleAttrAddModel -> RuleAttrInfo.addModelBuild(ruleAttrAddModel,
|
||||
() -> id, SecurityUtils::getUsername))
|
||||
.toList()
|
||||
);
|
||||
}
|
||||
return update;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -18,4 +18,23 @@
|
|||
<sql id="selectAsAttributeGroupVo">
|
||||
select id, group_id, attribute_id, remark, create_by, create_time, update_by, update_time from as_attribute_group
|
||||
</sql>
|
||||
<insert id="addByGroup">
|
||||
insert into as_attribute_group(group_id, attribute_id)
|
||||
values (#{id}, #{id1})
|
||||
</insert>
|
||||
<update id="updateAttributeById">
|
||||
update attribute_group
|
||||
<set>
|
||||
<if test="name != null and name != ''">
|
||||
name = #{name},
|
||||
</if>
|
||||
<if test="states != null and states != ''">
|
||||
states = #{states},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="deleteAsAttributeGroup">
|
||||
delete from as_attribute_group where group_id = #{id}
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
|
@ -18,4 +18,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<sql id="selectAsCategoryAttributeGroupVo">
|
||||
select id, category_id, attribute_group_id, remark, create_by, create_time, update_by, update_time from as_category_attribute_group
|
||||
</sql>
|
||||
<insert id="add">
|
||||
insert into as_category_attribute_group(category_id, attribute_group_id)
|
||||
values(#{categoryId},#{attributeGroupId})
|
||||
</insert>
|
||||
</mapper>
|
||||
|
|
|
@ -18,4 +18,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<sql id="selectAsCategoryAttributeVo">
|
||||
select id, category_id, attribute_id, remark, create_by, create_time, update_by, update_time from as_category_attribute
|
||||
</sql>
|
||||
<insert id="add">
|
||||
insert into as_category_attribute(category_id, attribute_id)
|
||||
values(#{id},#{attributeId})
|
||||
</insert>
|
||||
</mapper>
|
||||
|
|
|
@ -18,4 +18,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<sql id="selectAsCategoryBrandVo">
|
||||
select id, category_id, brand_id, remark, create_by, create_time, update_by, update_time from as_category_brand
|
||||
</sql>
|
||||
<insert id="add">
|
||||
insert into as_category_brand(category_id, brand_id, create_by, create_time, update_by, update_time)
|
||||
values(#{categoryId}, #{brandId}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime})
|
||||
</insert>
|
||||
</mapper>
|
||||
|
|
|
@ -21,4 +21,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<sql id="selectCategoryInfoVo">
|
||||
select id, name, image, parent_id, start, introduction, remark, create_by, create_time, update_by, update_time from category_info
|
||||
</sql>
|
||||
<update id="updateById">
|
||||
update category_info set name = #{categoryInfoUpdReq.name},image = #{categoryInfoUpdReq.image},start = #{categoryInfoUpdReq.start},introduction = #{categoryInfoUpdReq.introduction}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<select id="selectProjectInfoById" resultType="com.muyu.product.domain.ProjectInfo">
|
||||
select * from project_info where parent_type = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue