| | |
| | | package com.fgkj.dao.impl;
|
| | |
|
| | | import java.sql.Blob;
|
| | | import java.sql.Connection;
|
| | | import java.sql.ResultSet;
|
| | | import java.sql.SQLException;
|
| | |
| | | import com.fgkj.dto.BattInf;
|
| | | import com.fgkj.dto.Deverror_record;
|
| | | import com.fgkj.dto.Page;
|
| | | import com.fgkj.dto.User_Chart;
|
| | |
|
| | | public class Deverror_recordImpl implements BaseDAO,CallBack{
|
| | |
|
| | |
| | | //用户手动添加问题
|
| | | public boolean add(Object obj) {
|
| | | Deverror_record dev_record=(Deverror_record) obj;
|
| | | String sql=" insert into db_battinf.tb_deverror_record(stationId,record_time,error_descript,uid) values(?,?,?,?)";
|
| | | boolean bl=DAOHelper.executeUpdate(DBUtil.getConn(), sql, new Object[]{dev_record.getStationId(),dev_record.getRecord_time(),dev_record.getError_descript(),dev_record.getUid()});
|
| | | |
| | | List list=new ArrayList();
|
| | | list.add(dev_record.getStationId());
|
| | | list.add(dev_record.getRecord_time());
|
| | | list.add(dev_record.getError_descript());
|
| | | list.add(dev_record.getUid());
|
| | | list.add(dev_record.getPicture_one());
|
| | | list.add(dev_record.getPicture_two());
|
| | | list.add(dev_record.getPicture_three());
|
| | | list.add(dev_record.getPicture_four());
|
| | | |
| | | list.add(dev_record.getPicture_num());
|
| | | String sql=" insert into db_battinf.tb_deverror_record(stationId,record_time,error_descript,uid,picture_one,picture_two,picture_three,picture_four,picture_num) values(?,?,?,?,?,?,?,?,?)";
|
| | | boolean bl=DAOHelper.executeUpdatePicture(DBUtil.getConn(), sql, list);
|
| | | return bl;
|
| | | }
|
| | |
|
| | |
| | | return list;
|
| | | }
|
| | |
|
| | | //根据num和列名查询图片(note放列名字)
|
| | | public List serchByInfo(Object obj) {
|
| | | // TODO Auto-generated method stub
|
| | | return null;
|
| | | final Deverror_record dev_record=(Deverror_record) obj;
|
| | | String sql="select "+dev_record.getNote()+" from db_battinf.tb_deverror_record where num=? ";
|
| | | List list=DAOHelper.executeQueryPicture(sql, DBUtil.getConn(), new Object[]{dev_record.getNum()}, new CallBack() {
|
| | | |
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()){
|
| | | Blob blob=rs.getBlob(dev_record.getNote());
|
| | | list.add(blob);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | });
|
| | | return list;
|
| | | |
| | | }
|
| | | public static void main(String[] args) {
|
| | | Deverror_recordImpl dimpl=new Deverror_recordImpl();
|