12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package com.zhentao.symptoms.service.impl;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
- import com.zhentao.symptoms.dto.SymptomsDto;
- import com.zhentao.symptoms.pojo.Symptoms;
- import com.zhentao.symptoms.service.SymptomsService;
- import com.zhentao.symptoms.mapper.SymptomsMapper;
- import com.zhentao.user.vo.ResultVo;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import java.util.List;
- /**
- * @author 王阳阳
- * @description 针对表【symptoms(症状信息表)】的数据库操作Service实现
- * @createDate 2025-05-25 20:49:10
- */
- @Service
- public class SymptomsServiceImpl extends ServiceImpl<SymptomsMapper, Symptoms>
- implements SymptomsService{
- @Autowired
- private SymptomsMapper symptomsMapper;
- @Override
- public ResultVo findAll(SymptomsDto dto) {
- // QueryWrapper<Symptoms> queryWrapper = new QueryWrapper<>();
- // queryWrapper.eq(true,"category",dto.getCategory())
- // .or().eq(true,"name",dto.getKeyword())
- // .or().eq(true,"description",dto.getKeyword());
- List<Symptoms> symptoms = symptomsMapper.selectList(null);
- return ResultVo.success(symptoms);
- }
- @Override
- public ResultVo selectById(Integer id) {
- QueryWrapper<Symptoms> queryWrapper = new QueryWrapper<>();
- QueryWrapper<Symptoms> wrapper = queryWrapper.eq("id", id);
- Symptoms symptoms = symptomsMapper.selectOne(wrapper);
- return ResultVo.success(symptoms);
- }
- }
|