@Results注解使用方法

Posted yangxiaobo-blog

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了@Results注解使用方法相关的知识,希望对你有一定的参考价值。

 1 @SelectProvider(type = HospitalSqlGenerator.class, method = "queryHospitalData")
 2     @Results(
 3             @Result(column = "id", property = "id"),
 4             @Result(column = "hec_class", property = "hecClass"),
 5             @Result(column = "hospital_type", property = "hospitalType"),
 6             @Result(column = "hospital_nature", property = "hospitalNature"),
 7             @Result(column = "hospital_class", property = "hospitalClass"),
 8             @Result(column = "coin_subs_index", property = "coinSubsIndex"),
 9             @Result(column = "hospital_status", property = "hospitalStatus"),
10             @Result(column = "hec_belong", property = "hecBelong"),
11             @Result(column = "hec_class", property = "hecClassDO", one = @One(select = "cn.com.dyg.work.dao.DefDocDAO.selectByID")),
12             @Result(column = "hospital_type", property = "hospitalTypeDO", one = @One(select = "cn.com.dyg.work.dao.DefDocDAO.selectByID")),
13             @Result(column = "hospital_nature", property = "hospitalNatureDO", one = @One(select = "cn.com.dyg.work.dao.DefDocDAO.selectByID")),
14             @Result(column = "hospital_class", property = "hospitalClassDO", one = @One(select = "cn.com.dyg.work.dao.DefDocDAO.selectByID")),
15             @Result(column = "coin_subs_index", property = "coinSubsIndexDO", one = @One(select = "cn.com.dyg.work.dao.DefDocDAO.selectByID")),
16             @Result(column = "hospital_status", property = "hospitalStatusDO", one = @One(select = "cn.com.dyg.work.dao.DefDocDAO.selectByID")),
17             @Result(column = "hec_belong", property = "hecBelongDO", one = @One(select = "cn.com.dyg.work.dao.DefDocDAO.selectByID")),
18 
19             @Result(column = "creator", property = "creator"),
20             @Result(column = "creator", property = "creatorDO", one = @One(select = "cn.com.dyg.work.dao.PubToolDAO.getUserByUserID")),
21 
22             @Result(column = "modifier", property = "modifier"),
23             @Result(column = "modifier", property = "modifierDO", one = @One(select = "cn.com.dyg.work.dao.PubToolDAO.getUserByUserID"))
24     )
25     List<HospitalDO> selectAllByCondition(@Param("jsonArray") JSONArray jsonArray, @Param("flag") boolean isNotCount, @Param("isExport") boolean isExport);

 

以上是关于@Results注解使用方法的主要内容,如果未能解决你的问题,请参考以下文章

mybatis 注解@Results@Result@ResultMap@One的使用

MyBatis注解开发的两种方法@Results和resultMap

mybatis 注解开发

使用SMM框架开发企业级应用-----mybatis注解

@Results用法总结

Mybatis 系列11-注解复杂关系映射