云
2026-10-29 0a2206a53d5889b6095f4819c263be858d86ca91
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package cn.iocoder.yudao.module.mes.service.wm.productsales;
 
import cn.iocoder.yudao.module.mes.dal.mysql.wm.productsales.MesWmProductSalesDetailMapper;
import net.sf.jsqlparser.parser.CCJSqlParserUtil;
import org.apache.ibatis.annotations.Select;
import org.junit.jupiter.api.Test;
 
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 
class SalesBatchQueryParserTest {
    @Test void shipmentBatchQueryCanBeParsedByMybatisInterceptor() throws Exception {
        String sql = String.join("", MesWmProductSalesDetailMapper.class
                .getMethod("countFinishedSaleBatch", Long.class, Long.class, Long.class, Integer.class)
                .getAnnotation(Select.class).value()).replaceAll("#\\{[^}]+}", "?");
        assertDoesNotThrow(() -> CCJSqlParserUtil.parse(sql));
    }
}