master
33442 2024-11-16 09:10:49 +08:00
parent 9a4b7cb8cb
commit 5fef221d30
33 changed files with 233 additions and 6 deletions

View File

@ -84,6 +84,8 @@
<artifactId>muyu-common-core</artifactId> <artifactId>muyu-common-core</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -30,6 +30,7 @@ import java.util.List;
@RestController @RestController
@RequestMapping("/job") @RequestMapping("/job")
public class SysJobController extends BaseController { public class SysJobController extends BaseController {
@Autowired @Autowired
private ISysJobService jobService; private ISysJobService jobService;

View File

@ -81,4 +81,9 @@ public class AttributeGroup extends BaseEntity {
.build(); .build();
} }
public static AttributeGroup edUpdBuild(Long id, String states) {
return AttributeGroup.builder()
.id(id)
.states(states).build();
}
} }

View File

@ -98,4 +98,10 @@ public class RuleInfo extends BaseEntity {
.createTime(new Date()) .createTime(new Date())
.build(); .build();
} }
public static RuleInfo editUpdRuleStatusBuild(Long id, String status) {
return RuleInfo.builder()
.id(id)
.status(status).build();
}
} }

View File

@ -0,0 +1,56 @@
package com.muyu.product.domain.resp;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CategoryInfoUpdReq {
/** 主键 */
@ApiModelProperty(name = "主键", value = "主键")
private Long id;
/** 品类名称 */
@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> attributeInfoList;
/**
* ID
*/
private List<Long> attributeGroupList;
/**
* ID
*/
private List<Long> brandInfoList;
}

View File

@ -32,6 +32,8 @@ public class RuleInfoResp extends BaseEntity {
/** 规格状态 */ /** 规格状态 */
private String status; private String status;
private Boolean flan=false;
/** /**
* *
*/ */

View File

@ -19,5 +19,4 @@ public class MuYuProductApplication {
public static void main (String[] args) { public static void main (String[] args) {
SpringApplication.run(MuYuProductApplication.class, args); SpringApplication.run(MuYuProductApplication.class, args);
} }
} }

View File

@ -117,4 +117,17 @@ public class AttributeGroupController extends BaseController {
} }
/**
*
*
* @return
*/
@RequiresPermissions("product:attributeGroup:edit")
@Log(title = "状态", businessType = BusinessType.UPDATE)
@ApiOperation("修改属性状态")
@PutMapping("/{id}/{states}")
public Result<String> updStatus(@PathVariable Long id, @PathVariable String states) {
return toAjax(attributeGroupService.updateById(AttributeGroup.edUpdBuild(id,states)));
}
} }

View File

@ -10,6 +10,7 @@ import com.muyu.product.domain.AttributeInfo;
import com.muyu.product.domain.BrandInfo; import com.muyu.product.domain.BrandInfo;
import com.muyu.product.domain.model.CategoryInfoSaveModel; import com.muyu.product.domain.model.CategoryInfoSaveModel;
import com.muyu.product.domain.resp.CategoryCommonElementResp; import com.muyu.product.domain.resp.CategoryCommonElementResp;
import com.muyu.product.domain.resp.CategoryInfoUpdReq;
import com.muyu.product.domain.resp.CategoryParentCommonElementResp; import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -112,8 +113,9 @@ public class CategoryInfoController extends BaseController {
@Log(title = "品类信息", businessType = BusinessType.UPDATE) @Log(title = "品类信息", businessType = BusinessType.UPDATE)
@PutMapping("/{id}") @PutMapping("/{id}")
@ApiOperation("修改品类信息") @ApiOperation("修改品类信息")
public Result<String> edit(@PathVariable Long id, @RequestBody CategoryInfoEditReq categoryInfoEditReq) { public Result<String> edit(@PathVariable Long id, @RequestBody CategoryInfoUpdReq categoryInfoUpdReq) {
return toAjax(categoryInfoService.updateById(CategoryInfo.editBuild(id,categoryInfoEditReq))); Boolean b= categoryInfoService.updCateId(id,categoryInfoUpdReq);
return toAjax(categoryInfoService.updateById(CategoryInfo.editBuild(id,categoryInfoUpdReq)));
} }
/** /**

View File

@ -116,4 +116,15 @@ public class RuleInfoController extends BaseController {
public Result<String> remove(@PathVariable List<Long> ids) { public Result<String> remove(@PathVariable List<Long> ids) {
return toAjax(ruleInfoService.removeBatchByIds(ids)); return toAjax(ruleInfoService.removeBatchByIds(ids));
} }
/**
*
*/
@RequiresPermissions("product:rule:edit")
@Log(title = "商品规格", businessType = BusinessType.UPDATE)
@PutMapping("/{id}/{status}")
@ApiOperation("修改商品规格状态")
public Result<String> updRuleStatus(@PathVariable Long id, @PathVariable String status) {
return toAjax(ruleInfoService.updateById(RuleInfo.editUpdRuleStatusBuild(id,status)));
}
} }

