ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/query/VipShoppingOrderQuery.java
@@ -10,6 +10,8 @@ @Data @ApiModel(value = "ChargingOrderQuery对象",description = "管理后台充电订单查询对象") public class VipShoppingOrderQuery extends BasePage { @ApiModelProperty(value = "订单ids") private List<Long> ids; @ApiModelProperty(value = "手机号") private String phone; @ApiModelProperty(value = "会员时长(1=月卡,2=季卡,3=年卡)") ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TVipOrderMapper.xml
@@ -29,6 +29,12 @@ select t1.* from t_vip_order t1 where 1=1 <if test="null != req.ids and req.ids.size()>0"> and t1.id in <foreach collection="req.ids" item="item" separator="," open="(" close=")"> #{item} </foreach> </if> <if test="null != req.userIds and req.userIds.size()>0" > and t1.app_user_id in <foreach collection="req.userIds" item="item" index="index" separator="," open="(" close=")"> ruoyi-service/ruoyi-order/src/test/java/com/ruoyi/order/mapper/VipOrderSelectedExportMapperTest.java
New file @@ -0,0 +1,31 @@ package com.ruoyi.order.mapper; import org.junit.jupiter.api.Test; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.stream.Collectors; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; class VipOrderSelectedExportMapperTest { @Test void filtersVipOrdersBySelectedIds() throws IOException { InputStream input = getClass().getClassLoader() .getResourceAsStream("mapper/order/TVipOrderMapper.xml"); assertNotNull(input); String mapper; try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8))) { mapper = reader.lines().collect(Collectors.joining("\n")); } assertTrue(mapper.contains("null != req.ids and req.ids.size()>0")); assertTrue(mapper.contains("<foreach collection=\"req.ids\"")); } }