Sql sql = Sqls.create(" select\n" +
" ps.id as id,\n" +
" ps.user_id as userId,\n" +
" ps.provider_id as providerId,\n" +
" pbi.agent_id as agentId,\n" +
" ps.goods_category_id as goodsCategoryId,\n" +
" gc.goods_category_name as goodsCategoryName,\n" +
" GROUP_CONCAT(bs.service_type_name) as serviceTypeName,\n" +
" ps.apply_time as applyTime\n" +
" from provider_service_goods_category ps\n" +
" JOIN goods_category gc ON gc.id= ps.goods_category_id\n" +
" join provider_base_info pbi on pbi.id=ps.provider_id\n" +
" LEFT JOIN base_service_type bs ON bs.id= ps.service_type_id\n" +
" where pbi.agent_id=@agentId and ps.provider_id=@providerId" +
" GROUP BY ps.goods_category_id");
sql.setParam("agentId", agentId).setParam("providerId", providerId);
Sql execute = this.dao.execute(sql);
List list=execute.getList(GoodsAndServiceTypeAgent.class);//这里为Null 参数 粘贴到数据库执行 数据都没文艺 执行getList 拿不到为何
return list;
4 回复
// 设置回调
Sql sql = Sqls.create(....);
sql.setCallback(Sqls.callback.entities());
sql.setEntity(dao.getEntity(GoodsAndServiceTypeAgent.class));
// 等价于
Sql sql = Sqls.queryEntity(........);
sql.setEntity(dao.getEntity(GoodsAndServiceTypeAgent.class));
@wendal 多谢 已经搞定
添加回复
请先登陆