liyong
5 天以前 536774eea8902efc088c5b904ff75bbe0af33418
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
38
39
40
41
42
43
44
45
46
47
48
49
50
package cn.iocoder.yudao.module.mdm.dal.mysql.brand;
 
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.mdm.controller.admin.brand.vo.MdmBrandPageReqVO;
import cn.iocoder.yudao.module.mdm.dal.dataobject.brand.MdmBrandDO;
import org.apache.ibatis.annotations.Mapper;
 
import java.util.Collection;
import java.util.List;
 
/**
 * MDM 品牌 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface MdmBrandMapper extends BaseMapperX<MdmBrandDO> {
 
    default PageResult<MdmBrandDO> selectPage(MdmBrandPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MdmBrandDO>()
                .likeIfPresent(MdmBrandDO::getCode, reqVO.getCode())
                .likeIfPresent(MdmBrandDO::getName, reqVO.getName())
                .eqIfPresent(MdmBrandDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(MdmBrandDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MdmBrandDO::getId));
    }
 
    default List<MdmBrandDO> selectList(MdmBrandDO reqVO) {
        return selectList(new LambdaQueryWrapperX<MdmBrandDO>()
                .likeIfPresent(MdmBrandDO::getCode, reqVO.getCode())
                .likeIfPresent(MdmBrandDO::getName, reqVO.getName())
                .eqIfPresent(MdmBrandDO::getStatus, reqVO.getStatus())
                .orderByDesc(MdmBrandDO::getId));
    }
 
    default MdmBrandDO selectByCode(String code) {
        return selectOne(MdmBrandDO::getCode, code);
    }
 
    default MdmBrandDO selectByName(String name) {
        return selectOne(MdmBrandDO::getName, name);
    }
 
    default List<MdmBrandDO> selectListByIds(Collection<Long> ids) {
        return selectList(MdmBrandDO::getId, ids);
    }
 
}