mybatis select标签中resultMap和resultType作用区别
来源:互联网 发布:spss调查问卷数据录入 编辑:程序博客网 时间:2024/04/30 17:08
resultMap是取上面的resultMap封装好的数据表字段,resultType能直接写在domain和dto写的自己构造的Bean,
resultMap里写的应该是上面resultMap里的id值,resultType里写的是自己构造Bean的路径位置。下面是代码:
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"><mapper namespace="com.edi.mapper.WsShipmentMapper"> <resultMap id="BaseResultMap" type="com.edi.domain.WsShipment"> <id column="id" jdbcType="BIGINT" property="id" /> <result column="shipment_id" jdbcType="BIGINT" property="shipmentId" /> <result column="created_user" jdbcType="VARCHAR" property="createdUser" /> <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" /> <result column="last_updated_time" jdbcType="TIMESTAMP" property="lastUpdatedTime" /> <result column="last_updated_user" jdbcType="VARCHAR" property="lastUpdatedUser" /> <result column="status" jdbcType="VARCHAR" property="status" /> <result column="shop_id" jdbcType="INTEGER" property="shopId" /> <result column="platform_id" jdbcType="INTEGER" property="platformId" /> <result column="merchant_id" jdbcType="INTEGER" property="merchantId" /> <result column="shipping_id" jdbcType="TINYINT" property="shippingId" /> <result column="tracking_number" jdbcType="VARCHAR" property="trackingNumber" /> <result column="print_count" jdbcType="TINYINT" property="printCount" /> <result column="facility_id" jdbcType="TINYINT" property="facilityId" /> <result column="shipping_self_weight" jdbcType="DECIMAL" property="shippingSelfWeight" /> <result column="shipping_out_weight" jdbcType="DECIMAL" property="shippingOutWeight" /> <result column="shipping_service_fee" jdbcType="DECIMAL" property="shippingServiceFee" /> <result column="shipping_insured_cost" jdbcType="DECIMAL" property="shippingInsuredCost" /> <result column="estimated_shipping_fee" jdbcType="DECIMAL" property="estimatedShippingFee" /> <result column="confirm_time" jdbcType="TIMESTAMP" property="confirmTime" /> <result column="schedule_time" jdbcType="TIMESTAMP" property="scheduleTime" /> <result column="bind_time" jdbcType="TIMESTAMP" property="bindTime" /> <result column="create_batchpick_time" jdbcType="TIMESTAMP" property="createBatchpickTime" /> <result column="print_time" jdbcType="TIMESTAMP" property="printTime" /> <result column="shipping_time" jdbcType="TIMESTAMP" property="shippingTime" /> <result column="print_user_id" jdbcType="INTEGER" property="printUserId" /> <result column="ship_user_id" jdbcType="INTEGER" property="shipUserId" /> <result column="waybill_user_id" jdbcType="INTEGER" property="waybillUserId" /> <result column="waybill_time" jdbcType="TIMESTAMP" property="waybillTime" /> <result column="goods_id" jdbcType="INTEGER" property="goodsId" /> <result column="product_id" jdbcType="INTEGER" property="productId" /> <result column="product_name" jdbcType="VARCHAR" property="productName" /> <result column="goods_number" jdbcType="INTEGER" property="goodsNumber" /> <result column="order_type" jdbcType="SMALLINT" property="orderType" /> <result column="order_status" jdbcType="TINYINT" property="orderStatus" /> <result column="receive_name" jdbcType="VARCHAR" property="receiveName" /> <result column="mobile" jdbcType="VARCHAR" property="mobile" /> <result column="province_id" jdbcType="SMALLINT" property="provinceId" /> <result column="province_name" jdbcType="VARCHAR" property="provinceName" /> <result column="city_id" jdbcType="SMALLINT" property="cityId" /> <result column="city_name" jdbcType="VARCHAR" property="cityName" /> <result column="district_id" jdbcType="SMALLINT" property="districtId" /> <result column="district_name" jdbcType="VARCHAR" property="districtName" /> <result column="shipping_address" jdbcType="VARCHAR" property="shippingAddress" /> <result column="out_order_sn" jdbcType="VARCHAR" property="outOrderSn" /> <result column="secrect_code" jdbcType="VARCHAR" property="secrectCode" /> <result column="order_sn_pad" jdbcType="BIGINT" property="orderSnPad" /> <result column="goods_name" jdbcType="VARCHAR" property="goodsName" /> <result column="address_name" jdbcType="VARCHAR" property="addressName" /> <result column="send_oms_time" jdbcType="TIMESTAMP" property="sendOmsTime" /> <result column="weight_user_id" jdbcType="INTEGER" property="weightUserId" /> <result column="weight_time" jdbcType="TIMESTAMP" property="weightTime" /> <result column="handle_time" jdbcType="TIMESTAMP" property="handleTime" /> <result column="shipping_due_time" jdbcType="TIMESTAMP" property="shippingDueTime" /> </resultMap> <resultMap id="ShipmentExt" type="com.edi.dto.WsShipmentExt" extends="BaseResultMap"> <result column="express_code" jdbcType="VARCHAR" property="expressCode" /> </resultMap> <select id="getDeliverysState" parameterType="java.lang.Integer" resultType="com.edi.dto.DeliverysState"> select s.status area_id,s.last_updated_user operator,s.last_updated_time operator_date from ws_shipment s where s.merchant_id = ${merchant_id} </select> <select id="getGyTradeDeliverys" parameterType="java.lang.Integer" resultType="com.edi.dto.GyTradeDeliverys"> select s.out_order_sn code,sc.shipping_code express_code,s.tracking_number mail_no from ws_shipment s inner join ws_shipping_code sc on sc.merchant_id = s.merchant_id and s.shipping_id = sc.shipping_id where s.merchant_id = ${merchant_id} </select></mapper>
0 0
- mybatis select标签中resultMap和resultType作用区别
- mybatis中resultMap和resultType的区别
- MyBatis中ResultMap和ResultType的区别
- MyBatis中resultType和resultMap的区别
- mybatis中resultmap和resulttype区别
- mybatis中resulttype和resultmap的区别
- MyBatis中resultType和resultMap的区别
- Mybatis中resultMap和resultType
- Mybatis中resultMap和resultType
- MyBatis中关于resultType和resultMap的区别
- MyBatis中关于resultType和resultMap的区别
- MyBatis中关于resultType和resultMap的区别
- ibatis中resultMap和resultClass(Mybatis的resultType)的区别
- MyBatis中关于resultType和resultMap的区别
- Mybatis中resultMap和resultType使用联系与区别
- mybatis中resultType和resultMap使用时的区别
- mybatis 中resultType与resultMap区别
- Mybatis中的resultType和resultMap 区别
- [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a
- Centos7 网络配置
- 更新会员积分
- 【机器学习】线性分类LogisticRegression
- 亲们,你们的tomcat并发能到多少?
- mybatis select标签中resultMap和resultType作用区别
- iOS仿QQ分组效果
- CSS你可能还不知道的一些知识点
- ueditor在鼠标后面添加内容
- Android receiver 多次启动相同Activity
- Wireshark网络抓包(三)——网络协议
- linux中软链接和硬链接
- PAT甲级练习1007. Maximum Subsequence Sum (25)
- vue-prop父组件向子组件进行传值