View File

@ -2,6 +2,7 @@ package com.muyu.product.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.AttributeGroup; import com.muyu.product.domain.AttributeGroup;
import com.muyu.product.domain.resp.AttributeGroupUpdResp;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
@ -13,4 +14,6 @@ public interface AsAttributeGroupInfoMapper{
void addAttributeInfo(@Param("id") Long id, @Param("ids") Long ids); void addAttributeInfo(@Param("id") Long id, @Param("ids") Long ids);
} }

View File

@ -3,6 +3,7 @@ package com.muyu.product.mapper;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.AsAttributeGroup; import com.muyu.product.domain.AsAttributeGroup;
import org.apache.ibatis.annotations.Param;
/** /**
* Mapper * Mapper
@ -12,4 +13,5 @@ import com.muyu.product.domain.AsAttributeGroup;
*/ */
public interface AsAttributeGroupMapper extends BaseMapper<AsAttributeGroup> { public interface AsAttributeGroupMapper extends BaseMapper<AsAttributeGroup> {
void addByCategory(@Param("id") Long id, @Param("attributeGroupId") Long attributeGroupId);
} }

View File

@ -12,4 +12,5 @@ import com.muyu.product.domain.AsCategoryAttributeGroup;
*/ */
public interface AsCategoryAttributeGroupMapper extends BaseMapper<AsCategoryAttributeGroup> { public interface AsCategoryAttributeGroupMapper extends BaseMapper<AsCategoryAttributeGroup> {
} }

View File

@ -12,4 +12,6 @@ import com.muyu.product.domain.AsCategoryAttribute;
*/ */
public interface AsCategoryAttributeMapper extends BaseMapper<AsCategoryAttribute> { public interface AsCategoryAttributeMapper extends BaseMapper<AsCategoryAttribute> {
void addByCategory(Long id, Long attributeId);
} }

View File

@ -12,4 +12,6 @@ import com.muyu.product.domain.AsCategoryBrand;
*/ */
public interface AsCategoryBrandMapper extends BaseMapper<AsCategoryBrand> { public interface AsCategoryBrandMapper extends BaseMapper<AsCategoryBrand> {
void addByCategory(Long id, Long brandId);
} }

View File

@ -3,6 +3,8 @@ package com.muyu.product.mapper;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.CategoryInfo; import com.muyu.product.domain.CategoryInfo;
import com.muyu.product.domain.resp.CategoryInfoUpdReq;
import org.apache.ibatis.annotations.Param;
/** /**
* Mapper * Mapper
@ -12,4 +14,5 @@ import com.muyu.product.domain.CategoryInfo;
*/ */
public interface CategoryInfoMapper extends BaseMapper<CategoryInfo> { public interface CategoryInfoMapper extends BaseMapper<CategoryInfo> {
Boolean updById(@Param("id") Long id, @Param("categoryInfoUpdReq") CategoryInfoUpdReq categoryInfoUpdReq);
} }

View File

