| | |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import java.util.Collections; |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | |
| | |
| | | |
| | | // 分类id |
| | | if (categoryId != null) { |
| | | sql.append(" and category_id =:category_id "); |
| | | paramts.put("category_id", categoryId); |
| | | sql.append(" and category_id =:categoryId "); |
| | | paramts.put("categoryId", categoryId); |
| | | } |
| | | sql.append(" and states =1 "); |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public BaseGoodsTemplate getByGoodsNameAndCategoryId(String goodsName, Long categoryId) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM base_goods_template WHERE 1 = 1 "); |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM base_goods_template WHERE STATES != 3 "); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | |
| | | // 物品名称 |
| | |
| | | * @return |
| | | */ |
| | | |
| | | private static String QUERY_GOODSINFO_BY_MODELID = |
| | | private static final String QUERY_GOODSINFO_BY_MODELID = |
| | | "SELECT model.MODEL_NAME modelName,model.UNIT,temp.id goodsId, temp.GOODS_CODE goodsCode,temp.GOODS_NAME goodsName,temp.CLASSIFICATION classification,temp.CATEGORY_ID categoryId FROM BASE_GOODS_MODELS model LEFT JOIN BASE_GOODS_TEMPLATE temp ON model.GOODS_TEMPLATES_ID=temp.id WHERE 1=1 "; |
| | | |
| | | @Override |
| | |
| | | } |
| | | List<Map<String, Object>> tempGoodsInfo = this.select(sqlStr.toString(), params); |
| | | if (CollectionUtils.isEmpty(tempGoodsInfo)) { |
| | | return null; |
| | | return Collections.emptyMap(); |
| | | } |
| | | return tempGoodsInfo.get(0); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<BaseGoodsTemplate> queryGoodsTemplateByCategoryId(Long agencyId, Long categoryId, Short states, |
| | | public List<BaseGoodsTemplate> queryGoodsTemplateByCategoryId(Long agencyId, Long categoryId, Integer states, |
| | | String goodsName) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM base_goods_template WHERE 1=1 "); |
| | | Map<String, Object> params = new HashMap<>(); |