当前位置: 首页 > news >正文

客户网站 备案网站分享

客户网站 备案,网站分享,wordpress主题免费分享,手机新机价格网站三个表:房间 玩家 玩家信息 知识点:Mybatis中级联有关联(association)、集合(collection)、鉴别器(discriminator)三种。其中,association对应一对一关系、collectio…

三个表:房间 + 玩家 + 玩家信息 

知识点:Mybatis中级联有关联(association)、集合(collection)、鉴别器(discriminator)三种。其中,association对应一对一关系、collection对应一对多关系、discriminator可以根据情况选择采用哪个类作为实例,关联不同的结果集。

参考文章:Mybatis级联:关联、集合和鉴别器的使用 - aaron_shu - 博客园

# room.javaprivate List<Player> player;public List<Player> getPlayer(){return player;}public void setPlayer(List<Player> player){this.player = player;}
<resultMap type="Room" id="RoomResult"><id     property="roomId"       column="room_id"      /><result property="roomTitle"     column="room_title"    /><result property="roomOwnerId"     column="room_owner_id"    /><result property="roomTags" column="room_tags" /><result property="scoreMode"  column="score_mode" /><result property="qrCode" column="qr_code" /><result property="appId" column="app_id" /><result property="isPlaten" column="is_platen" /><result property="userId" column="user_id" /><result property="shopId" column="shop_id" /><result property="status"       column="status"       /><result property="delFlag" 		column="del_flag" /><result property="remark"       column="remark"       /><result property="createBy"     column="create_by"    /><result property="createTime"   column="create_time"  /><result property="updateBy"     column="update_by"    /><result property="updateTime"   column="update_time"  /><collection property="player"    javaType="ArrayList"  ofType="Player" resultMap="playerResult" /></resultMap><resultMap id="playerResult" type="Player"><result property="roomId"    column="room_id"       /><result property="playerScore"     	column="player_score"    /><result property="isOnlooker"     	column="is_onlooker"    /><result property="userId"     		column="user_id"    /><association property="customerUser" javaType="CustomerUser"  resultMap="customerUserResult" /></resultMap><resultMap id="customerUserResult" type="CustomerUser"><result property="userId"    	column="user_id"       /><result property="nickName"     column="nick_name"    /><result property="avatar"       column="avatar"       /></resultMap><sql id="selectRoomVo">select d.room_id, d.room_title, d.room_owner_id, d.score_mode, d.room_tags, d.qr_code,d.app_id, d.is_platen, d.del_flag, d.user_id, d.shop_id,p.player_score, p.is_onlooker, p.user_id,c.nick_name, c.avatar,d.remark, d.status, d.create_by, d.update_by, d.create_time, d.update_timefrom tb_room dleft join tb_player p on p.room_id = d.room_idleft join tb_customer_user c on c.user_id = p.user_id</sql>

前端得到的json结构

{"msg": "操作成功","code": 200,"data": {"createBy": "","createTime": "2025-03-06 12:15:09","updateBy": "",,"delFlag": "1","player": [{"createBy": null,"customerUser": {"createBy": null,"createTime": null, "avatar": "https://img1.baidu.com/it/u=2587875867,850432697&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=800",}}]}
}

http://www.tj-hxxt.cn/news/95464.html

相关文章:

  • 哈尔滨企业网站东营网站建设制作
  • 青海企业网站制作精准引流的网络推广方法
  • 广 做网站蓝光电影下载50篇经典软文100字
  • 如何创建一个网站用来存放东西seo比较好的优化方法
  • 网站建设支付百度通用网址
  • 家在深圳坂田业主论坛东莞优化排名公司
  • 国外常用视频网站tenor怎么设置网络营销推广外包服务
  • 应持续抓好二级网站的建设工作武汉今日新闻头条
  • 免费的微网站制作torrentkitty搜索引擎
  • 作品集公司网站windows优化软件
  • 单位门户网站建设的请示如何做seo整站优化
  • 手机怎么提升网站流量nba排行榜最新排名
  • 数据库网站建设百度指数的主要用户是
  • 有什么做日结兼职的网站百度指数平台
  • 岳阳公司网站开发网络推广服务合同
  • 河北省建设机械协会网站是真的吗小广告怎么能弄干净
  • 网站商城维护怎么做竞价推广论坛
  • 西安专业网站建设服务好优化网站seo公司
  • 传销公司做网站运营seo的工作内容主要包括
  • seo实战培训费用石家庄seo代理商
  • 做一个公司官网怎么做seo咨询价格找推推蛙
  • DW怎么做招聘网站优化提升
  • 注册做网站的营业执照哪些浏览器可以看禁止访问的网站
  • 网页翻译为中文优化大师怎么样
  • 中国网站今日国内新闻摘抄十条
  • iis的默认网站没有自动启动最新百度关键词排名
  • 成都学网站建设费用大连seo
  • 网站内部链接导向网站服务费一年多少钱
  • 电子商务网站建设和管理的含义表白网站制作
  • 织梦网站根目录标签珠海网络推广公司