|
|
|
|
@ -369,33 +369,38 @@ function getSql() {
|
|
|
|
|
if (inpatientNo != '') {
|
|
|
|
|
name = 'inpatient_no';
|
|
|
|
|
inpatientNo = inpatientNo.replace(/(^\s*)|(\s*$)/g, "");
|
|
|
|
|
//1.逗号隔开
|
|
|
|
|
if (inpatientNo.indexOf(",") != -1 || inpatientNo.indexOf(",") != -1) {
|
|
|
|
|
if (inpatientNo.indexOf(",") != -1) {
|
|
|
|
|
inpatientNo = inpatientNo.split(",");
|
|
|
|
|
} else if (inpatientNo.indexOf(",") != -1) {
|
|
|
|
|
inpatientNo = inpatientNo.split(",");
|
|
|
|
|
}
|
|
|
|
|
for (var i = 0; i < inpatientNo.length; i++) {
|
|
|
|
|
if (inpatientNo[i] != '') {
|
|
|
|
|
inpatientNo[i] = inpatientNo[i].replace(/(^\s*)|(\s*$)/g, "");
|
|
|
|
|
//拼接前括号
|
|
|
|
|
if (i == 0) {
|
|
|
|
|
whereNames += "(";
|
|
|
|
|
}
|
|
|
|
|
if (i != inpatientNo.length - 1) {
|
|
|
|
|
whereNames += commomtable + "." + name + " LIKE '%" + inpatientNo[i] + "%' OR ";
|
|
|
|
|
} else {
|
|
|
|
|
whereNames += commomtable + "." + name + " LIKE '%" + inpatientNo[i] + "%')";
|
|
|
|
|
var inpatientNoCheckbox = $("#inpatientNoCheckbox").is(':checked');
|
|
|
|
|
if(inpatientNoCheckbox) {
|
|
|
|
|
//1.逗号隔开
|
|
|
|
|
if (inpatientNo.indexOf(",") != -1 || inpatientNo.indexOf(",") != -1) {
|
|
|
|
|
if (inpatientNo.indexOf(",") != -1) {
|
|
|
|
|
inpatientNo = inpatientNo.split(",");
|
|
|
|
|
} else if (inpatientNo.indexOf(",") != -1) {
|
|
|
|
|
inpatientNo = inpatientNo.split(",");
|
|
|
|
|
}
|
|
|
|
|
for (var i = 0; i < inpatientNo.length; i++) {
|
|
|
|
|
if (inpatientNo[i] != '') {
|
|
|
|
|
inpatientNo[i] = inpatientNo[i].replace(/(^\s*)|(\s*$)/g, "");
|
|
|
|
|
//拼接前括号
|
|
|
|
|
if (i == 0) {
|
|
|
|
|
whereNames += "(";
|
|
|
|
|
}
|
|
|
|
|
if (i != inpatientNo.length - 1) {
|
|
|
|
|
whereNames += commomtable + "." + name + " LIKE '%" + inpatientNo[i] + "%' OR ";
|
|
|
|
|
} else {
|
|
|
|
|
whereNames += commomtable + "." + name + " LIKE '%" + inpatientNo[i] + "%')";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
whereNames += " AND ";
|
|
|
|
|
} else {
|
|
|
|
|
whereNames += commomtable + "." + name + " LIKE '%" + $("#" + name).val() + "%' AND ";
|
|
|
|
|
}
|
|
|
|
|
whereNames += " AND ";
|
|
|
|
|
} else {
|
|
|
|
|
whereNames += commomtable + "." + name + " LIKE '%" + $("#" + name).val() + "%' AND ";
|
|
|
|
|
}else{
|
|
|
|
|
whereNames += commomtable + "." + name + " = '" + $("#" + name).val() + "' AND ";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//ID号
|
|
|
|
|
//ID
|
|
|
|
|
if ($("#admiss_id").val() != '') {
|
|
|
|
|
name = 'admiss_id';
|
|
|
|
|
whereNames += commomtable + "." + name + " LIKE '%" + $("#" + name).val() + "%' AND ";
|
|
|
|
|
|