sql改造

main
Administrator 2 months ago
parent 238ea8212f
commit 7fca4358e6

@ -129,25 +129,30 @@ public class EmployeeRelationServiceImpl implements EmployeeRelationService {
@Override
public boolean queryIsNotHaveScanTheCodeInfo(String mobile, String email, String identity) {
boolean flag = false;
String sql = "";
if (StringUtils.isBlank(identity)&&StringUtils.isBlank(mobile)&&StringUtils.isBlank(email)) {
flag = false;
}else{
String sql = "select id from uf_jcl_rzgl where IS_DELETE = 0 and delete_type = 0 and TENANT_KEY = 't7n9jpeaoa' and (";
if (StringUtils.isNotBlank(identity)) {
sql = "select id from uf_jcl_rzgl where sfz_1mhf = '" + identity + "' and IS_DELETE = 0 and delete_type = 0 and TENANT_KEY = 't7n9jpeaoa' ";
log.error("queryLeaderPdByYear.sql:{}", sql);
} else {
sql += " sfz_1mhf = '" + identity+ "' or";
log.error("queryIsNotHaveScanTheCodeInfo.identity:{}", sql);
}
if (StringUtils.isNotBlank(mobile)) {
sql = "select id from uf_jcl_rzgl where sj_woiy = '" + mobile + "' and IS_DELETE = 0 and delete_type = 0 and TENANT_KEY = 't7n9jpeaoa' ";
log.error("queryLeaderPdByYear.sql:{}", sql);
} else {
sql = "select id from uf_jcl_rzgl where yx_gvex = '" + email + "' and IS_DELETE = 0 and delete_type = 0 and TENANT_KEY = 't7n9jpeaoa' ";
log.error("queryLeaderPdByYear.sql:{}", sql);
sql += " sj_woiy = '" + mobile+ "' or";
log.error("queryIsNotHaveScanTheCodeInfo.mobile:{}", sql);
}
if (StringUtils.isNotBlank(email)) {
sql += " yx_gvex = '" + email+ "' or";
log.error("queryIsNotHaveScanTheCodeInfo.email:{}", sql);
}
sql = sql.substring(0,sql.length()-2)+")";
Map<String, Object> rs = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(rs);
log.error("queryIsNotHaveScanTheCodeInfo.recordList:{}", recordList);
if (CollectionUtils.isNotEmpty(recordList)) {
flag = true;
}
}
return flag;
}

Loading…
Cancel
Save