| | |
| | | import com.consum.base.core.utils.MapperUtil; |
| | | import com.consum.base.pojo.query.WhWarningConfigQry; |
| | | 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.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | private Map<String, Object> getConfigListQueryMap(WhWarningConfigQry param) { |
| | | Map<String, Object> configListQueryMap = new HashMap<>(); |
| | | StringBuilder sql = new StringBuilder(GET_CONFIG_LIST_WITH_PAGE); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | //机构 |
| | | if (param.getAgencyId() != null) { |
| | | sql.append(" and left(ware.AGENCY_ID, length(:lengthAgencyId)) = :agencyId"); |
| | | paramts.put("lengthAgencyId", param.getAgencyId()); |
| | | // sql.append(" and left(ware.AGENCY_ID, length(:lengthAgencyId)) = :agencyId"); |
| | | sql.append(" and ware.AGENCY_ID = :agencyId"); |
| | | // paramts.put("lengthAgencyId", param.getAgencyId()); |
| | | paramts.put("agencyId", param.getAgencyId()); |
| | | } |
| | | //仓库类型 |
| | |
| | | if (StringUtils.isNotEmpty(param.getGoodsTemplateName())) { |
| | | sql.append(" AND goodsTemp.GOODS_NAME like :goodsTemplateName"); |
| | | paramts.put("goodsTemplateName", StringUtils.CHAR_PERCENT + param.getGoodsTemplateName() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | if (param.getBaseGoodsTemplateId() != null) { |
| | | sql.append(" AND wareConf.BASE_GOODS_TEMPLATE_ID=:baseGoodsTemplateId"); |
| | | paramts.put("baseGoodsTemplateId", param.getBaseGoodsTemplateId()); |
| | | } |
| | | //分类 |
| | | if (param.getCategoryId() != null) { |
| | |
| | | return configListQueryMap; |
| | | } |
| | | |
| | | private String QUERY_MODEL_IS_EXIST = ""; |
| | | |
| | | public List<Map<String, Object>> queryModelIsExist(Integer warehouseType, Long baseWarehouseId, List<Long> modelIds) { |
| | | StringBuilder sql = new StringBuilder("select WAREHOUSE_TYPE, BASE_WAREHOUSE_ID, BASE_GOODS_MODELS_ID from WH_WARNING_CONFIG where 1=1"); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | |
| | | //仓库类型 |
| | | if (warehouseType != null) { |
| | | sql.append(" AND WAREHOUSE_TYPE = :warehouseType"); |
| | | paramts.put("warehouseType", warehouseType); |
| | | } |
| | | if (baseWarehouseId != null) { |
| | | sql.append(" AND BASE_WAREHOUSE_ID = :warehouseId"); |
| | | paramts.put("warehouseId", baseWarehouseId); |
| | | } |
| | | if (!CollectionUtils.isEmpty(modelIds)) { |
| | | sql.append(" AND BASE_GOODS_MODELS_ID in(:modelIds)"); |
| | | paramts.put("modelIds", org.apache.commons.lang3.StringUtils.join(modelIds, ",")); |
| | | } |
| | | return select(sql.toString(), paramts, new MapperUtil()); |
| | | } |
| | | |
| | | |
| | | } |