删除排序

master
WeiRan 2024-09-02 10:34:58 +08:00
parent 37a55ab05a
commit e98f19362d
5 changed files with 41 additions and 41 deletions

View File

@ -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));
}
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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>