Browse Source

Merge branch 'dev' of http://www.ekexiu.com:3000/jiapeng/portal-web.git into dev

jiapeng 7 years ago
parent
commit
926d6ddc1a

+ 9 - 8
src/main/java/com/ekexiu/portal/ware/WareDao.java

1
package com.ekexiu.portal.ware;
1
package com.ekexiu.portal.ware;
2

2

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

3
import org.jfw.apt.annotation.DefaultValue;
7
import org.jfw.apt.annotation.DefaultValue;
4
import org.jfw.apt.annotation.Nullable;
8
import org.jfw.apt.annotation.Nullable;
5
import org.jfw.apt.orm.annotation.dao.Column;
9
import org.jfw.apt.orm.annotation.dao.Column;
30
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
34
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
31
import org.jfw.util.PageQueryResult;
35
import org.jfw.util.PageQueryResult;
32

36

33
import java.sql.Connection;
34
import java.sql.SQLException;
35
import java.util.List;
36

37
@DAO
37
@DAO
38
public abstract class WareDao {
38
public abstract class WareDao {
39

39

141
	@LimitSelect
141
	@LimitSelect
142
	@OrderBy("ORDER BY MODIFY_TIME DESC")
142
	@OrderBy("ORDER BY MODIFY_TIME DESC")
143
	@Where("STATE='1'")
143
	@Where("STATE='1'")
144

144
	public abstract List<Ware> queryByResource(Connection con,
145
	public abstract List<Ware> queryByResource(Connection con,
145
			@SqlColumn(handlerClass = StringHandler.class, value = { "ID IN (SELECT ID FROM WARE_RES WHERE RESOURCE=?)" }) String id, int rows)
146
			@SqlColumn(handlerClass = StringHandler.class, value = { "ID IN (SELECT ID FROM WARE_RES WHERE RESOURCE=?)" }) String id, int rows)
146
			throws SQLException;
147
			throws SQLException;
156
	@Where("STATE='1'")
157
	@Where("STATE='1'")
157
	@OrderBy(cols = { @LimitColumn(value = "sortFirst", asc = false, handlerClass = LongHandler.class), @LimitColumn(value = "modifyTime", asc = false),
158
	@OrderBy(cols = { @LimitColumn(value = "sortFirst", asc = false, handlerClass = LongHandler.class), @LimitColumn(value = "modifyTime", asc = false),
158
			@LimitColumn(value = "id", asc = false) }, value = "")
159
			@LimitColumn(value = "id", asc = false) }, value = "")
159
	public abstract List<Ware> indexSearch(Connection con, @Nullable
160
	@GroupSqlColumn(handlerClass = StringHandler.class, value = { "NAME LIKE ?", "CNT LIKE ?", "KEYWORDS LIKE ?",
161
			"CATEGORY='1' AND OWNER IN(SELECT ID FROM PROFESSOR WHERE NAME LIKE ?)",
162
			"CATEGORY ='2' AND OWNER IN(SELECT ID FROM ORGANIZATION WHERE NAME LIKE ? OR FOR_SHORT LIKE ?)" }, additional = 1, isAnd = false, force = true) String key,
160
	public abstract List<Ware> indexSearch(Connection con,
161
			@Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = { "NAME LIKE ?", "CNT LIKE ?", "KEYWORDS LIKE ?",
162
					"CATEGORY='1' AND OWNER IN(SELECT ID FROM PROFESSOR WHERE NAME LIKE ?)",
163
					"CATEGORY ='2' AND OWNER IN(SELECT ID FROM ORGANIZATION WHERE NAME LIKE ? OR FOR_SHORT LIKE ?)" }, additional = 1, isAnd = false, force = true) String key,
163
			long sortFirst, String modifyTime, String id, int rows) throws SQLException;
164
			long sortFirst, String modifyTime, String id, int rows) throws SQLException;
164

165

165
	@Update
166
	@Update

+ 5 - 4
src/main/java/com/ekexiu/portal/ware/WareService.java

264
	 */
264
	 */
265
	@Post
265
	@Post
266
	@Path("/draft/org")
266
	@Path("/draft/org")
267

267
	public String draft(@JdbcConn(true) Connection con,
268
	public String draft(@JdbcConn(true) Connection con,
268
			@RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Ware ware,
269
			@RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Ware ware,
269
			@Nullable String[] resource, @Nullable String[] professor) throws SQLException, IOException {
270
			@Nullable String[] resource, @Nullable String[] professor) throws SQLException, IOException {
366
	 */
367
	 */
367
	@Post
368
	@Post
368
	@Path("/publish/update")
369
	@Path("/publish/update")
370

369
	public boolean updatePublish(@JdbcConn(true) Connection con,
371
	public boolean updatePublish(@JdbcConn(true) Connection con,
370
			@RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Ware ware,
372
			@RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Ware ware,
371
			@Nullable String[] resource) throws SQLException, IOException {
373
			@Nullable String[] resource) throws SQLException, IOException {
800
		}
802
		}
801
	}
803
	}
802

804

803

804
	/**
805
	/**
805
	 * 后台管理系统中使用
806
	 * 后台管理系统中使用
806
	 */
807
	 */
843
	@Post
844
	@Post
844
	@Path("/publish/conUpdate")
845
	@Path("/publish/conUpdate")
845
	public boolean conUpdatePublish(@JdbcConn(true) Connection con,
846
	public boolean conUpdatePublish(@JdbcConn(true) Connection con,
846
								 @RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Ware ware,
847
								 @Nullable String[] resource,@Nullable String[] professor) throws SQLException, IOException {
847
			@RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Ware ware,
848
			@Nullable String[] resource, @Nullable String[] professor) throws SQLException, IOException {
848
		ware.setState("1");
849
		ware.setState("1");
849
		//ware.setCategory("1");
850
		// ware.setCategory("1");
850
		return conUpdate(con, ware, professor, resource);
851
		return conUpdate(con, ware, professor, resource);
851
	}
852
	}
852
}
853
}