package com.wyu.online.dao; import com.wyu.online.utils.C3poUtils; import org.junit.Test; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Created by Administrator on 2018/7/20 */ public class GradeDao { public List<Map<String,String>> getGradesByName(String username) { List<Map<String,String>> grades = new ArrayList<>(); String sql = "select g.id id,ks.subject subject, g.release_time release_time,g.score score " + "from grade g,kskm ks,sys_user u " + "where g.subject_id=ks.id and g.user_id=u.id and u.username=?"; try { ResultSet rs = C3poUtils.getPreparedStatement(sql,new Object[]{username}).executeQuery(); while (rs.next()){ Map<String,String> map = new HashMap<>(); map.put("id",rs.getString("id")); map.put("subject",rs.getString("subject")); map.put("release_time",rs.getString("release_time")); map.put("score",rs.getString("score")); grades.add(map); } } catch (SQLException e) { e.printStackTrace(); } return grades; } }

敏哥gege LV43
2024年12月15日
hongdongdong LV14
2023年12月2日
li246520 LV2
2023年6月26日
流连瓦盖法 LV7
2023年6月25日
yjhusst LV1
2022年11月26日
云翳tel青 LV11
2022年11月19日
cx0127 LV13
2022年10月30日
1535316910 LV7
2022年6月16日
y1214435276 LV9
2022年5月14日
weilaizhisheng LV21
2022年3月14日