package com.yssh.service.impl; import com.yssh.dao.YsshSuYuan100Mapper; import com.yssh.dao.YsshSuYuanFeedbackMapper; import com.yssh.entity.YsshSuYuanFeedback; import com.yssh.entity.YsshSuYuanX00; import com.yssh.entity.dto.YsshSuYuanX00UpdateBatchParam; import com.yssh.service.YsshSuYuan100Service; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; /** * @author lishijia * @ClassName YsshSuYuan100ServiceImpl * @Description TODO * @date 2022/11/28 10:47 * @Version 1.0 */ @Service public class YsshSuYuan100ServiceImpl implements YsshSuYuan100Service { @Autowired private YsshSuYuan100Mapper ysshSuYuan100Mapper; @Autowired private YsshSuYuanFeedbackMapper ysshSuYuanFeedbackMapper; @Override public List query(String name) { List list = ysshSuYuan100Mapper.query(name); YsshSuYuanX00 maxValue = ysshSuYuan100Mapper.queryMaxVlue(name); YsshSuYuanFeedback ysshSuYuanFeedback = new YsshSuYuanFeedback(); List query = ysshSuYuanFeedbackMapper.query(maxValue.getId(), name, ""); BeanUtils.copyProperties(maxValue, ysshSuYuanFeedback); ysshSuYuanFeedback.setCorrect(true); ysshSuYuanFeedback.setSuyuanId(maxValue.getId()); if(query.size() > 0){ ysshSuYuanFeedback.setId(query.get(0).getId()); ysshSuYuanFeedbackMapper.update(ysshSuYuanFeedback); }else { ysshSuYuanFeedbackMapper.insert(ysshSuYuanFeedback); } return list; } @Override public List queryByIds(List ids) { return ysshSuYuan100Mapper.queryByIds(ids); } @Override public List getAll() { return ysshSuYuan100Mapper.getAll(); } @Override public int insert(YsshSuYuanX00 ysshSuYuan) { return ysshSuYuan100Mapper.insert(ysshSuYuan); } @Override public int delete(String id) { return ysshSuYuan100Mapper.delete(id); } @Override public int update(YsshSuYuanX00 ysshSuYuan) { return ysshSuYuan100Mapper.update(ysshSuYuan); } @Override public int updateBatch(YsshSuYuanX00UpdateBatchParam param) { return ysshSuYuan100Mapper.updateBatch(param); } }