关于mybatis中数据表多表交互处理
来源:互联网 发布:python cdll 编辑:程序博客网 时间:2024/05/29 13:24
多表关联 :
多对多:
<!-- 多表级联查询 -->
<select id="selectMobileUserDetail" resultMap="MobileUserBeanRes">
select
c.*,
d.*,
u.*
from
crownmobileuser c,
user_productdetail u,
crownproductdetail d
where c.id = u.mobileuserid and u.productdetailid = d.id and c.username = #{username}
</select>
<resultMap type="com.proxy.crown.bean.MobileUserBeanRes" id="MobileUserBeanRes">
<result property="id" column="user_id" />
<result property="username" column="username" />
<result property="password" column="password" />
<result property="identifycode" column="identifycode" />
<collection property="mobileUserProductBeans" javaType="java.util.List" ofType="com.proxy.crown.bean.MobileUserProductBean">
<id property="id" column="userproduct_id" />
<result property="productdetailid" column="productdetailid" />
<result property="mobileuserid" column="mobileuserid" />
</collection>
<collection property="resultData" javaType="java.util.List" ofType="com.proxy.crown.bean.ProductDetailBean">
<id property="id" column="product_id" />
<result column="productdetailname" property="productdetailname" jdbcType="VARCHAR" />
<result column="productdetailrelationtype" property="productdetailrelationtype" jdbcType="VARCHAR" />
<result column="productdetailsupplier" property="productdetailsupplier" jdbcType="VARCHAR" />
<result column="productdetailsupplierphone" property="productdetailsupplierphone" jdbcType="VARCHAR" />
<result column="productdetaildistributor" property="productdetaildistributor" jdbcType="VARCHAR" />
<result column="productdetailtype" property="productdetailtype" jdbcType="VARCHAR" />
<result column="productdetailhandlingperson" property="productdetailhandlingperson" jdbcType="VARCHAR" />
<result column="productdetailaddress" property="productdetailaddress" jdbcType="VARCHAR" />
<result column="productdetaildesc" property="productdetaildesc" jdbcType="VARCHAR" />
<result column="productdetailnum" property="productdetailnum" jdbcType="VARCHAR" />
<result column="productid" property="productid" jdbcType="INTEGER" />
<result column="productname" property="productname" jdbcType="VARCHAR" />
</collection>
</resultMap>
- 关于mybatis中数据表多表交互处理
- Mybatis中关于时间的处理
- mybatis数据表多对多
- 关于Android中webview交互弹出网页对话框的处理
- 在mybatis中动态创建数据表
- 关于mybatis中动态修改sql 的问题处理
- 关于MySQL中数据表中中文字符
- [Java6]关于多表数据库操作时DB语句的处理问题小议:与DB交互
- 两岸快捷中,数据表处理总结
- [求教] - 关于ASP中如何对数据表字段中所包含的特殊字符 ' 与 " 进行转义处理?
- 数据库数据表交互信息
- 关于mybatis传空值的处理
- mybatis中类属性和数据表字段不一致的解决方法
- mybatis generator无法将数据表中text字段映射问题
- zeoslib:程序中删除数据表后,GetTableNames语句仍然显示该表存在的处理
- mybatis实现数据表联合
- 删除数据表中所有表
- mybatis中0的处理
- 走进大数据,学习路线
- mysql命令
- WOJ1038-Help!
- Android Service学习笔记--用户通知
- 微信小程序商品详情页的底部弹出框
- 关于mybatis中数据表多表交互处理
- java异常
- 事件分发机制---ViewGroup
- 六、python urllib2请求json数据
- 打印出二叉树中结点值的和为输入整数的所有路径
- zookeeper的安装与部署-集群
- Java中的char类型以及不建议使用的原因
- 欢迎使用CSDN-markdown编辑器
- 个人复习指南——针对自我