怎么实现前后台的一致!

public void statSaleBySingle(HttpServletRequest request,
HttpServletResponse response, HttpSession session,String dataType){
if(dataType=="0"){
String sql = "select ifnull(t1.Nums1,0)-ifnull(t2.Nums2,0) as value,t3.PRODNAME as label from "
+" (select sum(a.num) Nums1,PRODUCTS_ID from jxc_t_outbound_detailed a"
+" LEFT JOIN jxc_t_outbound_info b on a.OUTBOUND_ID=b.ID"
+" where left(b.TIME,4)='2016' GROUP BY PRODUCTS_ID"
+" ) t1 "
+" left join (select sum(c.num) Nums2,PRODUCTS_ID from jxc_t_outbound_revise_detailed c"
+" LEFT JOIN jxc_t_outbound_revise d on c.OUTBOUND_REVISE_ID=d.ID"
+" where left(d.TIME,4)='2016' GROUP BY PRODUCTS_ID"
+" ) t2 on t1.PRODUCTS_ID=t2.PRODUCTS_ID"
+" LEFT JOIN jxc_t_products t3 ON t1.PRODUCTS_ID=t3.ID"
+" order by value LIMIT 10";

    }
    try {
        response.setCharacterEncoding("UTF-8");
        response.getWriter().write(getDataJSON(request,dataType));
    } catch (IOException e) {
        e.printStackTrace();
    }
}

在controller中 这么写sql为什么会出错呀!怎么实现前后台的一致!需要怎么写呀!

1个回答

错误贴出来,,报的什么错看看,,

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