- 基本数据类型:
xml配置文件:
dao层:<select id="getUnitNum" resultType="int">
server层:int getUnitNum();
controller层:public int getUnitNum(){return goodsDao.getUnitNum();}
int num=goodsService.getUnitNum();
- 实体类类型:
xml配置文件:<resultMap id="GoodsResult" type="Goods" > <select id="selectIdByCreateFlag" resultMap="GoodsResult">
dao层:
Goods selectIdByCreateFlag(@Param("createFlag") String createFlag);
server层:
public Goods selectIdByCreateFlag(String createFlag){ return goodsDao.selectIdByCreateFlag(createFlag); }
controller层:
Goods goods = goodsService.selectIdByCreateFlag(createFlag);
- Map集合类型:
xml配置文件:<select id="selectStatusByUnit" resultType="map">
dao层:List<Map<String, Object>> selectStatusByUnit(@Param("unitName")String unitName);
server层:public List<Map<String, Object>> selectStatusByUnit(String unitName){ return goodsDao.selectStatusByUnit(unitName); }
controller层:List<Map<String,Object>> maplist = goodsService.selectStatusByUnit(unitName);