Commit 5bb29a3fa07209dd1d466ae21dc84e900686488e
1 parent
fdfca858
feat:【erp】优化对 pgsql 的兼容性,对应 https://t.zsxq.com/rM8Y1
Showing
7 changed files
with
14 additions
and
14 deletions
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/finance/ErpFinancePaymentItemMapper.java
| ... | ... | @@ -31,14 +31,14 @@ public interface ErpFinancePaymentItemMapper extends BaseMapperX<ErpFinancePayme |
| 31 | 31 | default BigDecimal selectPaymentPriceSumByBizIdAndBizType(Long bizId, Integer bizType) { |
| 32 | 32 | // SQL sum 查询 |
| 33 | 33 | List<Map<String, Object>> result = selectMaps(new QueryWrapper<ErpFinancePaymentItemDO>() |
| 34 | - .select("SUM(payment_price) AS paymentPriceSum") | |
| 34 | + .select("SUM(payment_price) AS payment_price_sum") | |
| 35 | 35 | .eq("biz_id", bizId) |
| 36 | 36 | .eq("biz_type", bizType)); |
| 37 | 37 | // 获得数量 |
| 38 | 38 | if (CollUtil.isEmpty(result)) { |
| 39 | 39 | return BigDecimal.ZERO; |
| 40 | 40 | } |
| 41 | - return BigDecimal.valueOf(MapUtil.getDouble(result.get(0), "paymentPriceSum", 0D)); | |
| 41 | + return BigDecimal.valueOf(MapUtil.getDouble(result.get(0), "payment_price_sum", 0D)); | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | } |
| 45 | 45 | \ No newline at end of file | ... | ... |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/finance/ErpFinanceReceiptItemMapper.java
| ... | ... | @@ -31,14 +31,14 @@ public interface ErpFinanceReceiptItemMapper extends BaseMapperX<ErpFinanceRecei |
| 31 | 31 | default BigDecimal selectReceiptPriceSumByBizIdAndBizType(Long bizId, Integer bizType) { |
| 32 | 32 | // SQL sum 查询 |
| 33 | 33 | List<Map<String, Object>> result = selectMaps(new QueryWrapper<ErpFinanceReceiptItemDO>() |
| 34 | - .select("SUM(receipt_price) AS receiptPriceSum") | |
| 34 | + .select("SUM(receipt_price) AS receipt_price_sum") | |
| 35 | 35 | .eq("biz_id", bizId) |
| 36 | 36 | .eq("biz_type", bizType)); |
| 37 | 37 | // 获得数量 |
| 38 | 38 | if (CollUtil.isEmpty(result)) { |
| 39 | 39 | return BigDecimal.ZERO; |
| 40 | 40 | } |
| 41 | - return BigDecimal.valueOf(MapUtil.getDouble(result.get(0), "receiptPriceSum", 0D)); | |
| 41 | + return BigDecimal.valueOf(MapUtil.getDouble(result.get(0), "receipt_price_sum", 0D)); | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | } |
| 45 | 45 | \ No newline at end of file | ... | ... |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/purchase/ErpPurchaseInItemMapper.java
| ... | ... | @@ -46,11 +46,11 @@ public interface ErpPurchaseInItemMapper extends BaseMapperX<ErpPurchaseInItemDO |
| 46 | 46 | } |
| 47 | 47 | // SQL sum 查询 |
| 48 | 48 | List<Map<String, Object>> result = selectMaps(new QueryWrapper<ErpPurchaseInItemDO>() |
| 49 | - .select("order_item_id, SUM(count) AS sumCount") | |
| 49 | + .select("order_item_id, SUM(count) AS sum_count") | |
| 50 | 50 | .groupBy("order_item_id") |
| 51 | 51 | .in("in_id", inIds)); |
| 52 | 52 | // 获得数量 |
| 53 | - return convertMap(result, obj -> (Long) obj.get("order_item_id"), obj -> (BigDecimal) obj.get("sumCount")); | |
| 53 | + return convertMap(result, obj -> (Long) obj.get("order_item_id"), obj -> (BigDecimal) obj.get("sum_count")); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | } |
| 57 | 57 | \ No newline at end of file | ... | ... |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/purchase/ErpPurchaseReturnItemMapper.java
| ... | ... | @@ -46,11 +46,11 @@ public interface ErpPurchaseReturnItemMapper extends BaseMapperX<ErpPurchaseRetu |
| 46 | 46 | } |
| 47 | 47 | // SQL sum 查询 |
| 48 | 48 | List<Map<String, Object>> result = selectMaps(new QueryWrapper<ErpPurchaseReturnItemDO>() |
| 49 | - .select("order_item_id, SUM(count) AS sumCount") | |
| 49 | + .select("order_item_id, SUM(count) AS sum_count") | |
| 50 | 50 | .groupBy("order_item_id") |
| 51 | 51 | .in("return_id", returnIds)); |
| 52 | 52 | // 获得数量 |
| 53 | - return convertMap(result, obj -> (Long) obj.get("order_item_id"), obj -> (BigDecimal) obj.get("sumCount")); | |
| 53 | + return convertMap(result, obj -> (Long) obj.get("order_item_id"), obj -> (BigDecimal) obj.get("sum_count")); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | } |
| 57 | 57 | \ No newline at end of file | ... | ... |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/sale/ErpSaleOutItemMapper.java
| ... | ... | @@ -46,11 +46,11 @@ public interface ErpSaleOutItemMapper extends BaseMapperX<ErpSaleOutItemDO> { |
| 46 | 46 | } |
| 47 | 47 | // SQL sum 查询 |
| 48 | 48 | List<Map<String, Object>> result = selectMaps(new QueryWrapper<ErpSaleOutItemDO>() |
| 49 | - .select("order_item_id, SUM(count) AS sumCount") | |
| 49 | + .select("order_item_id, SUM(count) AS sum_count") | |
| 50 | 50 | .groupBy("order_item_id") |
| 51 | 51 | .in("out_id", outIds)); |
| 52 | 52 | // 获得数量 |
| 53 | - return convertMap(result, obj -> (Long) obj.get("order_item_id"), obj -> (BigDecimal) obj.get("sumCount")); | |
| 53 | + return convertMap(result, obj -> (Long) obj.get("order_item_id"), obj -> (BigDecimal) obj.get("sum_count")); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | } |
| 57 | 57 | \ No newline at end of file | ... | ... |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/sale/ErpSaleReturnItemMapper.java
| ... | ... | @@ -46,11 +46,11 @@ public interface ErpSaleReturnItemMapper extends BaseMapperX<ErpSaleReturnItemDO |
| 46 | 46 | } |
| 47 | 47 | // SQL sum 查询 |
| 48 | 48 | List<Map<String, Object>> result = selectMaps(new QueryWrapper<ErpSaleReturnItemDO>() |
| 49 | - .select("order_item_id, SUM(count) AS sumCount") | |
| 49 | + .select("order_item_id, SUM(count) AS sum_count") | |
| 50 | 50 | .groupBy("order_item_id") |
| 51 | 51 | .in("return_id", returnIds)); |
| 52 | 52 | // 获得数量 |
| 53 | - return convertMap(result, obj -> (Long) obj.get("order_item_id"), obj -> (BigDecimal) obj.get("sumCount")); | |
| 53 | + return convertMap(result, obj -> (Long) obj.get("order_item_id"), obj -> (BigDecimal) obj.get("sum_count")); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | } |
| 57 | 57 | \ No newline at end of file | ... | ... |
yudao-module-erp/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/stock/ErpStockMapper.java
| ... | ... | @@ -52,13 +52,13 @@ public interface ErpStockMapper extends BaseMapperX<ErpStockDO> { |
| 52 | 52 | default BigDecimal selectSumByProductId(Long productId) { |
| 53 | 53 | // SQL sum 查询 |
| 54 | 54 | List<Map<String, Object>> result = selectMaps(new QueryWrapper<ErpStockDO>() |
| 55 | - .select("SUM(count) AS sumCount") | |
| 55 | + .select("SUM(count) AS sum_count") | |
| 56 | 56 | .eq("product_id", productId)); |
| 57 | 57 | // 获得数量 |
| 58 | 58 | if (CollUtil.isEmpty(result)) { |
| 59 | 59 | return BigDecimal.ZERO; |
| 60 | 60 | } |
| 61 | - return BigDecimal.valueOf(MapUtil.getDouble(result.get(0), "sumCount", 0D)); | |
| 61 | + return BigDecimal.valueOf(MapUtil.getDouble(result.get(0), "sum_count", 0D)); | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | } |
| 65 | 65 | \ No newline at end of file | ... | ... |