SmartFamilyIndexServiceImpl.java 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package com.template.services.impl;
  2. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  3. import com.template.mapper.SmartUserMapper;
  4. import com.template.model.pojo.SmartFamilyIndex;
  5. import com.template.mapper.SmartFamilyIndexMapper;
  6. import com.template.services.SmartFamilyIndexService;
  7. import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  8. import org.springframework.beans.factory.annotation.Autowired;
  9. import org.springframework.stereotype.Service;
  10. import org.springframework.util.StringUtils;
  11. import java.util.List;
  12. /**
  13. * <p>
  14. * 楼栋表 服务实现类
  15. * </p>
  16. *
  17. * @author ceshi
  18. * @since 2024-04-23
  19. */
  20. @Service
  21. public class SmartFamilyIndexServiceImpl extends ServiceImpl<SmartFamilyIndexMapper, SmartFamilyIndex> implements SmartFamilyIndexService {
  22. @Autowired
  23. private SmartFamilyIndexMapper smartFamilyIndexMapper;
  24. @Override
  25. public SmartFamilyIndex queryFamilyByPhoneCardNo(String phone, String cardNo) {
  26. QueryWrapper<SmartFamilyIndex> queryWrapper = new QueryWrapper();
  27. queryWrapper.eq(StringUtils.hasText(phone), "parent_phone", phone);
  28. queryWrapper.eq(StringUtils.hasText(cardNo), "student_no", cardNo);
  29. SmartFamilyIndex result = smartFamilyIndexMapper.selectOne(queryWrapper);
  30. return result;
  31. }
  32. @Override
  33. public List<SmartFamilyIndex> querySmartFamilyByCardNo(String cardNo) {
  34. QueryWrapper<SmartFamilyIndex> queryWrapper = new QueryWrapper();
  35. queryWrapper.eq(StringUtils.hasText(cardNo), "student_no", cardNo);
  36. queryWrapper.orderByAsc("index_data");
  37. List<SmartFamilyIndex> indexs = smartFamilyIndexMapper.selectList(queryWrapper);
  38. return indexs;
  39. }
  40. @Override
  41. public int deleteSmartFamilyByPhone(String phone) {
  42. QueryWrapper<SmartFamilyIndex> queryWrapper = new QueryWrapper();
  43. queryWrapper.eq(StringUtils.hasText(phone), "parent_phone", phone);
  44. int result = smartFamilyIndexMapper.delete(queryWrapper);
  45. return result;
  46. }
  47. @Override
  48. public int deleteSmartFamilyByCardNo(String cardNo) {
  49. QueryWrapper<SmartFamilyIndex> queryWrapper = new QueryWrapper();
  50. queryWrapper.eq(StringUtils.hasText(cardNo), "student_no", cardNo);
  51. int result = smartFamilyIndexMapper.delete(queryWrapper);
  52. return result;
  53. }
  54. @Override
  55. public int updateSmartFamily(SmartFamilyIndex sfi) {
  56. int result = smartFamilyIndexMapper.updateById(sfi);
  57. return result;
  58. }
  59. @Override
  60. public int deleteSmartFamilyByIds(List<Integer> ids) {
  61. int result = smartFamilyIndexMapper.deleteBatchIds(ids);
  62. return result;
  63. }
  64. }