allrepairqueryAction.java
上传用户:flow_meter
上传日期:2022-03-21
资源大小:40k
文件大小:3k
- package sql_lab;
- import java.sql.ResultSet;
- import java.sql.SQLException;
- import org.eclipse.jface.action.Action;
- import org.eclipse.swt.widgets.Text;
- public class allrepairqueryAction extends Action {
- public allrepairqueryAction(){
- super();
- this.setText("查看所有维修单信息(&N)");
- this.setToolTipText("查看所有维修单信息");
- }
- public void run(){
- if(MainWindow.log==false){
- Text content=MainWindow.getApp().getContent();
- content.append("请您先登陆n");
- return ;
- }
- String str="select "+
- sqlManager.tb_repair+"."+sqlManager.row_repair_id+","+ //维修单号
- sqlManager.tb_repair+"."+sqlManager.row_repair_time+","+//维修时间
- sqlManager.tb_repair+"."+sqlManager.row_repair_information+","+//维修记录
- sqlManager.tb_customer+"."+sqlManager.row_customer_name+","+//客户姓名
- sqlManager.tb_produce+"."+sqlManager.row_produce_name+","+//维修商品名称
- sqlManager.tb_repair_shop+"."+sqlManager.row_repair_shop_name+","+//维修店铺
- sqlManager.tb_repair_shop+"."+sqlManager.row_repair_shop_keeper+","+//维修人
- sqlManager.tb_repair_shop+"."+sqlManager.row_repair_shop_call+" " +//维修店联系电话
- "from "+sqlManager.tb_produce+","+sqlManager.tb_customer+","+sqlManager.tb_repair_shop+","+sqlManager.tb_repair+" "+
- "where "+
- sqlManager.tb_repair+"."+sqlManager.row_repair_repair_shop_id+"="+sqlManager.tb_repair_shop+"."+sqlManager.row_repair_shop_id+" and "+
- sqlManager.tb_repair+"."+sqlManager.row_repair_customer_id+"="+sqlManager.tb_customer+"."+sqlManager.row_customer_id+" and "+
- sqlManager.tb_repair+"."+sqlManager.row_repair_produce_id+"="+sqlManager.tb_produce+"."+sqlManager.row_produce_id+
- "";
- sqlManager sql=sqlManager.getSqlManager();
- ResultSet set=sql.executeQuery(str);
- Text content=MainWindow.getApp().getContent();
- boolean flag=false;
- String s="***********************************维修单信息查询结果**********************************n";
- try{
- while(set.next()){
- flag=true;
- content.append(s);
-
- content.append("维修单号:"+set.getInt(1)+"n");
- content.append("维修时间:"+set.getString(2)+"n");
- content.append("维修记录:"+set.getString(3)+"n");
- content.append("客户姓名:"+set.getString(4)+"n");
- content.append("维修商品名称:"+set.getString(5)+"n");
- content.append("维修店铺: "+set.getString(6)+"n");
- content.append("维修人: "+set.getString(7)+"n");
- content.append("维修店联系电话: "+set.getString(8)+"n");
- }
- }
- catch(SQLException e){
- e.printStackTrace();
- }
- content.append(s);
- if(flag==false)content.append("查询结果为空n");
- }
- }