一个参数,返回Map
<select id="getShopInfo" parameterClass="java.lang.String" resultClass="java.util.HashMap"> <![CDATA[ select distinct ib.ds_label as sblx, ro.name as xhmc, rip.modelnumber as xhbm, ris.numberno as cgsl from res_inst_Shoplist ris join res_reference rr on rr.sourceid = ris.id join res_inst_contract ric on rr.targetid = ric.id join res_reference rr2 on ris.id = rr2.sourceid join res_inst_PactDeviceModel rip on rr2.targetid = rip.id join itil_bizcode ib on ris.devicetype = ib.ds_id join res_object ro on rip.id = ro.id where ric.id = #value# ]]> </select>
@Override public PaginatedList getShopInfoList(String contractId) { PaginatedList list = this.getPagedSqlMapClientTemplate().queryForPaginatedList( NAMESPACE + "getShopInfo",contractId, PageInfoWrapper.NONE_PAGED); return list; }
多个参数,返回Map
<select id="getRecipientsChildList" parameterClass="map" resultClass="java.util.HashMap"> <![CDATA[ select distinct rir.id, ro.name as sghtmc, ric.partyb as cjf, o.name as sbxh, ib.ds_label as sblx, rir.numberno as sl, rir.unit, rir.recipients, rir.recipientstime, rir.flag, rir.unconfirmedreason from res_inst_recipientslist rir join res_reference rr on rr.id = rir.eqmodeloneth join res_inst_PactDeviceModel rid on rid.id = rr.targetid join res_object o on o.id = rid.id join itil_bizcode ib on rir.devicetype = ib.ds_id join res_reference rr2 on rir.id = rr2.sourceid join res_inst_contract ric on ric.id = rr2.targetid join res_object ro on ric.id = ro.id where rir.id in (select rr.sourceid from res_reference rr join res_inst_contract ric on rr.targetid = ric.id where ric.contractno = #contractNo#) and ric.contracttype = 'otherContractType' order by rir.flag,rir.recipientstime desc ]]> </select>
@Override public PaginatedList getRecipientsChildList(Map<String, Object> map) { PaginatedList list = this.getPagedSqlMapClientTemplate().queryForPaginatedList( NAMESPACE + "getRecipientsChildList",map, PageInfoWrapper.NONE_PAGED); return list; }
一个参数,返回String
<select id="seachWaitConfirmCount" resultClass="java.lang.String"> <![CDATA[ select count(distinct rir.id) as dqrsl from res_inst_Recipientslist rir join res_reference t on rir.id = t.sourceid join res_inst_contract ric on ric.id = t.targetid where ric.id = #contractId# and rir.flag = 0 ]]> </select>
@Override public String seachWaitConfirmCount(String contractId) { Map param = new HashMap(); param.put("contractId", contractId); String map = (String) this.getSqlMapClientTemplate().queryForObject( NAMESPACE + "seachWaitConfirmCount", param); return map; }