| | |
| | | } |
| | | int flag1 = this.update(baseGoodsTemplate); |
| | | //2.修改规格型号的单位 |
| | | // TODO id 物品型号修改待整理 |
| | | List<BaseGoodsModels> modelsList = param.getModels(); |
| | | for (BaseGoodsModels baseGoodsModel : modelsList) { |
| | | BaseGoodsModels baseGoodsModels = new BaseGoodsModels(); |
| | | BeanUtils.copyProperties(baseGoodsModel, baseGoodsModels); |
| | | } |
| | | int flag2 = this.update(modelsList); |
| | | |
| | | if (flag1 > 0 && flag2 > 0) { |
| | |
| | | return this.select(goodsTemplate); |
| | | } |
| | | |
| | | public List<BaseGoodsTemplate> queryByAgencyId(Long agencyId) { |
| | | public List<BaseGoodsTemplate> queryGoodsTemplateByCategoryId(Long agencyId, Long categoryId) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM base_goods_template WHERE 1=1 "); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | if (agencyId != null) { |
| | | sql.append(" AND model.id=:modelId"); |
| | | sql.append("AND AGENCY_ID=:agencyId"); |
| | | params.put("agencyId", agencyId); |
| | | } |
| | | if (categoryId != null) { |
| | | sql.append("AND CATEGORY_ID=:categoryId"); |
| | | params.put("categoryId", categoryId); |
| | | } |
| | | return this.select(sql.toString(), params, new BaseGoodsTemplate()); |
| | | } |
| | | } |