适用于一个属性下关联多个字段的查询,以及在页面上的追加 //接口 public String carFieldMoreDetail(Map mapStr) throws Exception {Map mapSqlParameter = new HashMap (); StringBuffer sql = new StringBuffer(); Gson gson
适用于一个属性下关联多个字段的查询,以及在页面上的追加
//接口
public String carFieldMoreDetail(Map
mapStr) throws Exception {
Map
mapSqlParameter = new HashMap
(); StringBuffer sql = new StringBuffer(); Gson gson = new Gson(); sql.append("SELECT ca.class_name,ca.class_id FROM car_attribute_class ca LEFT OUTER JOIN car_attribute c ON ca.class_id = c.class_id"); sql.append(" LEFT OUTER JOIN car_attribute_join cj ON c.attribute_id = cj.attribute_id WHERE cj.car_id = :car_id GROUP BY ca.class_name"); mapSqlParameter.put("car_id", mapStr.get("car_id")); List