package com.mitsui.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.mitsui.domain.CertSelect;
import com.mitsui.domain.StaffCert;
import com.mitsui.util.ConnectionUtil;

public class CertSelectDao {
	public static List<CertSelect> queryAllCertSelect(){
		String sql = "select cer_id,traingrade.grade_id,cer_name,staff.p_id,p_name,cer_date from staffcert, traingrade,staff where staffcert.grade_id=traingrade.grade_id and traingrade.p_id=Staff.p_id";
		Connection conn = ConnectionUtil.getConection();
		PreparedStatement ps = null;
		try {
			ps = conn.prepareStatement(sql);
			ResultSet rs = ps.executeQuery();
			CertSelect select = null;
			List<CertSelect> selects = new ArrayList<CertSelect>();
			while(rs.next()){
				int cer_id = rs.getInt("cer_id");
				int grade_id = rs.getInt("grade_id");
				String cer_name = rs.getString("cer_name");
				String cer_date = rs.getString("cer_date");
				int p_id =rs.getInt("p_id");
				String p_name =rs.getString("p_name");

				select = new CertSelect(cer_id, grade_id, cer_name, cer_date, p_id, p_name);
				selects.add(select);
			}
			return selects;
		} catch (SQLException e) {
			e.printStackTrace();
			return null;
		}
	}

}
最近下载更多
yuanshun  LV6 2023年12月14日
微醺酸梅汤  LV2 2023年9月27日
husiyu  LV3 2023年9月25日
duoer12  LV5 2022年12月30日
wangxiaolaugh  LV2 2022年12月27日
194897762  LV4 2022年12月26日
485415187  LV6 2022年11月20日
aduahfue  LV4 2022年10月25日
13940562934  LV22 2022年7月2日
donglixue  LV6 2022年6月28日
最近浏览更多
爱丽淇  LV5 3月13日
wjh007  LV4 3月13日
asddwh  LV12 2023年12月26日
wodewode  LV1 2023年12月23日
yuanshun  LV6 2023年12月14日
hongdongdong  LV12 2023年12月2日
ncyhhh  LV1 2023年11月26日
蹇金金  LV7 2023年11月6日
dsadasdwf  LV12 2023年10月23日
毫无语  LV6 2023年10月19日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友