📄 empondutyquery.java
字号:
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Fri as 星期五上午为6下午为13 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Fri < > '0';");
return;
}
if (buttonGroup2.getSelection() == jRadioButton6.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Sat as 星期六上午为7下午为14 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Sat < > '0';");
return;
}
if (buttonGroup2.getSelection() == jRadioButton7.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Sun as 星期日上午为1下午为8 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Sun < > '0';");
return;
}
}
if (buttonGroup1.getSelection() == jRadioButton15.getModel()) { //按员工ID
String strOnEmpID = jTextField1.getText();
if (buttonGroup2.getSelection() == jRadioButton1.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Mon as 星期一上午为2下午为9 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_Employee.EmpID = '" +
strOnEmpID +
"' AND HIMS_OnDuty_Date.Mon < > '0'; ");
return;
}
if (buttonGroup2.getSelection() == jRadioButton2.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Tues as 星期二上午为3下午为10 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_Employee.EmpID = '" +
strOnEmpID +
"' AND HIMS_OnDuty_Date.Tues < > '0';");
return;
}
if (buttonGroup2.getSelection() == jRadioButton3.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Wed as 星期三上午为4下午为11 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_Employee.EmpID = '" +
strOnEmpID +
"' AND HIMS_OnDuty_Date.Wed < > '0';");
return;
}
if (buttonGroup2.getSelection() == jRadioButton4.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Thurs as 星期四上午为5下午为12 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_Employee.EmpID = '" +
strOnEmpID +
"' AND HIMS_OnDuty_Date.Thurs < > '0';");
return;
}
if (buttonGroup2.getSelection() == jRadioButton5.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Fri as 星期五上午为6下午为13 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_Employee.EmpID = '" +
strOnEmpID +
"' AND HIMS_OnDuty_Date.Fri < > '0';");
return;
}
if (buttonGroup2.getSelection() == jRadioButton6.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Sat as 星期六上午为7下午为14 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_Employee.EmpID = '" +
strOnEmpID +
"' AND HIMS_OnDuty_Date.Sat < > '0';");
return;
}
if (buttonGroup2.getSelection() == jRadioButton7.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Sun as 星期日上午为1下午为8 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_Employee.EmpID = '" +
strOnEmpID +
"' AND HIMS_OnDuty_Date.Sun < > '0';");
return;
}
}
//-------------------------------------------------------------------------------------------
if (buttonGroup1.getSelection() == jRadioButton17.getModel()) { //按姓名查询
String strOnName = jTextField2.getText();
if (buttonGroup2.getSelection() == jRadioButton1.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Mon as 星期一上午为2下午为9 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Mon < > '0' AND HIMS_Employee.Name like '%" +
strOnName + "%'; ");
return;
} else if (buttonGroup2.getSelection() == jRadioButton2.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Tues as 星期二上午为3下午为10 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Tues < > '0' AND HIMS_Employee.Name like '%" +
strOnName + "%';");
return;
} else if (buttonGroup2.getSelection() == jRadioButton3.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Wed as 星期三上午为4下午为11 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Wed < > '0'AND HIMS_Employee.Name like '%" +
strOnName + "%';");
return;
} else if (buttonGroup2.getSelection() == jRadioButton4.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Thurs as 星期四上午为5下午为12 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Thurs < > '0' AND HIMS_Employee.Name like '%" +
strOnName + "%';");
return;
} else if (buttonGroup2.getSelection() == jRadioButton5.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Fri as 星期五上午为6下午为13 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Fri < > '0' AND HIMS_Employee.Name like '%" +
strOnName + "%';");
return;
} else if (buttonGroup2.getSelection() == jRadioButton6.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Sat as 星期六上午为7下午为14 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Sat < > '0' AND HIMS_Employee.Name like '%" +
strOnName +
"%';");
return;
} else if (buttonGroup2.getSelection() == jRadioButton7.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Sun as 星期日上午为1下午为8 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Sun < > '0' AND HIMS_Employee.Name like '%" +
strOnName +
"%';");
return;
}
}
//-------------------------------------------------------------------------------------------
if (buttonGroup1.getSelection() == jRadioButton9.getModel()) { //按部门查询
String strOnDepartment = null;
try {
strOnDepartment = jComboBox1.getSelectedItem().toString();
} catch (Exception ex) {
strOnDepartment = "";
}
if (buttonGroup2.getSelection() == jRadioButton1.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Mon as 星期一上午为2下午为9 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Mon < > '0' AND HIMS_Employee.Department = '" +
strOnDepartment + "'; ");
return;
} else if (buttonGroup2.getSelection() == jRadioButton2.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Tues as 星期二上午为3下午为10 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Tues < > '0' AND HIMS_Employee.Department = '" +
strOnDepartment + "';");
return;
} else if (buttonGroup2.getSelection() == jRadioButton3.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Wed as 星期三上午为4下午为11 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Wed < > '0'AND HIMS_Employee.Department = '" +
strOnDepartment + "';");
return;
} else if (buttonGroup2.getSelection() == jRadioButton4.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Thurs as 星期四上午为5下午为12 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Thurs < > '0' AND HIMS_Employee.Department = '" +
strOnDepartment + "';");
return;
} else if (buttonGroup2.getSelection() == jRadioButton5.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Fri as 星期五上午为6下午为13 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Fri < > '0' AND HIMS_Employee.Department = '" +
strOnDepartment + "';");
return;
} else if (buttonGroup2.getSelection() == jRadioButton6.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Sat as 星期六上午为7下午为14 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Sat < > '0' AND HIMS_Employee.Department = '" +
strOnDepartment +
"';");
return;
} else if (buttonGroup2.getSelection() == jRadioButton7.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Sun as 星期日上午为1下午为8 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Sun < > '0' AND HIMS_Employee.Department = '" +
strOnDepartment +
"';");
return;
}
}
//------------------------------------------------------------------
if (buttonGroup1.getSelection() == jRadioButton10.getModel()) { //按职务查询
String strOnDuty = null;
try {
strOnDuty = jComboBox2.getSelectedItem().toString();
} catch (Exception ex) {
strOnDuty = "";
}
if (buttonGroup2.getSelection() == jRadioButton1.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Mon as 星期一上午为2下午为9 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Mon < > '0' AND HIMS_Employee.Duty = '" +
strOnDuty + "'; ");
return;
} else if (buttonGroup2.getSelection() == jRadioButton2.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Tues as 星期二上午为3下午为10 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Tues < > '0' AND HIMS_Employee.Duty = '" +
strOnDuty + "';");
return;
} else if (buttonGroup2.getSelection() == jRadioButton3.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Wed as 星期三上午为4下午为11 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Wed < > '0'AND HIMS_Employee.Duty = '" +
strOnDuty + "';");
return;
} else if (buttonGroup2.getSelection() == jRadioButton4.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Thurs as 星期四上午为5下午为12 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Thurs < > '0' AND HIMS_Employee.Duty = '" +
strOnDuty + "';");
return;
} else if (buttonGroup2.getSelection() == jRadioButton5.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Fri as 星期五上午为6下午为13 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Fri < > '0' AND HIMS_Employee.Duty = '" +
strOnDuty + "';");
return;
} else if (buttonGroup2.getSelection() == jRadioButton6.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Sat as 星期六上午为7下午为14 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Sat < > '0' AND HIMS_Employee.Duty = '" +
strOnDuty +
"';");
return;
} else if (buttonGroup2.getSelection() == jRadioButton7.getModel()) {
table.fetch("Select HIMS_Employee.EmpID as 员工ID, Name as 姓名, Department as 部门, Duty as 职务, FloorNo as 负责楼层,Proceeding as 负责事项,EmpRemark as 备注,Sun as 星期日上午为1下午为8 From HIMS_Employee, HIMS_OnDuty, HIMS_OnDuty_Date where HIMS_Employee.EmpID = HIMS_OnDuty.EmpID AND HIMS_Employee.EmpID = HIMS_OnDuty_Date.EmpID AND HIMS_OnDuty_Date.Sun < > '0' AND HIMS_Employee.Duty = '" +
strOnDuty +
"';");
return;
}
}
}
public void jButton2_actionPerformed(ActionEvent e) {
this.setVisible(false);
}
public void jRadioButton15_actionPerformed(ActionEvent e) { //Id
jTextField1.setText("");
jTextField1.setEnabled(true);
jTextField2.setText("");
jTextField2.setEnabled(false); //按姓名查询
jComboBox1.removeAllItems();
jComboBox1.setEnabled(false); //按部门
jComboBox2.removeAllItems();
jComboBox2.setEnabled(false); //按职务
}
public void jRadioButton17_actionPerformed(ActionEvent e) { //name
jTextField1.setText("");
jTextField1.setEnabled(false); //ID
jTextField2.setText("");
jTextField2.setEnabled(true); //按姓名查询
jComboBox1.removeAllItems();
jComboBox1.setEnabled(false); //按部门
jComboBox2.removeAllItems();
jComboBox2.setEnabled(false); //按职务
}
public void jRadioButton9_actionPerformed(ActionEvent e) { //部门
jTextField1.setText("");
jTextField1.setEnabled(false);
jTextField2.setText("");
jTextField2.setEnabled(false); //按姓名查询
jComboBox1.removeAllItems();
jComboBox1.setEnabled(true); //按部门
jComboBox1.addItem(" ");
jComboBox1.addItem("服务部");
jComboBox1.addItem("客房部");
jComboBox2.removeAllItems();
jComboBox2.setEnabled(false); //按职务
}
public void jRadioButton10_actionPerformed(ActionEvent e) { //职务
jTextField1.setText("");
jTextField1.setEnabled(false);
jTextField2.setText("");
jTextField2.setEnabled(false); //按姓名查询
jComboBox1.removeAllItems();
jComboBox1.setEnabled(false); //按部门
jComboBox2.removeAllItems();
jComboBox2.setEnabled(true); //按职务
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -