|
|
@@ -201,9 +201,10 @@ public class ArticleTweetImplDao implements ArticleTweetDao {
|
|
|
}
|
|
|
|
|
|
public int updateArticleTop(ArticleTweet articleTweet) {
|
|
|
- String sql = "update article_tweet set is_top=:isTop where id = :id";
|
|
|
+ String sql = "update article_tweet set is_top=:isTop,create_date=:createDate where id = :id";
|
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
|
sps.addValue("isTop", articleTweet.getIsTop());
|
|
|
+ sps.addValue("createDate", articleTweet.getCreateDate());
|
|
|
sps.addValue("id", articleTweet.getId());
|
|
|
int num = 0;
|
|
|
try {
|
|
|
@@ -595,7 +596,7 @@ public class ArticleTweetImplDao implements ArticleTweetDao {
|
|
|
leftSql +
|
|
|
innSql +
|
|
|
"where at.approve = 2 " + sqlWhere +
|
|
|
- "order by at.create_date desc ";
|
|
|
+ "order by at.is_top desc,at.create_date desc ";
|
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
|
sps.addValue("start", start);
|
|
|
sps.addValue("rows", rows);
|
|
|
@@ -927,7 +928,7 @@ public class ArticleTweetImplDao implements ArticleTweetDao {
|
|
|
"from article_tweet at\n" +
|
|
|
"left join hotel_dict hd on hd.id = at.location_id\n" +
|
|
|
"where at.approve = 2) t\n" +
|
|
|
- "order by t.like_num desc,t.create_date desc LIMIT 3";
|
|
|
+ "order by at.is_top desc, t.like_num desc,t.create_date desc LIMIT 3";
|
|
|
MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
|
List<ArticleLikeMaxVo> list = null;
|
|
|
try {
|
|
|
@@ -958,4 +959,12 @@ public class ArticleTweetImplDao implements ArticleTweetDao {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ public int updateUser(Admin admin){
|
|
|
+ String sql = "update `admin` set user_id=:userId where id=:id ";
|
|
|
+ MapSqlParameterSource sps = new MapSqlParameterSource();
|
|
|
+ sps.addValue("userId", admin.getUserId());
|
|
|
+ sps.addValue("id", admin.getId());
|
|
|
+ return namedParameterJdbcTemplate.update(sql, sps);
|
|
|
+ }
|
|
|
+
|
|
|
}
|