| | |
| | | import com.consum.model.po.FinSysTenantDepartment; |
| | | import com.consum.model.po.SDictData; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public BaseWarehouse getWarehouseByAgencyId(Long agencyId, String warehouseName) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM base_warehouse WHERE STATES= 1"); |
| | | Map<String, Object> param = new HashMap<>(); |
| | | if (agencyId != null) { |
| | | sql.append(" and AGENCY_ID =:agencyId "); |
| | | param.put("agencyId", agencyId); |
| | | } |
| | | if (StringUtils.isNotEmpty(warehouseName)) { |
| | | sql.append(" and WAREHOUSE_NAME =:warehouseName "); |
| | | param.put("warehouseName", warehouseName); |
| | | } |
| | | sql.append(" limit 1"); |
| | | List<BaseWarehouse> select = select(sql.toString(), param, new BaseWarehouse()); |
| | | if (CollectionUtils.isEmpty(select)) { |
| | | return null; |
| | | } |
| | | return select.get(0); |
| | | } |
| | | } |