XMTT 7 年之前
父節點
當前提交
370befa0dc

+ 10 - 0
src/main/java/com/ekexiu/portal/dao/ResourceDao.java

@ -5,7 +5,9 @@ import com.ekexiu.portal.po.Professor;
5 5
import com.ekexiu.portal.po.Resource;
6 6
import com.ekexiu.portal.pojo.EditProfessor;
7 7
import org.jfw.apt.annotation.Autowrie;
8
import org.jfw.apt.annotation.DefaultValue;
8 9
import org.jfw.apt.annotation.Nullable;
10
import org.jfw.apt.orm.annotation.dao.Column;
9 11
import org.jfw.apt.orm.annotation.dao.DAO;
10 12
import org.jfw.apt.orm.annotation.dao.Dynamic;
11 13
import org.jfw.apt.orm.annotation.dao.method.From;
@ -17,6 +19,7 @@ import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
17 19
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
18 20
import org.jfw.apt.orm.annotation.dao.method.operator.LimitSelect;
19 21
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
22
import org.jfw.apt.orm.annotation.dao.method.operator.QueryVal;
20 23
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
21 24
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
22 25
import org.jfw.apt.orm.annotation.dao.method.operator.Update;
@ -1836,4 +1839,11 @@ public abstract class ResourceDao {
1836 1839
		}
1837 1840
		return ret.isEmpty()?null:ret.toArray(new String[ret.size()]);		
1838 1841
	}
1842

1843
    @DefaultValue("0")
1844
    @QueryVal
1845
    @Where("STATUS = '1'")
1846
    @Column(value = "COUNT(1)", handlerClass = LongHandler.class)
1847
    @From(Resource.class)
1848
    public abstract long countPublish(Connection con, String articleType, @GroupSqlColumn(handlerClass = StringHandler.class, value = {"PROFESSOR_ID = ?", "ORG_ID = ?"}, isAnd = false) String owner) throws SQLException;
1839 1849
}

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

@ -1052,4 +1052,10 @@ public class ResourceService {
1052 1052
		}
1053 1053
		return Collections.<Resource>emptyList();
1054 1054
	}
1055

1056
	@Get
1057
	@Path("/count/publish")
1058
	public long countPublish(@JdbcConn Connection con, String category, String owner) throws SQLException {
1059
		return this.resourceDao.countPublish(con, category, owner);
1060
	}
1055 1061
}