基本数据类型:
xml配置文件:
<select id="getUnitNum" resultType="int">
dao层:
int getUnitNum();
server层:
public int getUnitNum(){return goodsDao.getUnitNum();}
controller层:
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);