代码如下,不知道怎么写
mvRankingService.update(org.nutz.dao.Chain.make("count", "count+1"), Cnd.where("movieId","=",mm.getId()).and("wxid", "=", wxid));
代码如下,不知道怎么写
mvRankingService.update(org.nutz.dao.Chain.make("count", "count+1"), Cnd.where("movieId","=",mm.getId()).and("wxid", "=", wxid));
@wendal 兽总,就这样写就ok?
/**
* 枚举类型
* 用于修改收藏量 添加或者修改
* @author zhangfan
*
*/
public enum Collection {
ADD_COLLECTION ("+"),
SUBTRACT_COLLECTION ("-");
private final String value;
Collection (String value) {
this.value = value;
}
public String getValue() {
return value;
}
}
/**
* 修改收藏量 (+/-) 1
* @param goodsId
* @param collection
* @return
*/
public boolean updateCollection (String goodsId, Collection collection) {
return goodsDao.update(Goods.class,
Chain.makeSpecial("collection_total", collection.getValue() + 1),
Cnd.where("id", "=", goodsId));
}
希望能给你带来灵感
Chain.makeSpecial("collection_total", “+1”)