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,14 +31,14 @@ public interface ErpFinancePaymentItemMapper extends BaseMapperX<ErpFinancePayme | ||
| 31 | default BigDecimal selectPaymentPriceSumByBizIdAndBizType(Long bizId, Integer bizType) { | 31 | default BigDecimal selectPaymentPriceSumByBizIdAndBizType(Long bizId, Integer bizType) { |
| 32 | // SQL sum 查询 | 32 | // SQL sum 查询 |
| 33 | List<Map<String, Object>> result = selectMaps(new QueryWrapper<ErpFinancePaymentItemDO>() | 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 | .eq("biz_id", bizId) | 35 | .eq("biz_id", bizId) |
| 36 | .eq("biz_type", bizType)); | 36 | .eq("biz_type", bizType)); |
| 37 | // 获得数量 | 37 | // 获得数量 |
| 38 | if (CollUtil.isEmpty(result)) { | 38 | if (CollUtil.isEmpty(result)) { |
| 39 | return BigDecimal.ZERO; | 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 | \ No newline at end of file | 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,14 +31,14 @@ public interface ErpFinanceReceiptItemMapper extends BaseMapperX<ErpFinanceRecei | ||
| 31 | default BigDecimal selectReceiptPriceSumByBizIdAndBizType(Long bizId, Integer bizType) { | 31 | default BigDecimal selectReceiptPriceSumByBizIdAndBizType(Long bizId, Integer bizType) { |
| 32 | // SQL sum 查询 | 32 | // SQL sum 查询 |
| 33 | List<Map<String, Object>> result = selectMaps(new QueryWrapper<ErpFinanceReceiptItemDO>() | 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 | .eq("biz_id", bizId) | 35 | .eq("biz_id", bizId) |
| 36 | .eq("biz_type", bizType)); | 36 | .eq("biz_type", bizType)); |
| 37 | // 获得数量 | 37 | // 获得数量 |
| 38 | if (CollUtil.isEmpty(result)) { | 38 | if (CollUtil.isEmpty(result)) { |
| 39 | return BigDecimal.ZERO; | 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 | \ No newline at end of file | 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,11 +46,11 @@ public interface ErpPurchaseInItemMapper extends BaseMapperX<ErpPurchaseInItemDO | ||
| 46 | } | 46 | } |
| 47 | // SQL sum 查询 | 47 | // SQL sum 查询 |
| 48 | List<Map<String, Object>> result = selectMaps(new QueryWrapper<ErpPurchaseInItemDO>() | 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 | .groupBy("order_item_id") | 50 | .groupBy("order_item_id") |
| 51 | .in("in_id", inIds)); | 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 | \ No newline at end of file | 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,11 +46,11 @@ public interface ErpPurchaseReturnItemMapper extends BaseMapperX<ErpPurchaseRetu | ||
| 46 | } | 46 | } |
| 47 | // SQL sum 查询 | 47 | // SQL sum 查询 |
| 48 | List<Map<String, Object>> result = selectMaps(new QueryWrapper<ErpPurchaseReturnItemDO>() | 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 | .groupBy("order_item_id") | 50 | .groupBy("order_item_id") |
| 51 | .in("return_id", returnIds)); | 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 | \ No newline at end of file | 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,11 +46,11 @@ public interface ErpSaleOutItemMapper extends BaseMapperX<ErpSaleOutItemDO> { | ||
| 46 | } | 46 | } |
| 47 | // SQL sum 查询 | 47 | // SQL sum 查询 |
| 48 | List<Map<String, Object>> result = selectMaps(new QueryWrapper<ErpSaleOutItemDO>() | 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 | .groupBy("order_item_id") | 50 | .groupBy("order_item_id") |
| 51 | .in("out_id", outIds)); | 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 | \ No newline at end of file | 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,11 +46,11 @@ public interface ErpSaleReturnItemMapper extends BaseMapperX<ErpSaleReturnItemDO | ||
| 46 | } | 46 | } |
| 47 | // SQL sum 查询 | 47 | // SQL sum 查询 |
| 48 | List<Map<String, Object>> result = selectMaps(new QueryWrapper<ErpSaleReturnItemDO>() | 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 | .groupBy("order_item_id") | 50 | .groupBy("order_item_id") |
| 51 | .in("return_id", returnIds)); | 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 | \ No newline at end of file | 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,13 +52,13 @@ public interface ErpStockMapper extends BaseMapperX<ErpStockDO> { | ||
| 52 | default BigDecimal selectSumByProductId(Long productId) { | 52 | default BigDecimal selectSumByProductId(Long productId) { |
| 53 | // SQL sum 查询 | 53 | // SQL sum 查询 |
| 54 | List<Map<String, Object>> result = selectMaps(new QueryWrapper<ErpStockDO>() | 54 | List<Map<String, Object>> result = selectMaps(new QueryWrapper<ErpStockDO>() |
| 55 | - .select("SUM(count) AS sumCount") | 55 | + .select("SUM(count) AS sum_count") |
| 56 | .eq("product_id", productId)); | 56 | .eq("product_id", productId)); |
| 57 | // 获得数量 | 57 | // 获得数量 |
| 58 | if (CollUtil.isEmpty(result)) { | 58 | if (CollUtil.isEmpty(result)) { |
| 59 | return BigDecimal.ZERO; | 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 | \ No newline at end of file | 65 | \ No newline at end of file |