@ -19,4 +19,6 @@ public interface AsCategoryAttributeGroupService extends IService<AsCategoryAttr
*/ */
public List<AsCategoryAttributeGroup> list(AsCategoryAttributeGroup asCategoryAttributeGroup); public List<AsCategoryAttributeGroup> list(AsCategoryAttributeGroup asCategoryAttributeGroup);
void addByCategory(Long id, Long attributeGroupId);
} }

View File

@ -19,4 +19,5 @@ public interface AsCategoryAttributeService extends IService<AsCategoryAttribute
*/ */
public List<AsCategoryAttribute> list(AsCategoryAttribute asCategoryAttribute); public List<AsCategoryAttribute> list(AsCategoryAttribute asCategoryAttribute);
void addByCategory(Long id, Long attributeId);
} }

View File

@ -19,4 +19,5 @@ public interface AsCategoryBrandService extends IService<AsCategoryBrand> {
*/ */
public List<AsCategoryBrand> list(AsCategoryBrand asCategoryBrand); public List<AsCategoryBrand> list(AsCategoryBrand asCategoryBrand);
void addByCategory(Long id, Long brandId);
} }

View File

@ -5,7 +5,6 @@ import java.util.List;
import com.muyu.common.core.web.page.TableDataInfo; import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.product.domain.AttributeGroup; import com.muyu.product.domain.AttributeGroup;
import com.baomidou.mybatisplus.extension.service.IService; 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.model.AttributeGroupSaveModel;
import com.muyu.product.domain.req.AttributeGroupEditReq; import com.muyu.product.domain.req.AttributeGroupEditReq;
import com.muyu.product.domain.resp.AttributeGroupPageResp; import com.muyu.product.domain.resp.AttributeGroupPageResp;
@ -49,4 +48,6 @@ public interface AttributeGroupService extends IService<AttributeGroup> {
AttributeGroupUpdResp getUpdById(Long id); AttributeGroupUpdResp getUpdById(Long id);
void updAttributeGroupInfo(Long id, AttributeGroupEditReq attributeGroupEditReq); void updAttributeGroupInfo(Long id, AttributeGroupEditReq attributeGroupEditReq);
} }

View File

