package cn.hmsoft.hmplatform.identity.data.dao;

import java.time.LocalDate;
import org.springframework.stereotype.Repository;
import cn.hmsoft.hmplatform.identity.data.model.PStdRes;
import cn.hmsoft.jdbc.core.PlatformDaoSupport;

@Repository
public class PStdResDao extends PlatformDaoSupport<PStdRes> {

	public PStdRes findRes(String cert_id, LocalDate res_date, String res_type) {
		String sql = "select * from p_std_res where cert_id=? and res_date=? and res_type=? ";
		return this.findBySql(sql, cert_id, res_date, res_type);
	}

	public void updateRes(PStdRes res) {
		String sql = "update std_res set res_number=? where res_date=? and res_type=? and std_id=? ";
		this.updateBySql(sql, res.getRes_number(), res.getRes_date(), res.getRes_type(), res.getStd_id());
	}

}
