This commit is contained in:
2026-08-28 23:01:52 +08:00
parent 969ff05815
commit da32a67d7f
107 changed files with 465 additions and 271 deletions
@@ -1,9 +0,0 @@
package com.baiyue.lastleg.inventory;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@MapperScan("com.baiyue.lastleg.inventory.mapper")
public class InventoryMapperConfiguration {
}
@@ -1,9 +0,0 @@
package com.baiyue.lastleg.inventory.command;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@MapperScan("com.baiyue.lastleg.inventory.command.mapper")
public class InventoryCommandMapperConfiguration {
}
@@ -1,5 +1,7 @@
package com.baiyue.lastleg.inventory.mapper;
import org.apache.ibatis.annotations.Mapper;
import com.baiyue.lastleg.inventory.entity.InventoryBalance;
import com.baiyue.lastleg.inventory.model.InventorySummary;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -10,6 +12,7 @@ import org.apache.ibatis.annotations.Update;
import java.time.LocalDateTime;
import java.util.List;
@Mapper
public interface InventoryBalanceMapper extends BaseMapper<InventoryBalance> {
@Select("SELECT * FROM ll_inventory_balance WHERE customer_id=#{customerId} " +
"AND overseas_warehouse_id=#{overseasWarehouseId} " +
@@ -1,5 +1,7 @@
package com.baiyue.lastleg.inventory.mapper;
import org.apache.ibatis.annotations.Mapper;
import com.baiyue.lastleg.inventory.entity.InventoryLedger;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@@ -8,6 +10,7 @@ import org.apache.ibatis.annotations.Select;
import java.time.LocalDateTime;
import java.util.List;
@Mapper
public interface InventoryLedgerMapper extends BaseMapper<InventoryLedger> {
@Select("SELECT * FROM ll_inventory_ledger WHERE customer_id=#{customerId} AND idempotency_key=#{idempotencyKey} LIMIT 1")
InventoryLedger findIdempotency(@Param("customerId") String customerId,
@@ -1,10 +1,13 @@
package com.baiyue.lastleg.inventory.mapper;
import org.apache.ibatis.annotations.Mapper;
import com.baiyue.lastleg.inventory.entity.InventoryOperation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface InventoryOperationMapper extends BaseMapper<InventoryOperation> {
@Select("SELECT * FROM ll_inventory_operation WHERE customer_id=#{customerId} AND idempotency_key=#{idempotencyKey} LIMIT 1")
InventoryOperation findIdempotency(@Param("customerId") String customerId,
@@ -1,5 +1,7 @@
package com.baiyue.lastleg.inventory.mapper;
import org.apache.ibatis.annotations.Mapper;
import com.baiyue.lastleg.inventory.entity.InventoryPosition;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@@ -7,6 +9,7 @@ import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface InventoryPositionMapper extends BaseMapper<InventoryPosition> {
@Select("SELECT p.* FROM ll_inventory_position p JOIN ll_inventory_balance b ON b.id=p.balance_id " +
"WHERE b.customer_id=#{customerId} AND p.balance_id=#{balanceId} ORDER BY p.pallet_no,p.batch_no")
@@ -1,9 +0,0 @@
package com.baiyue.lastleg.inventory.query;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@MapperScan("com.baiyue.lastleg.inventory.query.mapper")
public class InventoryQueryMapperConfiguration {
}
@@ -1,5 +1,7 @@
package com.baiyue.lastleg.inventory.query.mapper;
import org.apache.ibatis.annotations.Mapper;
import com.baiyue.lastleg.inventory.entity.InventoryBalance;
import com.baiyue.lastleg.inventory.entity.InventoryLedger;
import com.baiyue.lastleg.inventory.entity.InventoryPosition;
@@ -10,6 +12,7 @@ import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface InventoryQueryMapper {
String BALANCE_FILTER = " WHERE 1=1" +
"<if test='customerId != null and customerId != \"\"'> AND customer_id=#{customerId}</if>" +