sqlmap映射继承机制及映射字段顺序与SQL查询字段顺序无关
<typeAlias alias="TblSpPartsinfo" type="com.bn.car.biz.supply.dao.po.PartsInfoPO"/>
<resultMap class="TblSpPartsinfo" id="TblSpPartsinfoResultMap">
<result property="id" column="id"/>
<result property="partsCode" column="parts_code"/>
<result property="partsName" column="parts_name"/>
<result property="bigTitle" column="big_title"/>
<result property="smallTitle" column="small_title"/>
<result property="storeNum" column="store_num"/>
<result property="grade" column="grade"/>
<result property="costPrice" column="cost_price"/>
<result property="marketPrice" column="market_price"/>
<result property="retailPrice" column="retail_price"/>
<result property="weight" column="weight"/>
<result property="weightUnit" column="weight_unit"/>
<result property="vol" column="vol"/>
<result property="volUnit" column="vol_unit"/>
<result property="partsIntroduce" column="parts_introduce"/>
<result property="specification" column="specification"/>
<result property="packagingList" column="packaging_list"/>
<result property="brandIntroduce" column="brand_introduce"/>
<result property="usage" column="usage"/>
<result property="aftersaleService" column="aftersale_service"/>
<result property="createdDate" column="created_date"/>
<result property="creater" column="creater"/>
<result property="modifiedDate" column="modified_date"/>
<result property="modifier" column="modifier"/>
<result property="flag" column="flag"/>
<result property="fPartsbrandId" column="f_partsbrand_id"/> <result property="fPartstypeId" column="f_partstype_id"/>
<result property="fSupplyinfoId" column="f_supplyinfo_id"/>
<result property="updown" column="updown"/>
<result property="recommend" column="recommend"/>
<result property="partsSource" column="parts_source"/>
<result property="fPartstypeId2" column="f_partstype_id2"/>
<result property="unionFlag" column="union_flag"/>
</resultMap>
<!-- 组合产品子产品 -->
<resultMap class="TblSpPartsinfo" id="TblSpPartsinfoResultMapWithUnion" extends="TblSpPartsinfoResultMap">
<result property="lessPrice" column="less_price"/>
<result property="newPrice" column="new_price"/>
</resultMap>
<resultMap class="TblSpPartsinfo" id="TblSpPartsinfoResultMapBaoyang" extends="TblSpPartsinfoResultMap">
<result property="fCareId" column="f_care_id"/>
<result property="fCareItemId" column="f_care_item_id"/>
</resultMap>
注意:extends="TblSpPartsinfoResultMap" 表示继承关系。
映射的字段顺序无关~!!,但是数量,名称与sql查询语句相等,名称写错了会报错,因为映射找不到。
sqlmap映射继承机制及映射字段顺序与SQL查询字段顺序无关的更多相关文章
- Mybatis按SQL查询字段的顺序返回查询结果
在SpringMVC+Mybatis的开发过程中,可以通过指定resultType="hashmap"来获得查询结果,但其输出是没有顺序的.如果要按照SQL查询字段的顺序返回查询结 ...
- sql查询字段是否为空
sql 查询某字段为空 select * from 表名 where 字段名 is null sql 查询某字段不为空 select * from 表名 where 字段名 is not null s ...
- Mybatis按照SQL查询字段的顺序返回查询结果,使用resultType="java.util.LinkedHashMap"
在使用Mybatis开发时,Mybatis返回的结果集就是个map,当返回map时只需要做好SQL映射就好了,减少了代码量,简单便捷,缺点是不太方便维护,但是写大量的vo类去返回也挺累的,这个看你个人 ...
- SQL查询字段,起别名,列参与数学运算
13.简单查询 13.1.查询一个字段? select 字段名 from 表名: 其中要注意: select和from都是关键字 字段名和表名都是标识符. 强调: 对于SQL语句说,是通用的 所有的S ...
- sql 查询字段是中文/英文/数字 正则表达式
一.包含中文字符 select * from 表名 where 列名 like '%[吖-座]%' 二.包含英文字符 select * from 表名 where 列名 like '%[a-z]%' ...
- SQL 查询字段为值不为空
方法一sql="select * from table where id<>null " or sql="select ...
- sql 查询字段如果为null 则返回0的写法
oracle select nvl(字段名,0) from 表名; ----------------------------------- sqlserver select isnull(字段名,0) ...
- sql查询字段中的值长度最大的记录
SELECT max(length(字段)) FROM 表名;
- sql查询字段值长度判断是否18位
SELECT * FROM 表名 WHERE LENGTH(字段)= OR 字段为null IS NULL OR 字段为空='' SELECT * FROM 表名 WHERE LENGTH(字段)&g ...
随机推荐
- 我是如何自学Android,资料分享
我是如何自学Android,资料分享(2015 版) 已经完成,我的建议是先把这一篇看完,再看2015 版的.关于我在学习中开发的项目代码,已经发布在: 爱开发-源码搜索,集成了上万个App源码 ...
- select into 、 insert into select 、create table as select复制表
Insert是T-sql中常用语句,Insert INTO table(field1,field2,...) values(value1,value2,...)这种形式的在应用程序开发中必不可少.但 ...
- 第五篇、iOS常用的工具 app icon 、office文件格式互转、在线HTML编辑器、16、10进制互转
1.图片工厂,一键生成所以的应用图标 2.office文件转换格式 3.HTML在线编辑器 4.十六进制和十进制互转
- asp.net 文件操作小例子(创建文件夹,读,写,删)
静态生成要在虚拟目录下创建文件夹 来保存生成的页面 那么就要对文件进行操作 一.创建文件夹 using System.IO; string name = "aa"; strin ...
- C# 高精度加法 支持小数(待优化)
直接上代码 实现思路: 1.首先小数点补 位,9223372036854775808.9+9223372036854775808.9223372036854775808 => 922337203 ...
- 双网卡route配置
目前仅适用于windows: 192.168.*.*网段适用于上外网的 10网段适用于内网 route add 10.0.0.0 mask 255.0.0.0 10.34.6.1route add 1 ...
- C/C++笔试题目
1. C语言中无符号数与有符号数 unsigned ; ; printf( printf( ? 有符号数和无符号数在进行比较运算时(==,>=,<=,>,<),有符号数隐式的转 ...
- 全部省市县数据库(MySQL脚本) (转)
/*MySQL - 5.5.47 *************//*!40101 SET NAMES utf8 */; create table `base_area` ( `codeid` me ...
- ubuntu配置多个DNS
Ubuntu设置了静态IP地址,设置DNS,打开/etc/resolv.conf cat /etc/resolv.conf# Dynamic resolv.conf(5) file for glibc ...
- NHibernate各种查询
NHibernate各种查询 NHibernate's methods of querying are powerful, but there's a learning curve. Longer t ...