PushService.java 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. package com.lemon.lifecenter.scheduler.service;
  2. import java.util.ArrayList;
  3. import java.util.List;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.stereotype.Service;
  6. import com.lemon.lifecenter.scheduler.dto.DeviceInfoDTO;
  7. import com.lemon.lifecenter.scheduler.dto.PushResultDTO;
  8. import com.lemon.lifecenter.scheduler.dto.PushTargetTempDTO;
  9. import com.lemon.lifecenter.scheduler.dto.ScheduleDTO;
  10. import com.lemon.lifecenter.scheduler.mapper.PushMapper;
  11. @Service
  12. public class PushService {
  13. @Autowired
  14. private PushMapper mapper;
  15. public int resultTableCount(String ym) {
  16. return mapper.resultTableCount(ym);
  17. }
  18. public int createResultTable(String ym) {
  19. return mapper.createResultTable(ym);
  20. }
  21. public int selectSendPushCount() {
  22. return mapper.selectSendPushCount();
  23. }
  24. public List<ScheduleDTO> selectSendPushList() {
  25. return mapper.selectSendPushList();
  26. }
  27. public int updatePushSchedule(ScheduleDTO dto) {
  28. return mapper.updatePushSchedule(dto);
  29. }
  30. public int updatePushLog(ScheduleDTO dto) {
  31. return mapper.updatePushLog(dto);
  32. }
  33. public int insertPushLog(ScheduleDTO dto) {
  34. return mapper.insertPushLog(dto);
  35. }
  36. public int insertPushResult(PushResultDTO dto) {
  37. return mapper.insertPushResult(dto);
  38. }
  39. public int updatePushResult(PushResultDTO dto) {
  40. return mapper.updatePushResult(dto);
  41. }
  42. public List<DeviceInfoDTO> selectPushTarget(String targetType, ScheduleDTO dto) {
  43. int pushIdx = dto.getPushIdx();
  44. int centerCode = dto.getCenterCode();
  45. List<DeviceInfoDTO> result = new ArrayList<DeviceInfoDTO>();
  46. if (targetType.equals("P")) { // 환자 개별선택
  47. result = mapper.selectTargetPatient(pushIdx);
  48. } else if (targetType.equals("A")) { // 센터 전체
  49. result = mapper.selectTargetCenter(centerCode);
  50. } else if (targetType.equals("N")) { // 건강정보 미입력자
  51. result = mapper.selectTargetUnWritten(centerCode);
  52. } else if (targetType.equals("M")) { // 담당환자
  53. result = mapper.selectTargetMyPatient(dto);
  54. }
  55. return result;
  56. }
  57. /** 매일 **/
  58. public int selectEveryDaySendPushCount() {
  59. return mapper.selectEveryDaySendPushCount();
  60. }
  61. public List<ScheduleDTO> selectEveryDaySendPushList() {
  62. return mapper.selectEveryDaySendPushList();
  63. }
  64. public int insertEveryDayPushLog(ScheduleDTO dto) {
  65. return mapper.insertEveryDayPushLog(dto);
  66. }
  67. }