赵江龙

Hi Girl

  • 主页
  • 教程
所有文章 友链 关于我

赵江龙

Hi Girl

  • 主页
  • 教程

MyBatis笔记

2019-07-18

记录一下MyBatis配置的笔记。

in条件拼接

1
2
3
4
5
6
7
8
<select id="getVoteTemplateKeys" resultMap="VoteTemplateKey" parameterType="java.util.List">
SELECT *
FROM TEM T
WHERE T.ID IN
<foreach collection="array" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</select>

多表查询xml

注解的方式:https://blog.csdn.net/qq_40348465/article/details/84718602
1 association:组合的方式
2 collection:集合的方式

1
2
3
4
5
6
7
8
9
10
11
<resultMap id="VoCustomer" type="com.entity.VoCustomer" extends="BaseResultMap">
<association property="voteRecord" javaType="com.entity.Vo">
<id column="C_RECORD_ID" property="cRecordId"/>
<result column="N_SCORE" property="nScore"/>
</association>
<collection property="keysList" ofType="com.entity.VoGeneral">
<result column="C_DESC" property="cDesc"/>
<result column="C_SCORETYPE" property="cScoretype"/>
<result column="N_ORDER" property="nOrder"/>
</collection>
</resultMap>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<resultMap id="BaseResultMap" type="cn.com.yusys.tkbb.entity.AddressCompanyCustomer">
<id column="acid" property="id" />
<result column="acname" property="name" />
<collection property="list" ofType="cn.com.yusys.tkbb.entity.AddressDepartmentCustomer">
<id column="adid" property="id" />
<result column="adname" property="name" />
<result column="acid" property="parent" />
<collection property="list" ofType="cn.com.yusys.tkbb.entity.AddressTeamCustomer">
<result column="batid" property="id" />
<result column="batname" property="name" />
<collection property="list" ofType="cn.com.yusys.tkbb.entity.AddressUserCustomer">
<id column="auid" property="id" />
<result column="auname" property="name" />
<result column="autel" property="tel" />
<result column="auemail" property="email" />
<result column="aufax" property="fax" />
<result column="aumemo" property="memo" />
</collection>
</collection>
</collection>
</resultMap>

java中在mybatis的配置文件中使用两个foreach问题

没有验证,不应该写的:https://blog.csdn.net/qq_20565303/article/details/79762351
“id” />







赏

谢谢你请我吃糖果

微信
  • MyBatis
  • 后端的坚持
  • 学习笔记

扫一扫,分享到微信

微信分享二维码
JavaScript格式化
MySql笔记
© 2019 赵江龙
Hexo Theme Yilia by Litten
  • 所有文章
  • 友链
  • 关于我

tag:

  • VUE传值
  • VUE通信
  • VUE共享数据
  • Kafa
  • ZooKeeper
  • HEXO
  • 博客
  • 产品设计规范
  • 前端CAKE
  • 前端笔记
  • 后端笔记
  • JAVA笔记
  • SpringBoot
  • VUE
  • TOMCAT
  • 域名
  • HTTPS
  • 响应式布局
  • 记录日志
  • AOP
  • 重装
  • Win10
  • 总结
  • 开发规范
  • Java多线程
  • 我的小站
  • JSX
  • MySql
  • webpack3
  • js格式化
  • Maven
  • MyBatis
  • Quartz
  • js计算
  • 官方教程
  • 河西走廊
  • 丝绸之路
  • 动态组件
  • 工厂函数
  • 正则表达式
  • GitHub
  • 开发总结
  • 网站开发规范
  • Slf4j
  • SEO优化
  • 生产环境
  • 优化
  • loading
  • 计算缩写
  • Excel
  • Excel公式
  • 读书
  • 后端渲染
  • 电影
  • github
  • 项目收集
  • JVM
  • mysql安装
  • webpack
  • 字符格式
  • 千分符
  • 生活
  • 衣服
  • 阿里云
  • web环境
  • 黑苹果
  • 教程
  • 离骚
  • SASS
  • MarkDown
  • Echart

    缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    3、在根目录_config.yml里添加配置:

      jsonContent:
        meta: false
        pages: false
        posts:
          title: true
          date: true
          path: true
          text: false
          raw: false
          content: false
          slug: false
          updated: false
          comments: false
          link: false
          permalink: false
          excerpt: false
          categories: false
          tags: true
    

  • 源起
  • 为什么写博客
  • yilia主题
  • 关于我
  • 真的我
喜欢玩,喜欢分享。
享受互联网的便利,也想分享些自己的东西。
希望在互联网的浪潮上,留下我的名字。