删除排序
parent
37a55ab05a
commit
e98f19362d
|
@ -170,5 +170,16 @@ public class ApiManageController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取不同规格对应的价格
|
||||
* @param productId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getprice/{productId}")
|
||||
@Operation(summary = "获取不同规格对应的价格",description = "获取不同规格对应的价格")
|
||||
public Result getprice(@Validated @PathVariable Integer productId){
|
||||
return Result.success(apiManageService.getprice(productId));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.muyu.cloud.background.domin.Specification;
|
|||
import com.muyu.cloud.background.domin.req.ProductAddReq;
|
||||
import com.muyu.cloud.background.domin.req.ProductUpdReq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -38,12 +39,9 @@ public interface ApiManageMapper extends BaseMapper<Product> {
|
|||
@Select("select * from product_specification")
|
||||
List<Specification> findspecification();
|
||||
|
||||
// void insertmiddle(ProductAddReq productAddReq, Specification specification);
|
||||
//
|
||||
// void insertmiddle1(ProductAddReq productAddReq, Specification specification);
|
||||
//
|
||||
// void insertmiddle2(ProductAddReq productAddReq, Specification specification);
|
||||
// void insertmiddle3(ProductAddReq productAddReq, Specification specification);
|
||||
|
||||
void insertMiddle(MiddleTableEntity middleEntity);
|
||||
|
||||
|
||||
List<MiddleTableEntity> getprice(@Param("productId") Integer productId);
|
||||
}
|
||||
|
|
|
@ -52,10 +52,14 @@ public interface ApiManageService extends IService<Product> {
|
|||
|
||||
/**
|
||||
* 添加中间表
|
||||
* @param specificationList
|
||||
* @param productAddReq
|
||||
* @param middleEntity
|
||||
*/
|
||||
void insertmiddle(List<Specification> specificationList, ProductAddReq productAddReq);
|
||||
|
||||
void insertMiddle(MiddleTableEntity middleEntity);
|
||||
|
||||
/**
|
||||
* 获取不同规格对应的价格
|
||||
* @param productId
|
||||
* @return
|
||||
*/
|
||||
List<MiddleTableEntity> getprice(Integer productId);
|
||||
}
|
||||
|
|
|
@ -93,22 +93,23 @@ public class ApiManageServiceImpl extends ServiceImpl<ApiManageMapper, Product>
|
|||
|
||||
/**
|
||||
* 添加中间表
|
||||
* @param specificationList
|
||||
* @param productAddReq
|
||||
* @param middleEntity
|
||||
*/
|
||||
@Override
|
||||
public void insertmiddle(List<Specification> specificationList, ProductAddReq productAddReq) {
|
||||
// apiManageMapper.insertmiddle(productAddReq, specificationList.get(0));
|
||||
// apiManageMapper.insertmiddle1(productAddReq, specificationList.get(1));
|
||||
// apiManageMapper.insertmiddle2(productAddReq, specificationList.get(2));
|
||||
// apiManageMapper.insertmiddle3(productAddReq, specificationList.get(3));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertMiddle(MiddleTableEntity middleEntity) {
|
||||
apiManageMapper.insertMiddle(middleEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取不同规格对应的价格
|
||||
* @param productId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MiddleTableEntity> getprice(Integer productId) {
|
||||
return apiManageMapper.getprice(productId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,12 @@
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.muyu.cloud.background.mapper.ApiManageMapper">
|
||||
|
||||
<select id="getprice" resultType="com.muyu.cloud.background.domin.MiddleTableEntity">
|
||||
SELECT * from middle_specification_product where middle_product=#{productId}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertMiddle">
|
||||
INSERT INTO `h6_cloud_server`.`middle_specification_product`
|
||||
(`middle_id`, `middle_product`, `middle_specification`, `middle_price`) VALUES
|
||||
|
@ -16,25 +22,5 @@
|
|||
update product set product_state=#{productState} where product_id=#{productId}
|
||||
</update>
|
||||
|
||||
<!-- <insert id="insertmiddle" parameterType="map">-->
|
||||
<!-- INSERT INTO `h6_cloud_server`.`middle_specification_product`-->
|
||||
<!-- (`middle_id`, `middle_product`, `middle_specification`, `middle_price`) VALUES-->
|
||||
<!-- (0, #{productAddReq.productId},#{specification.productSpecificationId}, #{productAddReq.productId.timemoney})-->
|
||||
<!-- </insert>-->
|
||||
<!-- <insert id="insertmiddle1">-->
|
||||
<!-- INSERT INTO `h6_cloud_server`.`middle_specification_product`-->
|
||||
<!-- (`middle_id`, `middle_product`, `middle_specification`, `middle_price`) VALUES-->
|
||||
<!-- (0, #{productAddReq.productId},#{specification.productSpecificationId}, #{productAddReq.daymoney})-->
|
||||
<!-- </insert>-->
|
||||
<!-- <insert id="insertmiddle2">-->
|
||||
<!-- INSERT INTO `h6_cloud_server`.`middle_specification_product`-->
|
||||
<!-- (`middle_id`, `middle_product`, `middle_specification`, `middle_price`) VALUES-->
|
||||
<!-- (0, #{productAddReq.productId},#{specification.productSpecificationId}, #{productAddReq.monthmoney})-->
|
||||
<!-- </insert>-->
|
||||
|
||||
<!-- <insert id="insertmiddle3">-->
|
||||
<!-- INSERT INTO `h6_cloud_server`.`middle_specification_product`-->
|
||||
<!-- (`middle_id`, `middle_product`, `middle_specification`, `middle_price`) VALUES-->
|
||||
<!-- (0, #{productAddReq.productId},#{specification.productSpecificationId}, #{productAddReq.yearmoney})-->
|
||||
<!-- </insert>-->
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue