InsuranceDaoImpl

时间:2025-01-27 08:08:19

目录

1、 InsuranceDaoImpl

1.1、 delectInsurance

1.2、 //SYS_RecRepairItemDetail修理项目明细表

1.3、 //SYS_RecProductDetail产品明细表

  1. InsuranceDaoImpl 

package com.gx.dao.impl;

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.gx.dao.IInsuranceDao;

import com.gx.pojo.PW_Insurance;

import com.gx.pojo.SYS_CollageDetai;

import com.gx.pojo.SYS_InsuranceDetail;

import com.gx.pojo.SYS_RecRepairItemDetail;

import com.gx.util.DbUtil;

import com.gx.util.JdbcHelper;

import com.gx.vo.ReceptionVo;

public class InsuranceDaoImpl implements IInsuranceDao {

private Connection conn=null;

private PreparedStatement ps=null;

private ResultSet rs=null;

    1. delectInsurance

@Override

public boolean delectInsurance(int insuranceID) {

return JdbcHelper.delete(PW_Insurance.class, "InsuranceID", insuranceID);

}

    1. //SYS_RecRepairItemDetail修理项目明细表

private List<SYS_RecRepairItemDetail> listRecRepairItemDetail(int receptionID){

String sql="SELECT * FROM SYS_RecRepairItemDetail WHERE ReceptionID = ? AND MaintainabilityID=6";

List<SYS_RecRepairItemDetail> listRecRepairItemDetail=null;

try {

conn=DbUtil.getConnection();

ps=conn.prepareStatement(sql);

ps.setInt(1, receptionID);

rs=ps.executeQuery();

listRecRepairItemDetail = JdbcHelper.getResult(rs, SYS_RecRepairItemDetail.class);

} catch (SQLException e) {

e.printStackTrace();

}

return listRecRepairItemDetail;

}

    1. //SYS_RecProductDetail产品明细表

private List<SYS_CollageDetai> listCollageDetai(int receptionID){

String sql="SELECT * FROM PW_Reception r,PW_Collage c,SYS_CollageDetai WHERE r.ReceptionID=c.ReceptionID AND " +

"c.CollageID=SYS_CollageDetai.CollageID AND r.ReceptionID=? AND SYS_CollageDetai.MaintainabilityID=6";

List<SYS_CollageDetai> listCollageDetai=null;

try {

conn=DbUtil.getConnection();

ps=conn.prepareStatement(sql);

ps.setInt(1, receptionID);

rs=ps.executeQuery();

listCollageDetai = JdbcHelper.getResult(rs, SYS_CollageDetai.class);

} catch (SQLException e) {

e.printStackTrace();

}

return listCollageDetai;

}

}

相关文章