【mybatis】mybatis多表联查,存在一对多关系的,实体中使用List作为字段接收查询结果的写法...

 

实体如下:

IntegralGoods  积分商品

IntegralGoodsImg  积分商品图片

ShelfLog    积分商品自动上架记录

 

IntegralGoods :IntegralGoodsImg:ShelfLog  = 1:n:1

1:1的多表联查或者m:n的多表联查 很简单,

现在出现1:n的情况,一种积分商品可能有多张图片

所以在最后的返回结果里想用LIst<IntegralGoodsImg>作为IntegralGoods 的一个字段作为参数进行接收

 

那mybatis怎么实现查询呢?

=========================================================

1.IntegralGoods 实体【只关注字段即可】,尤其是

 

@Transient

private List<IntegralGoodsImg> imgList;//图片们 

这个字段就是用来接收多个图片实体的

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;//首页展示public static final int SHOW_HOME_FLAG_NO = 0;//不在首页展示
@Type(type = "text")private String description; //商品描述private String cdKey;//虚拟物品激活码 ---弃用
@Column(nullable = false)private String name; // 名称
@Column(nullable = false)private Float marketValue; // 原价
@Column(nullable = false)private Integer integral; // 兑换积分private Integer type; // (1:实物 2:虚拟)
@Column(nullable = false)private Integer stock; // 库存数量(-1时无限量 : 正常扣除)
@Column(nullable = false)private Integer saleNum; // 销量 已兑换数量private Integer version;/*** ========新增字段===================*/@Column(nullable = false)private Integer limitNum;//限兑数量private String goodsCode;//商品编号
@Column(nullable = false)private String specification;//商品规格  实物商品必填private Integer deleteFlag;//删除标识
@Column(nullable = false)private Integer shelfFlag;//上架标识
@Column(nullable = false)private Integer homeShowFlag;//是否首页展示private String remark;    //备注
@Transientprivate String order;//排序字段
    @Transientprivate String orderType;//排序方法
    @Transientprivate String headImg;//首页图片
@Transientprivate List<String> imgUrlList;//接收前台URL集合使用
@Transientprivate Date shelfDate;//上架时间    接收前台字段
@Transientprivate Date obtainedDate;//下架时间        接收前台字段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));}//库存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));}//商品编号String goodsCode = entity.getGoodsCode();if (StringUtils.isNotBlank(goodsCode)){predicates.add(cb.equal(root.get("goodsCode"),goodsCode));}//上架标识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实体

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:首页展示,2:详情图片,3:自定义图片)private String src; // 图片路径private Integer sort; // 图片顺序private String tid;//租户idprivate String imgKey;//七牛云存储图片的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实体

package com.pisen.cloud.luna.ms.jifen.base.domain;import javax.persistence.*;
import java.util.Date;/*** 自动上架 下架时间 记录表** 单位控制到天** 定时任务每天定时扫描 完成积分商品自动上架下架状态的改变*/
@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;//自定义自动上架时间private Date obtainedDate;//自定义自动下架时间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.最后补充一下mapper.java

List<IntegralGoods> find(IntegralGoods entity);

 

展示一下最后的查询结果:【注意最后的total总数有问题,需要单独处理一下】

【total=8表示数据库中查出的数据是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": "统一方便面","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": "统一方便面","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": "统一方便面","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}]}]
}

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/277503.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

mac java tomcat_mac idea 配置tomcat

mac idea 配置tomcat一、下载安装tomcat二、有一个 javaWeb项目创建一个javaWeb项目 ,参考第一条&#xff0c;只是在第二步的时候选中java Web就行三、完善web项目在WEB-INF 下新建两个文件夹&#xff0c;lib(存放jar包)和classes(存放编译后的文件)打开项目结构设置配置classe…

30342程序格式

1.汇编语言程序格式 2.表达式操作符 转载于:https://www.cnblogs.com/ZanderZhao/p/11055237.html

SprinBoot易学难精

Spring Boot易学难精 易学 组件自动装配&#xff1a;规约大于配置&#xff0c;专注核心业务外部化配置&#xff1a;一次构建、按需调配&#xff0c;到处运行嵌入式容器&#xff1a;内纸容器、无序部署、独立运行Spring Boot Stater&#xff1a;简化依赖、按需装配、自我包含Pro…

一道没人搞得定的趣味Shell编程游戏题!,看看你会不会?

1.1猜数字编程游戏首先让系统随机生成一个数字&#xff0c;给这个数字定一个范围&#xff08;1-60&#xff09;&#xff0c;让用户输入猜的数字&#xff0c;对输入进行判断&#xff0c;如果不符合要求&#xff0c;就给予高或低的提示。其他要求&#xff1a;1、全部猜对后则给出…

java中拷贝文件的代码_拷贝文件夹中的所有文件到另外一个文件夹

