XMTT 6 anos atrás
pai
commit
bb645ec710

+ 21 - 1
src/main/java/com/ekexiu/portal/dao/ArticleDao.java

6
import com.ekexiu.portal.pojo.SelfArticle;
6
import com.ekexiu.portal.pojo.SelfArticle;
7
import org.jfw.apt.annotation.DefaultValue;
7
import org.jfw.apt.annotation.DefaultValue;
8
import org.jfw.apt.annotation.Nullable;
8
import org.jfw.apt.annotation.Nullable;
9
import org.jfw.apt.orm.annotation.dao.Column;
9
import org.jfw.apt.orm.annotation.dao.DAO;
10
import org.jfw.apt.orm.annotation.dao.DAO;
10
import org.jfw.apt.orm.annotation.dao.Dynamic;
11
import org.jfw.apt.orm.annotation.dao.Dynamic;
11
import org.jfw.apt.orm.annotation.dao.method.Exclude;
12
import org.jfw.apt.orm.annotation.dao.method.Exclude;
16
import org.jfw.apt.orm.annotation.dao.method.Where;
17
import org.jfw.apt.orm.annotation.dao.method.Where;
17
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
18
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
18
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
19
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
20
import org.jfw.apt.orm.annotation.dao.method.operator.LimitQuery;
19
import org.jfw.apt.orm.annotation.dao.method.operator.LimitSelect;
21
import org.jfw.apt.orm.annotation.dao.method.operator.LimitSelect;
20
import org.jfw.apt.orm.annotation.dao.method.operator.PageQuery;
22
import org.jfw.apt.orm.annotation.dao.method.operator.PageQuery;
21
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
23
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
31
import org.jfw.apt.orm.annotation.dao.param.Like;
33
import org.jfw.apt.orm.annotation.dao.param.Like;
32
import org.jfw.apt.orm.annotation.dao.param.Set;
34
import org.jfw.apt.orm.annotation.dao.param.Set;
33
import org.jfw.apt.orm.annotation.dao.param.SqlColumn;
35
import org.jfw.apt.orm.annotation.dao.param.SqlColumn;
34
import org.jfw.apt.orm.annotation.dao.Column;
35
import org.jfw.apt.orm.core.defaultImpl.LongHandler;
36
import org.jfw.apt.orm.core.defaultImpl.LongHandler;
36
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
37
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
37
import org.jfw.util.PageQueryResult;
38
import org.jfw.util.PageQueryResult;
178
					"OWNER_ID IN (SELECT ID FROM ORGANIZATION WHERE NAME LIKE ? OR FOR_SHORT LIKE)" }, additional = 1, isAnd = false) String key,
179
					"OWNER_ID IN (SELECT ID FROM ORGANIZATION WHERE NAME LIKE ? OR FOR_SHORT LIKE)" }, additional = 1, isAnd = false) String key,
179
			int pageSize, int pageNo) throws SQLException;
180
			int pageSize, int pageNo) throws SQLException;
180

181

182
	@Exclude("articleContent")
183
	@PageSelect
184
	@OrderBy(" ORDER BY PUBLISH_TIME DESC,SHARE_ID ASC")
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 ?)",
187
			"OWNER_ID IN (SELECT ID FROM ORGANIZATION WHERE NAME LIKE ? OR FOR_SHORT LIKE ?)", "ARTICLE_TITLE LIKE ?",
188
			"SUBJECT LIKE ?" }, additional = 1, isAnd = false) String key,int pageSize, int pageNo) throws SQLException;
189

190
	@LimitQuery
191
	@OrderBy(cols = { @LimitColumn(value = "publishTime", column = "PUBLISH_TIME", handlerClass = StringHandler.class, asc = false),
192
			@LimitColumn(value = "articleId", column = "ARTICLE_ID", asc = false, handlerClass = StringHandler.class) }, value = "")
193
	@Where("STATUS = '1'")
194
	@Exclude({ "descp" })
195
	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 ?)",
197
			"OWNER_ID IN (SELECT ID FROM ORGANIZATION WHERE NAME LIKE ? OR FOR_SHORT LIKE ?)", "ARTICLE_TITLE LIKE ?",
198
			"SUBJECT LIKE ?" }, additional = 1, isAnd = false) String key,
199
											  int rows) throws SQLException;
200

181
	@Exclude("articleContent")
201
	@Exclude("articleContent")
182
	@SelectList
202
	@SelectList
183
	@OrderBy(" ORDER BY MODIFY_TIME DESC ")
203
	@OrderBy(" ORDER BY MODIFY_TIME DESC ")

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

904
	public PageQueryResult<Article> pgPublishNotInPlatform(@JdbcConn Connection con,String pid,@Nullable String key,@DefaultValue("10") int pageSize,@DefaultValue("1") int pageNo)throws SQLException {
904
	public PageQueryResult<Article> pgPublishNotInPlatform(@JdbcConn Connection con,String pid,@Nullable String key,@DefaultValue("10") int pageSize,@DefaultValue("1") int pageNo)throws SQLException {
905
			return this.articleDao.publishInPlatform(con,pid,key,pageSize,pageNo);
905
			return this.articleDao.publishInPlatform(con,pid,key,pageSize,pageNo);
906
	}
906
	}
907
	
907

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

915
	@Get
916
	@Path("/pqPublish")
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);
919
	}
908

920

909
	@Get
921
	@Get
910
	@Path("/qaForDesk")
922
	@Path("/qaForDesk")