XMTT 6 years ago
parent
commit
4eb5e29db0

+ 2 - 3
src/main/java/com/ekexiu/portal/dao/ArticleDao.java

@ -183,17 +183,16 @@ public abstract class ArticleDao {
183 183
	@PageSelect
184 184
	@OrderBy(" ORDER BY PUBLISH_TIME DESC,SHARE_ID ASC")
185 185
	@Where("STATUS = '1'")
186
	public abstract PageQueryResult<Article> pageQueryPublish(Connection con, String ownerId,String articleType, @Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = { "OWNER_ID IN (SELECT ID FROM PROFESSOR WHERE NAME LIKE ?)",
186
	public abstract PageQueryResult<Article> pageQueryPublish(Connection con, String ownerId,String articleType, @Nullable @In String[] status,@Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = { "OWNER_ID IN (SELECT ID FROM PROFESSOR WHERE NAME LIKE ?)",
187 187
			"OWNER_ID IN (SELECT ID FROM ORGANIZATION WHERE NAME LIKE ? OR FOR_SHORT LIKE ?)", "ARTICLE_TITLE LIKE ?",
188 188
			"SUBJECT LIKE ?" }, additional = 1, isAnd = false) String key,int pageSize, int pageNo) throws SQLException;
189 189

190 190
	@LimitQuery
191 191
	@OrderBy(cols = { @LimitColumn(value = "publishTime", column = "PUBLISH_TIME", handlerClass = StringHandler.class, asc = false),
192 192
			@LimitColumn(value = "articleId", column = "ARTICLE_ID", asc = false, handlerClass = StringHandler.class) }, value = "")
193
	@Where("STATUS = '1'")
194 193
	@Exclude({ "descp" })
195 194
	public abstract List<Article> queryPublish(Connection con,String ownerId, String publishTime, String articleId,
196
											  @SqlColumn(handlerClass = StringHandler.class, value = { "STATUS=?" }) String articleType,@Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = { "OWNER_ID IN (SELECT ID FROM PROFESSOR WHERE NAME LIKE ?)",
195
											  @SqlColumn(handlerClass = StringHandler.class, value = { "STATUS=?" }) String articleType,@Nullable @In String[] status,@Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = { "OWNER_ID IN (SELECT ID FROM PROFESSOR WHERE NAME LIKE ?)",
197 196
			"OWNER_ID IN (SELECT ID FROM ORGANIZATION WHERE NAME LIKE ? OR FOR_SHORT LIKE ?)", "ARTICLE_TITLE LIKE ?",
198 197
			"SUBJECT LIKE ?" }, additional = 1, isAnd = false) String key,
199 198
											  int rows) throws SQLException;

+ 10 - 6
src/main/java/com/ekexiu/portal/dao/DemandDao.java

@ -1,9 +1,6 @@
1 1
package com.ekexiu.portal.dao;
2 2

3
import java.sql.Connection;
4
import java.sql.SQLException;
5
import java.util.List;
6

3
import com.ekexiu.portal.po.Demand;
7 4
import org.jfw.apt.annotation.DefaultValue;
8 5
import org.jfw.apt.annotation.Nullable;
9 6
import org.jfw.apt.orm.annotation.dao.Column;
@ -28,7 +25,9 @@ import org.jfw.apt.orm.core.defaultImpl.IntHandler;
28 25
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
29 26
import org.jfw.util.PageQueryResult;
30 27

31
import com.ekexiu.portal.po.Demand;
28
import java.sql.Connection;
29
import java.sql.SQLException;
30
import java.util.List;
32 31

33 32
@DAO
34 33
public abstract class DemandDao {
@ -123,6 +122,11 @@ public abstract class DemandDao {
123 122
	@OrderBy(" ORDER BY INVALID_DAY ASC")
124 123
	public abstract PageQueryResult<Demand> pageQueryOrderByInvalidDayAsc(Connection con,@Nullable String state, @Nullable String source,@Nullable String  cost, @Nullable String duration, 
125 124
			@GroupSqlColumn(value={"TITLE LIKE ?","DESCP LIKE ?","ORG_NAME LIKE ?","CREATOR IN (SELECT ID FROM PROFESSOR WHERE NAME LIKE ?)"},handlerClass=StringHandler.class,isAnd=false ,force =false)  @Nullable String key,int pageSize,int pageNo) throws SQLException;
125

126
	@PageSelect
127
	@OrderBy(" ORDER BY MODIFY_TIME DESC")
128
	public abstract PageQueryResult<Demand> pageQueryOrderByModifyTimeDesc(Connection con,@Nullable String state, @Nullable String source,@Nullable String  cost, @Nullable String duration,
129
			@GroupSqlColumn(value={"TITLE LIKE ?","DESCP LIKE ?","ORG_NAME LIKE ?","CREATOR IN (SELECT ID FROM PROFESSOR WHERE NAME LIKE ?)"},handlerClass=StringHandler.class,isAnd=false ,force =false)  @Nullable String key,int pageSize,int pageNo) throws SQLException;
126 130
	
127 131
    
128 132
	
@ -150,7 +154,7 @@ public abstract class DemandDao {
150 154
//	@SelectList
151 155
//	@OrderBy("ORDER BY CREATE_TIME DESC")
152 156
//	public abstract List<Demand> queryForOrg(Connection con,String orgId)throws SQLException;
153
//	
157
//	
154 158
//	@SelectList
155 159
//	@OrderBy("ORDER BY CREATE_TIME DESC")
156 160
//	public abstract List<Demand> queryByDemander(Connection con,String demander)throws SQLException;

+ 12 - 1
src/main/java/com/ekexiu/portal/platform/Console.java

@ -113,7 +113,18 @@ public class Console {
113 113
            throws SQLException {
114 114
        PageQueryResult<ButtedProfessorInfo> ret = new PageQueryResult<ButtedProfessorInfo>();
115 115
        if (pid != null) {
116
            ret = this.platformDao.queryButtedProfessorInfo(con, pid,name, pageSize, pageNo);
116
            ret = this.platformDao.queryButtedProfessorInfo(con, pid, name == null ? null : ("%" + name + "%"), pageSize, pageNo);
117
        }
118
        return ret;
119
    }
120
121
    @Get
122
    @Path("/pqButtedOrg")
123
    public PageQueryResult<ButtedOrgInfo> pageQueryButtedOrg(@JdbcConn Connection con,@Nullable String pid,@Nullable String name, int pageSize, int pageNo)
124
            throws SQLException {
125
        PageQueryResult<ButtedOrgInfo> ret = new PageQueryResult<ButtedOrgInfo>();
126
        if (pid != null) {
127
            ret = this.platformDao.queryButtedOrgInfo(con, pid, name == null ? null : ("%" + name + "%"), pageSize, pageNo);
117 128
        }
118 129
        return ret;
119 130
    }

+ 6 - 0
src/main/java/com/ekexiu/portal/platform/PlatformDao.java

@ -223,4 +223,10 @@ public interface PlatformDao {
223 223
	@Exclude({"descp"})
224 224
	PageQueryResult<ButtedProfessorInfo> queryButtedProfessorInfo(Connection con,
225 225
																  @SqlColumn(handlerClass = StringHandler.class, value = { "B.PID=?" }) String pid,@Nullable @SqlColumn(handlerClass = StringHandler.class, value = { "P.NAME LIKE ?" }) String name, int pageSize, int pageNo) throws SQLException;
226

227
	@PageQuery
228
	@OrderBy(value = "ORDER BY BUTTE_TIME DESC,ID ASC")
229
	@Exclude({"descp"})
230
	PageQueryResult<ButtedOrgInfo> queryButtedOrgInfo(Connection con,
231
																  @SqlColumn(handlerClass = StringHandler.class, value = { "B.PID=?" }) String pid,@Nullable @SqlColumn(handlerClass = StringHandler.class, value = { "O.NAME LIKE ?" }) String name, int pageSize, int pageNo) throws SQLException;
226 232
}

+ 1 - 1
src/main/java/com/ekexiu/portal/platform/PlatformService.java

@ -359,7 +359,7 @@ public class PlatformService {
359 359
	}
360 360

361 361
	@Post
362
	@Path("/buttedOrg/delete")
362
		@Path("/buttedOrg/delete")
363 363
	public int buttedOrgDelete(@JdbcConn(true) Connection con, @RequestParam(fields = { @FieldParam(value = "pid", valueClass = String.class),
364 364
			@FieldParam(value = "oid", valueClass = String.class) }) ButtedOrg po) throws SQLException {
365 365
		return this.platformDao.delete(con, po);

+ 6 - 6
src/main/java/com/ekexiu/portal/service/ArticleService.java

@ -906,16 +906,16 @@ public class ArticleService {
906 906
	}
907 907

908 908
	@Get
909
	@Path("/pageQueryPublish")
910
	public PageQueryResult<Article> pageQueryPublish(@JdbcConn Connection con, String ownerId,String articleType,@Nullable String key, @DefaultValue("10") int pageSize,
909
	@Path("/pageQuery")
910
	public PageQueryResult<Article> pageQueryPublish(@JdbcConn Connection con, String ownerId,String articleType,@Nullable String[] status,@Nullable String key, @DefaultValue("10") int pageSize,
911 911
														@DefaultValue("1") int pageNo) throws SQLException {
912
		return this.articleDao.pageQueryPublish(con, ownerId,articleType,key, pageSize, pageNo);
912
		return this.articleDao.pageQueryPublish(con, ownerId,articleType,status, key == null ? null : ("%" + key + "%"), pageSize, pageNo);
913 913
	}
914 914

915 915
	@Get
916
	@Path("/qaPublish")
917
	public List<Article> queryPublish(@JdbcConn Connection con, String ownerId, @DefaultValue("\"z\"")String publishTime, @DefaultValue("\"z\"") String articleId,String articleType,@Nullable String key, int rows) throws SQLException {
918
		return this.articleDao.queryPublish(con, ownerId, publishTime, articleId, articleType,key, rows);
916
	@Path("/qa")
917
	public List<Article> queryPublish(@JdbcConn Connection con, String ownerId, @DefaultValue("\"z\"")String publishTime, @DefaultValue("\"z\"") String articleId,String articleType,@Nullable String[] status,@Nullable String key, int rows) throws SQLException {
918
		return this.articleDao.queryPublish(con, ownerId, publishTime, articleId, articleType,status, key == null ? null : ("%" + key + "%"), rows);
919 919
	}
920 920

921 921
	@Get

+ 3 - 0
src/main/java/com/ekexiu/portal/service/DemandService.java

@ -394,6 +394,9 @@ public class DemandService {
394 394
	@Path("/search/platform")
395 395
	public PageQueryResult<Demand> query(@JdbcConn Connection con, @Nullable String state, @Nullable String source,@Nullable String  cost, @Nullable String duration, boolean byCreateTime, @Nullable String key, @DefaultValue("1") int pageNo,
396 396
			@DefaultValue("5") int pageSize) throws SQLException {
397
		if(("2").equals(state)){
398
			return this.demandDao.pageQueryOrderByModifyTimeDesc(con, state, source, cost, duration, key, pageSize, pageNo);
399
		}
397 400
		if(byCreateTime){
398 401
			return this.demandDao.pageQueryOrderByCreateTimeDesc(con, state, source, cost, duration, key, pageSize, pageNo);
399 402
		}else{