package com.consum.base.service; import com.consum.model.po.BaseCategory; import com.walker.jdbc.service.BaseServiceImpl; import org.springframework.stereotype.Service; import java.util.HashMap; import java.util.List; /** * @Description 物品模板 * @Author 卢庆阳 * @Date 2023/10/23 */ @Service public class BaseGoodsTemplateServiceImpl extends BaseServiceImpl { /** * @Description 根据分类id和状态查询物品模版 * @Author 卢庆阳 * @Date 2023/10/23 * @return */ public List getByCategoryId(Long categoryId) { StringBuilder sql = new StringBuilder("SELECT * FROM base_goods_template WHERE 1 = 1 "); HashMap paramts = new HashMap<>(); //分类id if (categoryId != null) { sql.append(" and category_id =:category_id "); paramts.put("category_id", categoryId); } sql.append(" and states =1 "); return this.select(sql.toString(), paramts, new BaseCategory()); } }