| | |
| | | |
| | | |
| | | //查询 普通科室 |
| | | // public static string GetPTKS(String content,String ParentId) |
| | | // { |
| | | // String paramYy = 'HP'; |
| | | // String sql = 'select '; |
| | | // String props = GetSqlToPorps(account.SObjectType); |
| | | // sql += props; |
| | | // sql += ' from account'; |
| | | // sql += ' where Parent.Parent.RecordType_DeveloperName__c = :paramYy'; |
| | | // if(content != null && content != '') |
| | | // { |
| | | // content = '%'+content+'%'; |
| | | // sql += ' and Name like :content '; |
| | | // } |
| | | // if(ParentId != null && ParentId != '') |
| | | // { |
| | | // sql += ' and Parentid = :ParentId '; |
| | | // } |
| | | // sql += ' limit 5 '; |
| | | // List<account> arrays = Database.query(sql); |
| | | // return JSON.serialize(arrays); |
| | | // } |
| | | public static string GetPTKS(String content, List<String> ParentIds, Boolean checkOwner) |
| | | { |
| | | String paramYy = 'HP'; |
| | | String sql = 'select '; |
| | | String props = GetSqlToPorps(account.SObjectType); |
| | | sql += props; |
| | | sql += ' from account'; |
| | | sql += ' where Parent.Parent.RecordType_DeveloperName__c = :paramYy'; |
| | | if(content != null && content != '') |
| | | { |
| | | content = '%'+content+'%'; |
| | | sql += ' and Name like :content '; |
| | | } |
| | | if(ParentIds != null && ParentIds.size() > 0) |
| | | { |
| | | sql += ' and Parent.Parentid in :ParentIds '; |
| | | } |
| | | if (checkOwner) { |
| | | String userId = UserInfo.getUserId(); |
| | | sql += ' and OwnerId = :userId'; |
| | | } |
| | | sql += ' limit 5 '; |
| | | List<account> arrays = Database.query(sql); |
| | | return JSON.serialize(arrays); |
| | | } |
| | | |
| | | |
| | | //查询 普通科室 |