【mybatis】mybatis多表联查,存在一对多关系的,实体中使用List作为字段接收查询结果的写法...
?
實(shí)體如下:
IntegralGoods? 積分商品
IntegralGoodsImg 積分商品圖片
ShelfLog 積分商品自動(dòng)上架記錄
?
IntegralGoods :IntegralGoodsImg:ShelfLog = 1:n:1
1:1的多表聯(lián)查或者m:n的多表聯(lián)查 很簡(jiǎn)單,
現(xiàn)在出現(xiàn)1:n的情況,一種積分商品可能有多張圖片
所以在最后的返回結(jié)果里想用LIst<IntegralGoodsImg>作為IntegralGoods 的一個(gè)字段作為參數(shù)進(jìn)行接收
?
那mybatis怎么實(shí)現(xiàn)查詢呢?
=========================================================
1.IntegralGoods 實(shí)體【只關(guān)注字段即可】,尤其是
?
@Transient
private List<IntegralGoodsImg> imgList;//圖片們?
這個(gè)字段就是用來(lái)接收多個(gè)圖片實(shí)體的
package com.pisen.cloud.luna.ms.jifen.base.domain;import java.util.ArrayList; import java.util.Date; import java.util.List;import javax.persistence.*; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root;import org.apache.commons.lang3.StringUtils; import org.hibernate.annotations.Type; import org.springframework.data.jpa.domain.Specification;import com.pisen.cloud.luna.ms.jifen.base.common.BaseDomain;/*** 積分商品表*/ @Entity @Table(uniqueConstraints = { @UniqueConstraint(columnNames = { "uid" })}) public class IntegralGoods extends BaseDomain {public static final int DELETE_FLAG_DELETE = 1;//刪除public static final int DELETE_FLAG_DISDELETE = 0;//未刪除public static final int SHELF_ON = 1;//上架public static final int SHELF_OFF = 0;//下架public static final int SHOW_HOME_FLAG_YES = 1;//首頁(yè)展示public static final int SHOW_HOME_FLAG_NO = 0;//不在首頁(yè)展示 @Type(type = "text")private String description; //商品描述private String cdKey;//虛擬物品激活碼 ---棄用 @Column(nullable = false)private String name; // 名稱 @Column(nullable = false)private Float marketValue; // 原價(jià) @Column(nullable = false)private Integer integral; // 兌換積分private Integer type; // (1:實(shí)物 2:虛擬) @Column(nullable = false)private Integer stock; // 庫(kù)存數(shù)量(-1時(shí)無(wú)限量 : 正??鄢? @Column(nullable = false)private Integer saleNum; // 銷量 已兌換數(shù)量private Integer version;/*** ========新增字段===================*/@Column(nullable = false)private Integer limitNum;//限兌數(shù)量private String goodsCode;//商品編號(hào) @Column(nullable = false)private String specification;//商品規(guī)格 實(shí)物商品必填private Integer deleteFlag;//刪除標(biāo)識(shí) @Column(nullable = false)private Integer shelfFlag;//上架標(biāo)識(shí) @Column(nullable = false)private Integer homeShowFlag;//是否首頁(yè)展示private String remark; //備注 @Transientprivate String order;//排序字段 @Transientprivate String orderType;//排序方法 @Transientprivate String headImg;//首頁(yè)圖片 @Transientprivate List<String> imgUrlList;//接收前臺(tái)URL集合使用 @Transientprivate Date shelfDate;//上架時(shí)間 接收前臺(tái)字段 @Transientprivate Date obtainedDate;//下架時(shí)間 接收前臺(tái)字段private String shelfRemark;//上架信息 備注 @Transientprivate List<IntegralGoodsImg> imgList;//圖片們public String getRemark() {return remark;}public void setRemark(String remark) {this.remark = remark;}public String getShelfRemark() {return shelfRemark;}public void setShelfRemark(String shelfRemark) {this.shelfRemark = shelfRemark;}public Integer getHomeShowFlag() {return homeShowFlag;}public void setHomeShowFlag(Integer homeShowFlag) {this.homeShowFlag = homeShowFlag;}public Integer getShelfFlag() {return shelfFlag;}public void setShelfFlag(Integer shelfFlag) {this.shelfFlag = shelfFlag;}public Integer getLimitNum() {return limitNum;}public void setLimitNum(Integer limitNum) {this.limitNum = limitNum;}public String getGoodsCode() {return goodsCode;}public void setGoodsCode(String goodsCode) {this.goodsCode = goodsCode;}public String getSpecification() {return specification;}public void setSpecification(String specification) {this.specification = specification;}public Integer getDeleteFlag() {return deleteFlag;}public void setDeleteFlag(Integer deleteFlag) {this.deleteFlag = deleteFlag;}public List<IntegralGoodsImg> getImgList() {return imgList;}public void setImgList(List<IntegralGoodsImg> imgList) {this.imgList = imgList;}public Integer getVersion() {return version;}public void setVersion(Integer version) {this.version = version;}public String getOrder() {return order;}public void setOrder(String order) {this.order = order;}public String getOrderType() {return orderType;}public void setOrderType(String orderType) {this.orderType = orderType;}public String getName() {return name;}public void setName(String name) {this.name = name;}public Integer getIntegral() {return integral;}public void setIntegral(Integer integral) {this.integral = integral;}public String getDescription() {return description;}public void setDescription(String description) {this.description = description;}public String getCdKey() {return cdKey;}public void setCdKey(String cdKey) {this.cdKey = cdKey;}public Integer getType() {return type;}public void setType(Integer type) {this.type = type;}public Integer getStock() {return stock;}public void setStock(Integer stock) {this.stock = stock;}public Float getMarketValue() {return marketValue;}public void setMarketValue(Float marketValue) {this.marketValue = marketValue;}public String getHeadImg() {if(imgList != null){for (IntegralGoodsImg integralGoodsImg : imgList) {if(integralGoodsImg.getType() == 1){headImg = integralGoodsImg.getSrc();break;}}}return headImg;}public void setHeadImg(String headImg) {this.headImg = headImg;}public Integer getSaleNum() {return saleNum;}public void setSaleNum(Integer saleNum) {this.saleNum = saleNum;}public List<String> getImgUrlList() {return imgUrlList;}public void setImgUrlList(List<String> imgUrlList) {this.imgUrlList = imgUrlList;}public Date getShelfDate() {return shelfDate;}public void setShelfDate(Date shelfDate) {this.shelfDate = shelfDate;}public Date getObtainedDate() {return obtainedDate;}public void setObtainedDate(Date obtainedDate) {this.obtainedDate = obtainedDate;}public static Specification<IntegralGoods> where(final IntegralGoods entity) {return new Specification<IntegralGoods>() {@Overridepublic Predicate toPredicate(Root<IntegralGoods> root, CriteriaQuery<?> query, CriteriaBuilder cb) {List<Predicate> predicates = new ArrayList<Predicate>();//商品名稱String name = entity.getName();if (StringUtils.isNotBlank(name)) {predicates.add(cb.like(root.<String>get("name"), "%" + name + "%"));}// ===========等于====================// uidString uid = entity.getUid();if (StringUtils.isNotBlank(uid)) {predicates.add(cb.equal(root.<String>get("uid"), uid));}// tidString tid = entity.getTid();if (StringUtils.isNotBlank(tid)) {predicates.add(cb.equal(root.<String>get("tid"), tid));}// 積分Integer integral = entity.getIntegral();if (integral != null) {predicates.add(cb.equal(root.<String>get("integral"), integral));}// 類型Integer type = entity.getType();if (type != null) {predicates.add(cb.equal(root.<String>get("type"), type));}//庫(kù)存Integer stock = entity.getStock();if (stock != null) {predicates.add(cb.equal(root.<String>get("stock"), stock));}//激活碼String cdKey = entity.getCdKey();if (StringUtils.isNotBlank(cdKey)){predicates.add(cb.equal(root.get("cdKey"),cdKey));}//商品編號(hào)String goodsCode = entity.getGoodsCode();if (StringUtils.isNotBlank(goodsCode)){predicates.add(cb.equal(root.get("goodsCode"),goodsCode));}//上架標(biāo)識(shí)Integer shelfFlag = entity.getShelfFlag();if (shelfFlag != null){predicates.add(cb.equal(root.get("shelfFlag"),shelfFlag));}return query.where(predicates.toArray(new Predicate[predicates.size()])).getRestriction();}};}} View Code?
2.IntegralGoodsImg實(shí)體
package com.pisen.cloud.luna.ms.jifen.base.domain;import java.util.ArrayList; import java.util.List;import javax.persistence.Entity; import javax.persistence.Table; import javax.persistence.UniqueConstraint; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root;import org.apache.commons.lang3.StringUtils; import org.springframework.data.jpa.domain.Specification;import com.pisen.cloud.luna.ms.jifen.base.common.BaseDomain;@Entity @Table(uniqueConstraints = { @UniqueConstraint(columnNames = { "uid" }),@UniqueConstraint(columnNames = { "imgKey" })}) public class IntegralGoodsImg extends BaseDomain {public static final int IMG_TYPE_MAIN = 1;//商品主圖public static final int IMG_TYPE_OTHER = 2;//其他商品圖片private String integralGoodsId; //積分商品idprivate Integer type; // 圖片類型(1:首頁(yè)展示,2:詳情圖片,3:自定義圖片)private String src; // 圖片路徑private Integer sort; // 圖片順序private String tid;//租戶idprivate String imgKey;//七牛云存儲(chǔ)圖片的keyprivate String imgName; //用戶上傳的文件名public String getIntegralGoodsId() {return integralGoodsId;}public void setIntegralGoodsId(String integralGoodsId) {this.integralGoodsId = integralGoodsId;}public Integer getType() {return type;}public void setType(Integer type) {this.type = type;}public String getSrc() {return src;}public void setSrc(String src) {this.src = src;}public Integer getSort() {return sort;}public void setSort(Integer sort) {this.sort = sort;}public String getTid() {return tid;}public void setTid(String tid) {this.tid = tid;}public String getImgKey() {return imgKey;}public void setImgKey(String imgKey) {this.imgKey = imgKey;}public String getImgName() {return imgName;}public void setImgName(String imgName) {this.imgName = imgName;}public static Specification<IntegralGoodsImg> where(final IntegralGoodsImg entity) {return new Specification<IntegralGoodsImg>() {@Overridepublic Predicate toPredicate(Root<IntegralGoodsImg> root, CriteriaQuery<?> query, CriteriaBuilder cb) {List<Predicate> predicates = new ArrayList<Predicate>();// ===========等于====================// uidString uid = entity.getUid();if (StringUtils.isNotBlank(uid)) {predicates.add(cb.equal(root.<String>get("uid"), uid));}// 積分商品idString integralGoodsId = entity.getIntegralGoodsId();if (StringUtils.isNotBlank(integralGoodsId)) {predicates.add(cb.equal(root.<String>get("integralGoodsId"), integralGoodsId));}// 圖片類型Integer type = entity.getType();if (type != null) {predicates.add(cb.equal(root.<String>get("type"), type));}//tidString tid = entity.getTid();if (StringUtils.isNotBlank(tid)) {predicates.add(cb.equal(root.<String>get("tid"), tid));}return query.where(predicates.toArray(new Predicate[predicates.size()])).getRestriction();}};}} View Code?
3.ShelfLog實(shí)體
package com.pisen.cloud.luna.ms.jifen.base.domain;import javax.persistence.*; import java.util.Date;/*** 自動(dòng)上架 下架時(shí)間 記錄表** 單位控制到天** 定時(shí)任務(wù)每天定時(shí)掃描 完成積分商品自動(dòng)上架下架狀態(tài)的改變*/ @Entity @Table(uniqueConstraints = { @UniqueConstraint(columnNames = { "integralGoodsUid" })}) public class ShelfLog {public static final int DEAL_FLAG_DO = 1;//已處理public static final int DEAL_FLAG_NOT_HAVING_DO = 0;//未處理 @Id@GeneratedValue(strategy = GenerationType.IDENTITY)private Long id;// 主鍵 自增 @Column(nullable = false)private String integralGoodsUid;//積分商品ID 本記錄表中唯一private Date shelfDate;//自定義自動(dòng)上架時(shí)間private Date obtainedDate;//自定義自動(dòng)下架時(shí)間private Integer shelfDealFlag;//上架是否處理private Integer obtainedFlag;//下架是否處理public Long getId() {return id;}public void setId(Long id) {this.id = id;}public String getIntegralGoodsUid() {return integralGoodsUid;}public void setIntegralGoodsUid(String integralGoodsUid) {this.integralGoodsUid = integralGoodsUid;}public Date getShelfDate() {return shelfDate;}public void setShelfDate(Date shelfDate) {this.shelfDate = shelfDate;}public Date getObtainedDate() {return obtainedDate;}public void setObtainedDate(Date obtainedDate) {this.obtainedDate = obtainedDate;}public Integer getShelfDealFlag() {return shelfDealFlag;}public void setShelfDealFlag(Integer shelfDealFlag) {this.shelfDealFlag = shelfDealFlag;}public Integer getObtainedFlag() {return obtainedFlag;}public void setObtainedFlag(Integer obtainedFlag) {this.obtainedFlag = obtainedFlag;}} View Code?
?
4.最后著重看mybatis的xml怎么寫
<select id="find" parameterType="com.pisen.cloud.luna.ms.jifen.base.domain.IntegralGoods" resultMap="baseResBean">select a.id as 'id',a.uid as 'uid',a.create_date as 'createDate',a.update_date as 'updateDate',a.update_id as 'updateId',a.create_id as 'createId',a.brand_uid as 'brandUid',a.tid as 'tid',a.stock as 'stock',a.name as 'name',a.goods_code as 'goodsCode',a.market_value as 'marketValue',a.specification as 'specification',a.remark as 'remark',a.integral as 'integral',a.description as 'description',a.sale_num as 'saleNum',a.limit_num as 'limitNum',a.shelf_flag as 'shelfFlag',a.home_show_flag as 'homeShowFlag',sl.shelf_date as 'shelfDate',sl.obtained_date as 'obtainedDate',b.src b_src,b.type b_type,b.sort b_sortfrom integral_goods aleft joinintegral_goods_img bon a.uid = b.integral_goods_idleft joinshelf_log slon a.uid = sl.integral_goods_uid<where>a.delete_flag = ${@com.pisen.cloud.luna.ms.jifen.base.domain.IntegralGoods@DELETE_FLAG_DISDELETE}and a.tid = #{tid}<if test="uid != null and uid != '' ">and a.uid = #{uid}</if><if test="brandUid != null and brandUid != '' ">and a.brand_uid = #{brandUid}</if><if test="name != null and name != '' ">and a.name like CONCAT('%',#{name},'%')</if></where></select><resultMap type="com.pisen.cloud.luna.ms.jifen.base.domain.IntegralGoods" id="baseResBean"><id column="id" property="id"/><result column="uid" property="uid"/><result column="createDate" property="createDate"/><result column="updateDate" property="updateDate"/><result column="createId" property="createId"/><result column="updateId" property="updateId"/><result column="type" property="type"/><result column="tid" property="tid"/><result column="stock" property="stock"/><result column="name" property="name"/><result column="goodsCode" property="goodsCode"/><result column="marketValue" property="marketValue"/><result column="specification" property="specification"/><result column="brandUid" property="brandUid"/><result column="remark" property="remark"/><result column="integral" property="integral"/><result column="description" property="description"/><result column="saleNum" property="saleNum"/><result column="limitNum" property="limitNum"/><result column="shelfFlag" property="shelfFlag"/><result column="homeShowFlag" property="homeShowFlag"/><result column="shelfDate" property="shelfDate"/><result column="obtainedDate" property="obtainedDate"/><collection property="imgList" columnPrefix="b_"ofType="com.pisen.cloud.luna.ms.jifen.base.domain.IntegralGoodsImg"><id column="id" property="id"/><result column="src" property="src"/><result column="type" property="type"/><result column="sort" property="sort"/></collection></resultMap> View Code?
5.最后補(bǔ)充一下mapper.java
List<IntegralGoods> find(IntegralGoods entity);?
展示一下最后的查詢結(jié)果:【注意最后的total總數(shù)有問(wèn)題,需要單獨(dú)處理一下】
【total=8表示數(shù)據(jù)庫(kù)中查出的數(shù)據(jù)是8條,在組裝返回List以后,就是3條了】
{"success": true,"msg": "successful","code": 200,"total": 8,"rows": [{"fields": null,"orders": null,"pageSize": 10,"pageNum": 0,"id": 48,"createDate": 1533689800000,"updateDate": 1533689800000,"updateId": "defUserId","createId": "defUserId","uid": "42832f275248456f8a8ff6b855f55e95","tid": "9f63f84f-52c6-4c8e-b3c3-66b9f1f283ba","brandUid": "974fcd3a139f4b19a632bc40b6eec7b9","description": null,"cdKey": null,"name": "統(tǒng)一方便面","marketValue": 100,"integral": 100,"type": null,"stock": 200,"saleNum": 0,"version": null,"limitNum": 2,"goodsCode": null,"specification": "105g/桶*12桶/件","deleteFlag": null,"shelfFlag": 0,"homeShowFlag": 1,"remark": null,"order": null,"orderType": null,"headImg": "http://p2ognrwoi.bkt.clouddn.com/fed69bb7be9416ed56916aea8ffad38f_UI_UPLOAD_IMG?e=1533562337&token=lPDJgKX4JP-SQBa1EWaSt88UJAOpkW1n0JGv3gCQ:96nPcK9nruoaT3s_rNEzlQJrQeQ=?imageView2/1/w/50/h/50","imgUrlList": null,"shelfDate": 1533859200000,"obtainedDate": 1533945600000,"shelfRemark": null,"imgList": [{"fields": null,"orders": null,"pageSize": 10,"pageNum": 0,"id": null,"createDate": 1533698803047,"updateDate": 1533698803047,"updateId": null,"createId": null,"uid": null,"tid": null,"brandUid": null,"integralGoodsId": null,"type": 1,"src": "http://p2ognrwoi.bkt.clouddn.com/fed69bb7be9416ed56916aea8ffad38f_UI_UPLOAD_IMG?e=1533562337&token=lPDJgKX4JP-SQBa1EWaSt88UJAOpkW1n0JGv3gCQ:96nPcK9nruoaT3s_rNEzlQJrQeQ=?imageView2/1/w/50/h/50","sort": 1,"imgKey": null,"imgName": null},{"fields": null,"orders": null,"pageSize": 10,"pageNum": 0,"id": null,"createDate": 1533698803052,"updateDate": 1533698803052,"updateId": null,"createId": null,"uid": null,"tid": null,"brandUid": null,"integralGoodsId": null,"type": 2,"src": "http://p2ognrwoi.bkt.clouddn.com/b07121eeadc1e42dbde765af569356a3_UI_UPLOAD_IMG?e=1533563250&token=lPDJgKX4JP-SQBa1EWaSt88UJAOpkW1n0JGv3gCQ:W_EObH6d7O_QrqRQeX1CSmba0KE=?imageView2/1/w/50/h/50","sort": 2,"imgKey": null,"imgName": null},{"fields": null,"orders": null,"pageSize": 10,"pageNum": 0,"id": null,"createDate": 1533698803055,"updateDate": 1533698803055,"updateId": null,"createId": null,"uid": null,"tid": null,"brandUid": null,"integralGoodsId": null,"type": 2,"src": "http://p2ognrwoi.bkt.clouddn.com/237d4a191de7b25897cdb49117dfb9ec_UI_UPLOAD_IMG?e=1533563617&token=lPDJgKX4JP-SQBa1EWaSt88UJAOpkW1n0JGv3gCQ:M3FJDLzza80U72934OT7B8ya_Yw=?imageView2/1/w/50/h/50","sort": 3,"imgKey": null,"imgName": null}]},{"fields": null,"orders": null,"pageSize": 10,"pageNum": 0,"id": 49,"createDate": 1533698513000,"updateDate": 1533698513000,"updateId": "defUserId","createId": "defUserId","uid": "17c2050b247a45f0ae092d48b035c9e5","tid": "9f63f84f-52c6-4c8e-b3c3-66b9f1f283ba","brandUid": "974fcd3a139f4b19a632bc40b6eec7b9","description": null,"cdKey": null,"name": "統(tǒng)一方便面","marketValue": 100,"integral": 100,"type": null,"stock": 200,"saleNum": 0,"version": null,"limitNum": 2,"goodsCode": null,"specification": "105g/桶*12桶/件","deleteFlag": null,"shelfFlag": 0,"homeShowFlag": 1,"remark": null,"order": null,"orderType": null,"headImg": "http://p2ognrwoi.bkt.clouddn.com/fed69bb7be9416ed56916aea8ffad38f_UI_UPLOAD_IMG?e=1533562337&token=lPDJgKX4JP-SQBa1EWaSt88UJAOpkW1n0JGv3gCQ:96nPcK9nruoaT3s_rNEzlQJrQeQ=?imageView2/1/w/50/h/50","imgUrlList": null,"shelfDate": 1533859200000,"obtainedDate": null,"shelfRemark": null,"imgList": [{"fields": null,"orders": null,"pageSize": 10,"pageNum": 0,"id": null,"createDate": 1533698803068,"updateDate": 1533698803068,"updateId": null,"createId": null,"uid": null,"tid": null,"brandUid": null,"integralGoodsId": null,"type": 1,"src": "http://p2ognrwoi.bkt.clouddn.com/fed69bb7be9416ed56916aea8ffad38f_UI_UPLOAD_IMG?e=1533562337&token=lPDJgKX4JP-SQBa1EWaSt88UJAOpkW1n0JGv3gCQ:96nPcK9nruoaT3s_rNEzlQJrQeQ=?imageView2/1/w/50/h/50","sort": 1,"imgKey": null,"imgName": null},{"fields": null,"orders": null,"pageSize": 10,"pageNum": 0,"id": null,"createDate": 1533698803070,"updateDate": 1533698803070,"updateId": null,"createId": null,"uid": null,"tid": null,"brandUid": null,"integralGoodsId": null,"type": 2,"src": "http://p2ognrwoi.bkt.clouddn.com/b07121eeadc1e42dbde765af569356a3_UI_UPLOAD_IMG?e=1533563250&token=lPDJgKX4JP-SQBa1EWaSt88UJAOpkW1n0JGv3gCQ:W_EObH6d7O_QrqRQeX1CSmba0KE=?imageView2/1/w/50/h/50","sort": 2,"imgKey": null,"imgName": null}]},{"fields": null,"orders": null,"pageSize": 10,"pageNum": 0,"id": 46,"createDate": 1533689464000,"updateDate": 1533689464000,"updateId": "defUserId","createId": "defUserId","uid": "629669683bf34ecdbb81ac8bbc236845","tid": "9f63f84f-52c6-4c8e-b3c3-66b9f1f283ba","brandUid": "974fcd3a139f4b19a632bc40b6eec7b9","description": null,"cdKey": null,"name": "統(tǒng)一方便面","marketValue": 100,"integral": 100,"type": null,"stock": 200,"saleNum": 0,"version": null,"limitNum": 2,"goodsCode": null,"specification": "105g/桶*12桶/件","deleteFlag": null,"shelfFlag": 0,"homeShowFlag": 1,"remark": null,"order": null,"orderType": null,"headImg": "http://p2ognrwoi.bkt.clouddn.com/fed69bb7be9416ed56916aea8ffad38f_UI_UPLOAD_IMG?e=1533562337&token=lPDJgKX4JP-SQBa1EWaSt88UJAOpkW1n0JGv3gCQ:96nPcK9nruoaT3s_rNEzlQJrQeQ=?imageView2/1/w/50/h/50","imgUrlList": null,"shelfDate": null,"obtainedDate": null,"shelfRemark": null,"imgList": [{"fields": null,"orders": null,"pageSize": 10,"pageNum": 0,"id": null,"createDate": 1533698803082,"updateDate": 1533698803082,"updateId": null,"createId": null,"uid": null,"tid": null,"brandUid": null,"integralGoodsId": null,"type": 1,"src": "http://p2ognrwoi.bkt.clouddn.com/fed69bb7be9416ed56916aea8ffad38f_UI_UPLOAD_IMG?e=1533562337&token=lPDJgKX4JP-SQBa1EWaSt88UJAOpkW1n0JGv3gCQ:96nPcK9nruoaT3s_rNEzlQJrQeQ=?imageView2/1/w/50/h/50","sort": 1,"imgKey": null,"imgName": null},{"fields": null,"orders": null,"pageSize": 10,"pageNum": 0,"id": null,"createDate": 1533698803085,"updateDate": 1533698803085,"updateId": null,"createId": null,"uid": null,"tid": null,"brandUid": null,"integralGoodsId": null,"type": 2,"src": "http://p2ognrwoi.bkt.clouddn.com/b07121eeadc1e42dbde765af569356a3_UI_UPLOAD_IMG?e=1533563250&token=lPDJgKX4JP-SQBa1EWaSt88UJAOpkW1n0JGv3gCQ:W_EObH6d7O_QrqRQeX1CSmba0KE=?imageView2/1/w/50/h/50","sort": 2,"imgKey": null,"imgName": null},{"fields": null,"orders": null,"pageSize": 10,"pageNum": 0,"id": null,"createDate": 1533698803088,"updateDate": 1533698803088,"updateId": null,"createId": null,"uid": null,"tid": null,"brandUid": null,"integralGoodsId": null,"type": 2,"src": "http://p2ognrwoi.bkt.clouddn.com/237d4a191de7b25897cdb49117dfb9ec_UI_UPLOAD_IMG?e=1533563617&token=lPDJgKX4JP-SQBa1EWaSt88UJAOpkW1n0JGv3gCQ:M3FJDLzza80U72934OT7B8ya_Yw=?imageView2/1/w/50/h/50","sort": 3,"imgKey": null,"imgName": null}]}] }?
總結(jié)
以上是生活随笔為你收集整理的【mybatis】mybatis多表联查,存在一对多关系的,实体中使用List作为字段接收查询结果的写法...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 【QT】QT网络编程简介
- 下一篇: postsql时间计算