package com.fzzy.igds.sys.repository; import com.fzzy.igds.dzhwk.domain.DepotConf; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; /** * @Description * @Author CZT * @Date 2024/11/25 14:59 */ @Service public interface DepotConfRepository extends JpaRepository { /** * 根据组织编码获取仓库货位信息 * * @param companyId * @return */ @Query("from DepotConf where companyId =:companyId order by depotId") List getDepotConfByCompanyId(@Param("companyId") String companyId); /** * 根据组织编码和库区编码获取仓库货位信息 * * @param companyId * @param deptId * @return */ @Query("from DepotConf where companyId =:companyId and deptId =:deptId order by depotId") List getDepotConf(@Param("companyId") String companyId, @Param("deptId") String deptId); /** * 根据组织编码和仓库编码获取仓库货位信息 * @param companyId * @param depotId * @return */ @Query("from DepotConf where companyId =:companyId and depotId =:depotId") DepotConf getDepotConfByDepotId(@Param("companyId") String companyId, @Param("depotId") String depotId); @Transactional @Modifying @Query("update DepotConf set grainFreq=:grainFreq where companyId=:companyId and deptId =:deptId") int updateGrainFreq(@Param("grainFreq") String grainFreq, @Param("companyId") String companyId, @Param("deptId") String deptId); }