package com.usoftchina.uas.office.qywx.service;

import com.usoftchina.uas.office.qywx.entity.Agenda;
import com.usoftchina.uas.office.service.AbstractService;
import org.springframework.stereotype.Service;

/**
 * @author yingp
 * @date 2020/2/16
 */
@Service
public class UasAgendaService extends AbstractService {

    public Agenda getById(Integer id) {
        return queryForBean("select Agenda.*,em_qywx from Agenda,employee where ag_executor=em_name and ag_id=? and em_qywx is not null",
                Agenda.class, id);
    }

    public String getScheduleId(Integer id) {
        return queryForObject("select ag_scheduleid from Agenda where ag_id=?", String.class, id);
    }

    public void setScheduleId(Agenda agenda) {
        jdbcTemplate.update("update Agenda set ag_scheduleid=? where ag_id=?", agenda.getAg_scheduleid(), agenda.getAg_id());
    }
}