@ -9,6 +9,7 @@ import com.muyu.product.domain.CategoryInfo;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.product.domain.model.CategoryInfoSaveModel; import com.muyu.product.domain.model.CategoryInfoSaveModel;
import com.muyu.product.domain.resp.CategoryCommonElementResp; import com.muyu.product.domain.resp.CategoryCommonElementResp;
import com.muyu.product.domain.resp.CategoryInfoUpdReq;
import com.muyu.product.domain.resp.CategoryParentCommonElementResp; import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
/** /**
@ -69,4 +70,6 @@ public interface CategoryInfoService extends IService<CategoryInfo> {
CategoryCommonElementResp getTemplateAttributeByCateGoryId (Long cateGoryId); CategoryCommonElementResp getTemplateAttributeByCateGoryId (Long cateGoryId);
public <T, AS> List<T> getCommon (Long categoryId, IService<AS> iService, IService<T> bsiService); public <T, AS> List<T> getCommon (Long categoryId, IService<AS> iService, IService<T> bsiService);
Boolean updCateId(Long id, CategoryInfoUpdReq categoryInfoUpdReq);
} }

View File

@ -3,7 +3,9 @@ package com.muyu.product.service.impl;
import java.util.List; import java.util.List;
import com.muyu.common.core.utils.ObjUtils; import com.muyu.common.core.utils.ObjUtils;
import com.muyu.product.mapper.AsAttributeGroupMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.muyu.product.mapper.AsCategoryAttributeGroupMapper; import com.muyu.product.mapper.AsCategoryAttributeGroupMapper;
import com.muyu.product.domain.AsCategoryAttributeGroup; import com.muyu.product.domain.AsCategoryAttributeGroup;
@ -21,6 +23,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@Service @Service
public class AsCategoryAttributeGroupServiceImpl extends ServiceImpl<AsCategoryAttributeGroupMapper, AsCategoryAttributeGroup> implements AsCategoryAttributeGroupService { public class AsCategoryAttributeGroupServiceImpl extends ServiceImpl<AsCategoryAttributeGroupMapper, AsCategoryAttributeGroup> implements AsCategoryAttributeGroupService {
@Autowired
private AsAttributeGroupMapper asAttributeGroupMapper;
/** /**
* *
* *
@ -46,4 +52,9 @@ public class AsCategoryAttributeGroupServiceImpl extends ServiceImpl<AsCategoryA
return list(queryWrapper); return list(queryWrapper);
} }
@Override
public void addByCategory(Long id, Long attributeGroupId) {
asAttributeGroupMapper.addByCategory(id,attributeGroupId);
}
} }

View File

@ -4,6 +4,7 @@ import java.util.List;
import com.muyu.common.core.utils.ObjUtils; import com.muyu.common.core.utils.ObjUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.muyu.product.mapper.AsCategoryAttributeMapper; import com.muyu.product.mapper.AsCategoryAttributeMapper;
import com.muyu.product.domain.AsCategoryAttribute; import com.muyu.product.domain.AsCategoryAttribute;
@ -21,6 +22,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@Service @Service
public class AsCategoryAttributeServiceImpl extends ServiceImpl<AsCategoryAttributeMapper, AsCategoryAttribute> implements AsCategoryAttributeService { public class AsCategoryAttributeServiceImpl extends ServiceImpl<AsCategoryAttributeMapper, AsCategoryAttribute> implements AsCategoryAttributeService {
@Autowired
private AsCategoryAttributeMapper asCategoryAttributeMapper;
/** /**
* *
* *
@ -46,4 +50,9 @@ public class AsCategoryAttributeServiceImpl extends ServiceImpl<AsCategoryAttrib
return list(queryWrapper); return list(queryWrapper);
} }
@Override
public void addByCategory(Long id, Long attributeId) {
asCategoryAttributeMapper.addByCategory(id,attributeId);
}
} }

View File

@ -4,6 +4,7 @@ import java.util.List;
import com.muyu.common.core.utils.ObjUtils; import com.muyu.common.core.utils.ObjUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.muyu.product.mapper.AsCategoryBrandMapper; import com.muyu.product.mapper.AsCategoryBrandMapper;
import com.muyu.product.domain.AsCategoryBrand; import com.muyu.product.domain.AsCategoryBrand;
@ -21,6 +22,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@Service @Service
public class AsCategoryBrandServiceImpl extends ServiceImpl<AsCategoryBrandMapper, AsCategoryBrand> implements AsCategoryBrandService { public class AsCategoryBrandServiceImpl extends ServiceImpl<AsCategoryBrandMapper, AsCategoryBrand> implements AsCategoryBrandService {
@Autowired
private AsCategoryBrandMapper asCategoryBrandMapper;
/** /**
* *
* *
@ -46,4 +50,9 @@ public class AsCategoryBrandServiceImpl extends ServiceImpl<AsCategoryBrandMappe
return list(queryWrapper); return list(queryWrapper);
} }
@Override
public void addByCategory(Long id, Long brandId) {
asCategoryBrandMapper.addByCategory(id,brandId);
}
} }

View File

@ -24,8 +24,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
import java.util.function.Function;
import java.util.stream.Stream;
/** /**
* Service * Service
@ -138,4 +136,8 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
asAttributeGroupInfoMapper.addAttributeInfo(id,attributeList.getId()); asAttributeGroupInfoMapper.addAttributeInfo(id,attributeList.getId());
} }
} }
} }

View File

@ -11,6 +11,7 @@ import com.muyu.product.domain.model.CategoryInfoSaveModel;
import com.muyu.product.domain.model.TemplateAttributeGroupModel; import com.muyu.product.domain.model.TemplateAttributeGroupModel;
import com.muyu.product.domain.model.TemplateAttributeModel; import com.muyu.product.domain.model.TemplateAttributeModel;
import com.muyu.product.domain.resp.CategoryCommonElementResp; import com.muyu.product.domain.resp.CategoryCommonElementResp;
import com.muyu.product.domain.resp.CategoryInfoUpdReq;
import com.muyu.product.domain.resp.CategoryParentCommonElementResp; import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
import com.muyu.product.mapper.CategoryInfoMapper; import com.muyu.product.mapper.CategoryInfoMapper;
import com.muyu.product.service.*; import com.muyu.product.service.*;
@ -37,6 +38,9 @@ import java.util.stream.Stream;
public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, CategoryInfo> implements CategoryInfoService { public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, CategoryInfo> implements CategoryInfoService {
@Autowired
private CategoryInfoMapper categoryInfoMapper;
@Autowired @Autowired
private AsCategoryAttributeService asCategoryAttributeService; private AsCategoryAttributeService asCategoryAttributeService;
@ -270,6 +274,36 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
return list; return list;
} }
@Override
public Boolean updCateId(Long id, CategoryInfoUpdReq categoryInfoUpdReq) {
Boolean b=categoryInfoMapper.updById(id,categoryInfoUpdReq);
asCategoryAttributeService.remove(new LambdaQueryWrapper<AsCategoryAttribute>().eq(AsCategoryAttribute::getCategoryId, id));
asCategoryBrandService.remove(new LambdaQueryWrapper<AsCategoryBrand>().eq(AsCategoryBrand::getCategoryId, id));
asCategoryAttributeGroupService.remove(new LambdaQueryWrapper<AsCategoryAttributeGroup>().eq(AsCategoryAttributeGroup::getCategoryId, id));
if(null!=categoryInfoUpdReq.getAttributeInfoList()){
categoryInfoUpdReq.getAttributeInfoList().stream().forEach(attributeId->{
asCategoryAttributeService.addByCategory(id,attributeId);
});
}
if(null!=categoryInfoUpdReq.getBrandInfoList()){
categoryInfoUpdReq.getBrandInfoList().stream().forEach(brandId->{
asCategoryBrandService.addByCategory(id,brandId);
});
}
if(null!=categoryInfoUpdReq.getAttributeGroupList()){
categoryInfoUpdReq.getAttributeGroupList().stream().forEach(attributeGroupId->{
asCategoryAttributeGroupService.addByCategory(id,attributeGroupId);
});
}
return b;
}
/** /**
* ID * ID
* *

View File

@ -12,6 +12,7 @@ import com.muyu.common.core.text.Convert;
import com.muyu.common.core.utils.ObjUtils; import com.muyu.common.core.utils.ObjUtils;
import com.muyu.common.core.web.page.TableDataInfo; import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.common.security.utils.SecurityUtils; import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.product.domain.ProjectInfo;
import com.muyu.product.domain.RuleAttrInfo; import com.muyu.product.domain.RuleAttrInfo;
import com.muyu.product.domain.model.RuleAttrAddModel; import com.muyu.product.domain.model.RuleAttrAddModel;
import com.muyu.product.domain.model.RuleInfoAddModel; import com.muyu.product.domain.model.RuleInfoAddModel;
@ -19,7 +20,9 @@ import com.muyu.product.domain.req.RuleInfoQueryReq;
import com.muyu.product.domain.resp.RuleInfoResp; import com.muyu.product.domain.resp.RuleInfoResp;
import com.muyu.product.domain.resp.RuleInfoUpdResp; import com.muyu.product.domain.resp.RuleInfoUpdResp;
import com.muyu.product.mapper.RuleInfoUpdMapper; import com.muyu.product.mapper.RuleInfoUpdMapper;
import com.muyu.product.service.ProjectInfoService;
import com.muyu.product.service.RuleAttrInfoService; import com.muyu.product.service.RuleAttrInfoService;
import io.jsonwebtoken.lang.Collections;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -45,6 +48,9 @@ public class RuleInfoServiceImpl extends ServiceImpl<RuleInfoMapper, RuleInfo>
@Autowired @Autowired
private RuleInfoUpdMapper ruleInfoUpdMapper; private RuleInfoUpdMapper ruleInfoUpdMapper;
@Autowired
private ProjectInfoService projectInfoService;
/** /**
* *
* *
@ -107,6 +113,17 @@ public class RuleInfoServiceImpl extends ServiceImpl<RuleInfoMapper, RuleInfo>
.toList(); .toList();
boolean isPage = ruleInfoQueryReq.getParams().get("isPage") == null || Convert.toBool(ruleInfoQueryReq.getParams().get("isPage"), true); boolean isPage = ruleInfoQueryReq.getParams().get("isPage") == null || Convert.toBool(ruleInfoQueryReq.getParams().get("isPage"), true);
ruleInfoRespList.forEach(ruleInfoResp -> {
LambdaQueryWrapper<ProjectInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ProjectInfo::getRuleId,ruleInfoResp.getId());
List<ProjectInfo> list1 = projectInfoService.list(lambdaQueryWrapper);
if(!Collections.isEmpty(list1)){
ruleInfoResp.setFlan(true);
}
});
return TableDataInfo.<RuleInfoResp>builder() return TableDataInfo.<RuleInfoResp>builder()
.rows(ruleInfoRespList) .rows(ruleInfoRespList)
.total(isPage ? new PageInfo<>(list).getTotal() : 0) .total(isPage ? new PageInfo<>(list).getTotal() : 0)

View File

@ -7,6 +7,7 @@
insert into as_attribute_group (group_id,attribute_id) values (#{id},#{ids}) insert into as_attribute_group (group_id,attribute_id) values (#{id},#{ids})
</insert> </insert>
<delete id="delAttributeInfo"> <delete id="delAttributeInfo">
delete from as_attribute_group where group_id=#{id} delete from as_attribute_group where group_id=#{id}
</delete> </delete>

View File

@ -18,4 +18,7 @@
<sql id="selectAsAttributeGroupVo"> <sql id="selectAsAttributeGroupVo">
select id, group_id, attribute_id, remark, create_by, create_time, update_by, update_time from as_attribute_group select id, group_id, attribute_id, remark, create_by, create_time, update_by, update_time from as_attribute_group
</sql> </sql>
<insert id="addByCategory">
insert into as_category_attribute_group (category_id,attribute_group_id) values (#{id},#{attributeGroupId})
</insert>
</mapper> </mapper>

View File

@ -18,4 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectAsCategoryAttributeVo"> <sql id="selectAsCategoryAttributeVo">
select id, category_id, attribute_id, remark, create_by, create_time, update_by, update_time from as_category_attribute select id, category_id, attribute_id, remark, create_by, create_time, update_by, update_time from as_category_attribute
</sql> </sql>
<insert id="addByCategory">
insert into as_category_attribute_group (category_id,attribute_id) values (#{id},#{attributeId})
</insert>
</mapper> </mapper>

View File

@ -18,4 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectAsCategoryBrandVo"> <sql id="selectAsCategoryBrandVo">
select id, category_id, brand_id, remark, create_by, create_time, update_by, update_time from as_category_brand select id, category_id, brand_id, remark, create_by, create_time, update_by, update_time from as_category_brand
</sql> </sql>
<insert id="addByCategory">
insert into as_category_attribute_group (category_id,brand_id) values (#{id},#{brandId})
</insert>
</mapper> </mapper>

View File

@ -21,4 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectCategoryInfoVo"> <sql id="selectCategoryInfoVo">
select id, name, image, parent_id, start, introduction, remark, create_by, create_time, update_by, update_time from category_info select id, name, image, parent_id, start, introduction, remark, create_by, create_time, update_by, update_time from category_info
</sql> </sql>
<update id="updById">
UPDATE category_info SET `name` = #{categoryInfoUpdReq.name},`start` =#{categoryInfoUpdReq.start}, `introduction` = #{categoryInfoUpdReq.introduction} WHERE `id` = #{id};
</update>
</mapper> </mapper>

View File

@ -0,0 +1,14 @@
<?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.RuleInfoUpdMapper">
<insert id="addRuleInfo">
insert into rule_attr_info (rule_id,name,attr_value,create_by,create_time,update_by,update_time) values (#{ruleId},#{name},#{join},"admin",now(),"admin",now())
</insert>
<delete id="delRuleInfo">
delete from rule_attr_info where rule_id=#{id}
</delete>
</mapper>