public List<GiveMyDistributorBean> queryDistriWithNoGoods(Long parentId, List<Long> goodIds, int skip, int max) {

Map<String, Object> param = new HashMap<String, Object>();

param.put("parentId", parentId);

param.put("goodsId", goodIds);

List<GiveMyDistributorBean> list = distriShopEditDao.getPublicDAO().selectBySqlMapId(

"selectDistributorByParentAndGoods", param, skip, max);

return list;

}


IBatis代码:

select *

   FROM TB_UNITE_DS_DISTRIBUTOR_EDIT A

   WHERE A.PARENT_ID=#parentId#

 AND A.DISTRIBUTOR_ID  NOT IN (SELECT DISTRIBUTOR_ID FROM TB_UNITE_DS_GOODS G WHERE G.GOODS_ID IN

 <iterate property="goodsId" conjunction="," open="(" close=")">

             #goodsId[]#

 </iterate>

 )


======================

后台查询代码:

HashMap hMap = (HashMap) this.payinstDao.getPublicDAO().selectFirstRowBySqlMapId("getUnCheckPayInstCountByOrdersId", objParam);

int payNum = ((java.math.BigDecimal) hMap.get("COUNTER")).intValue();


IBatis代码:

<select id="getUnCheckPayInstCountByOrdersId" resultClass="java.util.HashMap"  > 

     SELECT COUNT(*) COUNTER FROM tb_unite_order_payinst A WHERE A.ORDER_CODE = #orderCode:VARCHAR# 

     AND A.CHECK_RESULT in ('00','11','22','33','77') AND A.PAYINST_ID != #payinstId:NUMERIC# 

   </select>