private boolean conflictWithScm(String talentId, String supplyId, String key) { StringBuilder selectSql = new StringBuilder() .append("SELECT ") .append(" dxr_biz_id AS id, key, dxr_biz_talentsupplycode AS talentSupplyCode, ") .append(" dxr_biz_eid AS eid, dxr_biz_talentid AS talentId, dxr_biz_talentcode AS talentCode, dxr_biz_talentname AS talentName, ") .append(" dxr_biz_supplyid AS supplyId, dxr_biz_supplyCode AS supplyCode, dxr_biz_supplyname AS supplyName, ") .append(" dxr_biz_cooperationstartdate AS cooperationStartDate, dxr_biz_cooperationstatus AS cooperationStatus, ") .append(" dxr_biz_checkstatus AS checkStatus, IFNULL(dxr_biz_syncstatus, '0') AS syncStatus, ") .append("FROM dxr.hive_dxr_biz_businessrelations ") .append("WHERE dxr_biz_talentid='").append(talentId).append("' ") .append(" AND dxr_biz_supplyid='").append(supplyId).append("' ") .append(" AND (key !='").append(key).append("' OR key='')") .append("LIMIT 1"); return null != bigdataUtil.queryFromHiveBySql(selectSql.toString(), ScmBusinessRelationship.class); }
时间: 2024-04-27 18:20:39 浏览: 190
SQL与JAVA算法题目(难度和一般面试笔试差不多).doc
这段代码是用来判断人才和供应商之间的业务关系是否存在冲突,其中包括人才ID,供应商ID和业务关系的key。它使用了StringBuilder来构建SQL查询语句,并调用了bigdataUtil的queryFromHiveBySql方法来执行查询。如果查询结果不为空,则说明存在冲突,返回true,否则返回false。
阅读全文