本文整理了Java中com.jfinal.plugin.activerecord.Db.getSqlPara()
方法的一些代码示例,展示了Db.getSqlPara()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Db.getSqlPara()
方法的具体详情如下:
包路径:com.jfinal.plugin.activerecord.Db
类名称:Db
方法名:getSqlPara
暂无
代码示例来源:origin: yjjdick/sdb-mall
public List<ProductCategory> queryListOrder(){
SqlPara sqlPara = Db.getSqlPara("productCategory.queryListOrder");
return this.find(sqlPara);
}
}
代码示例来源:origin: yjjdick/sdb-mall
public List<SysMenu> queryNotButtonList() {
SqlPara sqlPara = Db.getSqlPara("sysMenu.queryNotButtonList");
return this.find(sqlPara);
}
}
代码示例来源:origin: yjjdick/sdb-mall
public SysUser queryByUserName(String name) {
SqlPara sqlPara = Db.getSqlPara("sysUser.queryByUserName", Kv.by("username", name));
SysUser sysUserList = this.findFirst(sqlPara);
return sysUserList;
}
}
代码示例来源:origin: pkanyue/jboot-admin
@Override
public List<Role> findByUserName(String name) {
SqlPara sp = Db.getSqlPara("system-role.findByUserName");
sp.addPara(name);
return DAO.find(sp);
}
代码示例来源:origin: yjjdick/sdb-mall
@Override
public List<ProductDTO> listDetailByProductIds(String productIds) {
String[] productIdArr = productIds.split(",");
SqlPara sqlPara = Db.getSqlPara("product.listDetailByProductIds", Kv.by("productIds", productIdArr));
List<Record> recordList = Db.find(sqlPara);
List<ProductDTO> productDTOList = RecordUtils.converModel(recordList, ProductDTO.class);
return productDTOList;
}
代码示例来源:origin: yjjdick/sdb-mall
public List<Long> queryAllMenuId(Long userId) {
SqlPara sqlPara = Db.getSqlPara("sysUser.queryAllMenuId", Kv.by("userId", userId));
List<Record> sysMenuList = Db.find(sqlPara);
List<Long> menuIds = new ArrayList<>();
for (Record r:sysMenuList
) {
if(r == null || r.get("menu_id") == null) {
continue;
}
menuIds.add(r.get("menu_id"));
}
return menuIds;
}
代码示例来源:origin: yjjdick/sdb-mall
@Override
public List<CartDTO> listDetail(String userId) {
SqlPara sqlPara = Db.getSqlPara("cart.listDetail", Kv.by("userId", userId));
List<Record> recordList = Db.find(sqlPara);
List<CartDTO> cartDTOList = RecordUtils.converModel(recordList, CartDTO.class);
return cartDTOList;
}
}
代码示例来源:origin: yjjdick/sdb-mall
@Override
public List<FavoriteGoodsDTO> list(String userId) {
SqlPara sqlPara = Db.getSqlPara("favoriteGoods.list", Kv.by("userId", userId));
List<Record> recordList = Db.find(sqlPara);
List<FavoriteGoodsDTO> favoriteGoodsDTOList = RecordUtils.converModel(recordList, FavoriteGoodsDTO.class);
return favoriteGoodsDTOList;
}
}
代码示例来源:origin: yjjdick/sdb-mall
@Override
public Boolean updateByGrouponId(String grouponId,Integer status) {
SqlPara sqlPara = Db.getSqlPara("order.updateByGrouponId", Kv.by("orderStatus", status).set("grouponId", grouponId));
return Db.update(sqlPara) > 0;
}
代码示例来源:origin: pkanyue/jboot-admin
@Override
public List<Res> findByRoleIdAndStatusUsed(Long id) {
SqlPara sp = Db.getSqlPara("system-res.findByRoleIdAndStatusUsed");
sp.addPara(ResStatus.USED);
sp.addPara(RoleStatus.USED);
sp.addPara(id);
return DAO.find(sp);
}
代码示例来源:origin: yjjdick/sdb-mall
public List<M> findByFilters(List<Filter> filters){
SqlPara sqlPara = Db.getSqlPara("common.findList", Kv.by("filters", filters).set("tableName", this.getTableName()));
List<M> modelList = this.modelManager.find(sqlPara);
return modelList;
}
代码示例来源:origin: pkanyue/jboot-admin
@Override
public List<Res> findByUserNameAndStatusUsed(String name) {
SqlPara sp = Db.getSqlPara("system-res.findByUserNameAndStatusUsed");
sp.addPara(ResStatus.USED);
sp.addPara(RoleStatus.USED);
sp.addPara(name);
return DAO.find(sp);
}
代码示例来源:origin: yjjdick/sdb-mall
@Override
@JFinalTx
public void updateValueByKey(String key, String value) {
SqlPara sqlPara = Db.getSqlPara("sysConfig.updateValueByKey", Kv.by("paramValue", value).set("paramKey", key));
Db.update(sqlPara);
sysConfigRedis.delete(key);
}
代码示例来源:origin: yjjdick/sdb-mall
public Page<M> paginate(Integer pageNum, Integer pageSize, List<Filter> filters, List<Order> orders) {
SqlPara sqlPara = Db.getSqlPara("common.findList", Kv.by("filters", filters).set("orders", orders).set("tableName", this.getTableName()));
Page<M> pr = this.modelManager.paginate(pageNum, pageSize, sqlPara);
return pr;
}
代码示例来源:origin: pkanyue/jboot-admin
@Override
public List<Res> findLeftMenuByUserNameAndPid(String name, Long pid) {
SqlPara sp = Db.getSqlPara("system-res.findLeftMenuByUserNameAndPid");
sp.addPara(ResStatus.USED);
sp.addPara(RoleStatus.USED);
sp.addPara(pid);
sp.addPara(name);
return DAO.find(sp);
}
代码示例来源:origin: pkanyue/jboot-admin
@Override
public List<Res> findTopMenuByUserName(String name) {
SqlPara sp = Db.getSqlPara("system-res.findTopMenuByUserName");
sp.addPara(ResStatus.USED);
sp.addPara(RoleStatus.USED);
sp.addPara(0L);
sp.addPara(name);
return DAO.find(sp);
}
代码示例来源:origin: yjjdick/sdb-mall
public M findFirstByModel(M model){
Record record = model.toRecord();
SqlPara sqlPara = Db.getSqlPara("common.findByModel", Kv.by("record", record.getColumns()).set("tableName", this.getTableName()));
return this.modelManager.findFirst(sqlPara);
}
代码示例来源:origin: yjjdick/sdb-mall
public List<M> findByModel(M model){
Record record = model.toRecord();
SqlPara sqlPara = Db.getSqlPara("common.findByModel", Kv.by("record", record.getColumns()).set("tableName", this.getTableName()));
return this.modelManager.find(sqlPara);
}
代码示例来源:origin: yjjdick/sdb-mall
public boolean deleteBatch(String[] columns, Object[]... ids) {
String[] primaryKeys = columns;
if (columns == null) {
primaryKeys = this.getPrimaryKeys();
}
SqlPara sqlPara = Db.getSqlPara("common.deleteBatch", Kv.by("ids", ids).set("primaryKeys", primaryKeys).set("tableName", this.getTableName()));
return Db.update(sqlPara) > 0;
}
代码示例来源:origin: yjjdick/sdb-mall
public boolean deleteByModel(M model){
Record record = model.toRecord();
SqlPara sqlPara = Db.getSqlPara("common.deleteByModel", Kv.by("record", record.getColumns()).set("tableName", this.getTableName()));
return Db.update(sqlPara) > 0;
}
内容来源于网络,如有侵权,请联系作者删除!