|
@ -5,6 +5,7 @@ import org.jfw.apt.annotation.Nullable;
|
5
|
5
|
import org.jfw.apt.orm.annotation.dao.Column;
|
6
|
6
|
import org.jfw.apt.orm.annotation.dao.DAO;
|
7
|
7
|
import org.jfw.apt.orm.annotation.dao.method.From;
|
|
8
|
import org.jfw.apt.orm.annotation.dao.method.LimitColumn;
|
8
|
9
|
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
|
9
|
10
|
import org.jfw.apt.orm.annotation.dao.method.Select;
|
10
|
11
|
import org.jfw.apt.orm.annotation.dao.method.SetSentence;
|
|
@ -131,22 +132,37 @@ public abstract class WareDao {
|
131
|
132
|
public abstract List<CountWare> queryByOwner(Connection con,
|
132
|
133
|
@Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = { "NAME LIKE ?", "CNT LIKE ?", "KEYWORDS LIKE ?" }, isAnd = false) String key,
|
133
|
134
|
String owner) throws SQLException;
|
134
|
|
|
|
135
|
|
135
|
136
|
@LimitSelect
|
136
|
137
|
@OrderBy(" ORDER BY PAGE_VIEWS DESC")
|
137
|
138
|
@Where("STATE='1'")
|
138
|
|
public abstract List<Ware> queryByOwnerWithPageViews(Connection con,String category,String owner,@Nullable @UnEquals String id, int rows)throws SQLException;
|
139
|
|
|
|
139
|
public abstract List<Ware> queryByOwnerWithPageViews(Connection con, String category, String owner, @Nullable @UnEquals String id, int rows)
|
|
140
|
throws SQLException;
|
|
141
|
|
140
|
142
|
@LimitSelect
|
141
|
143
|
@OrderBy("ORDER BY MODIFY_TIME DESC")
|
142
|
144
|
@Where("STATE='1'")
|
143
|
|
public abstract List<Ware> queryByResource(Connection con,@SqlColumn(handlerClass=StringHandler.class, value = { "ID IN (SELECT ID FROM WARE_RES WHERE RESOURCE=?)" }) String id,int rows)throws SQLException;
|
|
145
|
public abstract List<Ware> queryByResource(Connection con,
|
|
146
|
@SqlColumn(handlerClass = StringHandler.class, value = { "ID IN (SELECT ID FROM WARE_RES WHERE RESOURCE=?)" }) String id, int rows)
|
|
147
|
throws SQLException;
|
|
148
|
|
144
|
149
|
@LimitSelect
|
145
|
150
|
@OrderBy("ORDER BY MODIFY_TIME DESC")
|
146
|
151
|
@Where("STATE='1'")
|
147
|
|
public abstract List<Ware> queryByArticle(Connection con,@SqlColumn(handlerClass=StringHandler.class, value = { "ID IN (SELECT WARE FROM ARTICLE_WARE WHERE ID=?)" }) String id,int rows) throws SQLException;
|
148
|
|
|
149
|
|
|
|
152
|
public abstract List<Ware> queryByArticle(Connection con,
|
|
153
|
@SqlColumn(handlerClass = StringHandler.class, value = { "ID IN (SELECT WARE FROM ARTICLE_WARE WHERE ID=?)" }) String id, int rows)
|
|
154
|
throws SQLException;
|
|
155
|
|
|
156
|
@LimitSelect
|
|
157
|
@Where("STATE='1'")
|
|
158
|
@OrderBy(cols = { @LimitColumn(value = "sortFirst", asc = false, handlerClass = LongHandler.class), @LimitColumn(value = "modifyTime", asc = false),
|
|
159
|
@LimitColumn(value = "id", asc = false) }, value = "")
|
|
160
|
public abstract List<Ware> indexSearch(Connection con,
|
|
161
|
@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,
|
|
164
|
long sortFirst, String modifyTime, String id, int rows) throws SQLException;
|
|
165
|
|
150
|
166
|
public List<Ware> indexSeach(Connection con, String key, long sortFirst, String modifyTime, String id, int rows) throws SQLException {
|
151
|
167
|
List<Ware> result = new ArrayList<Ware>(rows);
|
152
|
168
|
StringBuilder sb = new StringBuilder();
|