[java]代码库/**** 拷贝文件夹中的所有文件到另外一个文件夹** param srcDirector* 源文件夹** param desDirector* 目标文件夹**/public static void copyFileWithDirector(String srcDirector,String desDirector) throws IOException {(new File(desDirector)).mkdirs();Fil…

infoseccrypto_java下载_關於php接ICBC的支付接口的解決方案

一&#xff1a;背景&#xff1a; 目前項目使用的是php語言開發&#xff0c;需要接入中國工商銀行的ICBC的線上支付接口。二&#xff1a;遇到的問題&#xff1a;支付時需要對數據簽名&#xff0c;但是銀行那邊不提供php版本的程序&#xff0c;只有java版本的&#xff0c;以下是對…

java windows 取所有任务_Win下,通过Jstack截取Java进程中的堆栈信息

在Java软件的使用过程中&#xff0c;有时会莫名的出现奇怪的问题。而这些问题常常无法使用日志信息定位&#xff0c;这时我们就需要通过查看进程内部线程的堆栈调用关系来分析问题出在哪里。举个例子&#xff0c;当我们在做某个操作时&#xff0c;莫名的会弹出多个警告框&#…

redis基础一_常用指令

# Redis configuration file example. # # Note that in order to read the configuration file, Redis must be # started with the file path as first argument: #./redis-server /path/to/redis.conf docker启动redis: docker run -d -p 6379:6379 -v /home/anmin/Desktop/…

滴滴Booster移动APP质量优化框架 学习之旅 三

推荐阅读&#xff1a; 滴滴Booster移动App质量优化框架-学习之旅 一 Android 模块Api化演练 不一样视角的Glide剖析(一) 滴滴Booster移动App质量优化框架-学习之旅 二对重复资源优化和无用资源优化进行了讨论。这里对不可编译无用assets资源优化进行讨论。 先看微信Matrix-ApkC…

Colder框架硬核更新(Sharding+IOC)

目录 引言控制反转读写分离分库分表 理论基础设计目标现状调研设计思路实现之过五关斩六将 动态对象动态模型缓存数据源移植查询表达式树深度移植数据合并算法事务支持实际使用展望未来引言 前方硬核警告&#xff1a;全文干货11000字&#xff0c;请耐心阅读 遥想去年这个时候&a…

python:小心类实例的属性动态绑定机制

为什么80%的码农都做不了架构师&#xff1f;>>> class Test:def __init__(self):self.__keyinitdef get_key(self):return self.__keydef set_key(self,key):self.__keykeyif __name__ __main__:obj Test()print(obj.get_key())#输出初始值initobj.set_key(通过s…

java 获取手机归属地_java 获取手机归属地

java 获取手机归属地[2021-01-30 20:46:44] 简介:php去除nbsp的方法&#xff1a;首先创建一个PHP代码示例文件&#xff1b;然后通过“preg_replace("/(\s|\&nbsp\;| |\xc2\xa0)/", " ", strip_tags($val));”方法去除所有nbsp即可。推荐&#xff1a;…

Atom常用功能插件

minimap代码缩略图插件 代码粒子效果activate-power-mode 代码格式化插件atom-beautify packages-->Atom Beautify-->Beautify进行格式化 标签折叠 autoclose-html 转载于:https://www.cnblogs.com/chenxi-hxl/p/9464120.html

java中和char功能相反的是_JAVA基础语法

java的基础语法Java中的程序可分为结构定义语句和功能执行语句.结构定义语句&#xff1a;用于声明一个类或方法&#xff0c;功能执行语句用于实现具体的功能。功能执行语句&#xff1a;每条功能执行语句的结尾都必须用英文分号(;)结束。public修饰的类名必须和文件名一致(如果没…

P1357 花园 (矩阵快速幂+ DP)

题意:一个只含字母C和P的环形串 求长度为n且每m个连续字符不含有超过k个C的方案数 m < 5 n < 1e15 题解:用一个m位二进制表示状态 转移很好想 但是这个题是用矩阵快速幂加速dp的 因为每一位的转移都是一样的 用一个矩阵表示状态i能否转移到状态j 然后跑一遍 统计答案特…

IDEA设置类、方法注释模板

类注释模板 File -> Other Setting -> Default Setting打开默认设置 Editor -> File and Code Templates -> Files -> Class 找到类注释模板&#xff0c;在public class前面添加模板注释 /** * program: ${PROJECT_NAME}->${NAME} * description: ${descript…

netty源码分析之服务端启动全解析

background netty 是一个异步事件驱动的网络通信层框架&#xff0c;其官方文档的解释为 Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients. It greatly simplifies and stream…

Android-一张图理解MVP的用法

M和V通过P交互&#xff0c;M做了两件事&#xff0c;开启子线程做耗时操作&#xff0c;然后使用原生的Hander方式切回主线程回调结果给P。 M做的两件事也可以使用比较流行的rxjava实现&#xff1a; 备注&#xff1a;图片不清晰可以看这里 转载于:https://www.cnblogs.com/develo…

C语言文字加密程序的实现

前言&#xff1a;当今社会是一个信息社会&#xff0c;你的个人信息和聊天记录极有可能被别有用心的人时时刻刻监视着&#xff0c;那么你想不想实现专属于两个人或一个小圈子的人在社交软件上的交流不被任何其他人读懂呢&#xff1f;下面就给大家提供一个原理极其简单程序极其容…

java 抽象类与接口理解

2019独角兽企业重金招聘Python工程师标准>>> 在java 中抽象类是implements [等有时间了补充] 转载于:https://my.oschina.net/kuchawyz/blog/1929094