eight
2024-12-18 72e3d6bb6c90d4d917d27f3cc26346aece060caa
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
51
52
53
54
package cn.lihu.jh.module.ecg.dal.mysql.devmanage;
 
import java.util.*;
 
import cn.lihu.jh.framework.common.pojo.PageResult;
import cn.lihu.jh.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.lihu.jh.framework.mybatis.core.mapper.BaseMapperX;
import cn.lihu.jh.module.ecg.dal.dataobject.devmanage.DevModelDO;
import org.apache.ibatis.annotations.Mapper;
import cn.lihu.jh.module.ecg.controller.admin.devmanage.vo.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
/**
 * 设备型号 Mapper
 *
 * @author majianbo
 */
@Mapper
public interface DevModelMapper extends BaseMapperX<DevModelDO> {
 
    default PageResult<DevModelDO> selectPage(DevModelPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DevModelDO>()
                .eqIfPresent(DevModelDO::getCategory, reqVO.getCategory())
                .eqIfPresent(DevModelDO::getBrand, reqVO.getBrand())
                .eqIfPresent(DevModelDO::getModel, reqVO.getModel())
                .betweenIfPresent(DevModelDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DevModelDO::getId));
    }
 
    @Select("<script> " +
            " select distinct brand from lihu.device_model " +
            " <where> deleted = 0 " +
            "   <if test=\"category != null and category != ''\"> " +
            "     and category = #{category} " +
            "   </if> " +
            " </where> " +
            "</script>")
    List<String> getBrandByCategory(@Param("category") String category);
 
    @Select("<script> " +
            " select distinct brand from lihu.device_model " +
            " <where> deleted = 0 " +
            "   <if test=\"category != null and category != ''\"> " +
            "     and category = #{category} " +
            "   </if> " +
            "   <if test=\"brand != null and brand != ''\"> " +
            "     and brand = #{brand} " +
            "   </if> " +
            " </where> " +
            "</script>")
    List<String> getModelByCategoryBrand(@Param("category") String category, @Param("brand") String brand);
 
}