XMTT 7 years ago
parent
commit
4765970de1

+ 6 - 3
src/main/java/com/ekexiu/portal/dao/OrgDao.java

@ -218,13 +218,13 @@ public abstract class OrgDao {
218 218
					"(ID IN (SELECT ORG_ID FROM ARTICLE WHERE ARTICLE_TYPE='2' AND ARTICLE_TITLE LIKE ?) AND IS_JOIN ='1')" }) String kw,
219 219
			int pageSize, int pageNo) throws SQLException;
220 220
221
	public List<EditOrganization> indexSearch(Connection con, String kw,long sortNum,String modifyTime,int rows)throws SQLException {
221
	public List<EditOrganization> indexSearch(Connection con, String kw,long sortNum,String modifyTime,String id,int rows)throws SQLException {
222 222
		int index = 1;
223 223
		StringBuilder sql = new StringBuilder();
224 224
		sql.append("SELECT FOR_SHORT,ORG_URL,FOUND_TIME,PROVINCE,CITY,SUBJECT,INDUSTRY,ORG_SIZE,QUALIFICATION,IS_JOIN,AUTH_STATUS,ADDR,EMAIL,CONTACT_NUM,FIELD_OF_CUSTOMER,FIELD_OF_SUPPLIER,SORT_NUM,PAGE_VIEWS,SHARE_ID,COL_MGR,RES_MGR,ORG_ATTR,ID,NAME,ORG_TYPE,CREATE_TIME,MODIFY_TIME,DESCP FROM ORGANIZATION");
225
		sql.append(" WHERE SORT_NUM < ? OR (SORT_NUM = ? AND MODIFY_TIME < ?) ");
225
		sql.append(" WHERE (SORT_NUM < ? OR (SORT_NUM = ? AND MODIFY_TIME < ?) OR (SORT_NUM = ? AND MODIFY_TIME = ? AND ID < ?)) ");
226 226
		if (kw != null) {
227
			sql.append(" AND (ID IN (SELECT ORG_ID FROM ARTICLE WHERE ARTICLE_TYPE='2' AND ARTICLE_TITLE LIKE ?) AND IS_JOIN ='1') OR (ID IN (SELECT ORG_ID FROM RESOURCE WHERE RESOURCE_TYPE='2' AND RESOURCE_NAME LIKE ?) AND IS_JOIN ='1') OR (industry LIKE ?  AND IS_JOIN ='1') OR (SUBJECT LIKE ? AND IS_JOIN ='1') OR (DESCP LIKE ?  AND IS_JOIN ='1') OR (FOR_SHORT LIKE ? AND IS_JOIN ='1') OR (NAME LIKE ? AND IS_JOIN ='1') ");
227
			sql.append(" AND ((ID IN (SELECT ORG_ID FROM ARTICLE WHERE ARTICLE_TYPE='2' AND ARTICLE_TITLE LIKE ?) AND IS_JOIN ='1') OR (ID IN (SELECT ORG_ID FROM RESOURCE WHERE RESOURCE_TYPE='2' AND RESOURCE_NAME LIKE ?) AND IS_JOIN ='1') OR (industry LIKE ?  AND IS_JOIN ='1') OR (SUBJECT LIKE ? AND IS_JOIN ='1') OR (DESCP LIKE ?  AND IS_JOIN ='1') OR (FOR_SHORT LIKE ? AND IS_JOIN ='1') OR (NAME LIKE ? AND IS_JOIN ='1')) ");
228 228
		}
229 229
		sql.append(" ORDER BY SORT_NUM DESC, MODIFY_TIME DESC LIMIT ? ");
230 230
		PreparedStatement ps = con.prepareStatement(sql.toString());
@ -232,6 +232,9 @@ public abstract class OrgDao {
232 232
			ps.setLong(index++, sortNum);
233 233
			ps.setLong(index++, sortNum);
234 234
			ps.setString(index++, modifyTime);
235
			ps.setLong(index++, sortNum);
236
			ps.setString(index++, modifyTime);
237
			ps.setString(index++, id);
235 238
			if (kw != null) {
236 239
				ps.setString(index++, kw);
237 240
				ps.setString(index++, kw);

+ 2 - 2
src/main/java/com/ekexiu/portal/service/OrgService.java

@ -247,11 +247,11 @@ public class OrgService {
247 247
248 248
	@Get
249 249
	@Path("/index/search")
250
	public List<EditOrganization> indexSearch(@JdbcConn Connection con, @Nullable String key, @DefaultValue("Long.MAX_VALUE") long sortNum, @DefaultValue("\"9\"") String modifyTime, @DefaultValue("10000000") int rows)throws SQLException {
250
	public List<EditOrganization> indexSearch(@JdbcConn Connection con, @Nullable String key, @DefaultValue("Long.MAX_VALUE") long sortNum, @DefaultValue("\"9\"") String modifyTime,@DefaultValue("\"Z\"")String id, @DefaultValue("10000000") int rows)throws SQLException {
251 251
		if (key != null) {
252 252
			key = "%" + key + "%";
253 253
		}
254
		List<EditOrganization> orgs = this.orgDao.indexSearch(con,key,sortNum,modifyTime,rows);
254
		List<EditOrganization> orgs = this.orgDao.indexSearch(con,key,sortNum,modifyTime,id,rows);
255 255
		for (EditOrganization organization : orgs) {
256 256
			organization.setHasOrgLogo(this.imageService.hasOrgLogo(organization.getId()));
257 257
		}