luqingyang
2023-10-23 5da448b87908d16ac007efedbb7b1a0ab1cb372a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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<BaseCategory> getByCategoryId(Long categoryId) {
        StringBuilder sql = new StringBuilder("SELECT * FROM base_goods_template WHERE 1 = 1 ");
        HashMap<String, Object> 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());
    }
}