springboot-vue项目后台2---pojo对查询结果手动分组
2024-10-19 17:27:28
<resultMap id="PResult" type="packs" >
<result column="device_type" property="deviceType" jdbcType="VARCHAR" />
<result column="car_model" property="carModel" jdbcType="VARCHAR" />
<collection property="pcks" ofType="pcks" javaType="ArrayList">
<id column="pid" property="pid" jdbcType="INTEGER" />
<result column="package_version" property="packageVersion" jdbcType="VARCHAR" />
<result column="state" property="state" jdbcType="INTEGER" />
<result column="description" property="description" jdbcType="VARCHAR" />
<result column="update_time" property="updateTime" jdbcType="VARCHAR" />
<result column="device_type" property="deviceType" jdbcType="VARCHAR" />
<result column="car_model" property="carModel" jdbcType="VARCHAR" />
<result column="pcktype" property="pcktype" jdbcType="VARCHAR" />
<result column="old_num" property="oldNnum" jdbcType="VARCHAR" />
<result column="new_num" property="newNum" jdbcType="VARCHAR" />
<collection property="files" ofType="packFile" javaType="ArrayList">
<id property="fid" column="fid" />
<result property="orignName" column="orignName" />
<result property="newName" column="newName" />
<result property="filePath" column="filePath" />
<result property="size" column="size" />
<result property="md5" column="md5" />
</collection>
</collection>
<select id="selectAllPackages" resultMap="PResult">
select
p.device_type,
p.car_model,
p.pid,
p.package_version,
p.state,
p.description,
p.update_time,
p.device_type,
p.car_model,
p.pcktype,
p.old_num,
p.new_num,
f.fid ,
f.orign_name as orignName,
f.new_name as newName,
f.file_path as filePath,
f.size,
f.md5
from t_package p
left join t_package_file pf on pf.package_id=p.pid
left join t_file f on pf.file_id=f.fid where p.state!=2
</select>
package com.hcxy.car.bean.pojo; import java.io.Serializable;
import java.util.ArrayList; import org.apache.ibatis.type.Alias; import com.hcxy.car.bean.PackageFile; @Alias("packs")
public class Packs {
private String deviceType;// tbox,vin,ipc
private String carModel;// 版本号
private ArrayList<Pcks> pcks; public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public String getCarModel() {
return carModel;
}
public void setCarModel(String carModel) {
this.carModel = carModel;
}
public ArrayList<Pcks> getPcks() {
return pcks;
}
public void setPcks(ArrayList<Pcks> pcks) {
this.pcks = pcks;
}
}
package com.hcxy.car.bean.pojo; import java.io.Serializable;
import java.util.ArrayList; import org.apache.ibatis.type.Alias; import com.hcxy.car.bean.PackageFile; @Alias("pcks")
public class Pcks {
private int pid;// 主键.
private String packageVersion;// 文件名
private int state;
private String description;
private String updateTime;
private String deviceType;// tbox,vin,ipc
private String carModel;// 版本号
private String pcktype;// 包类型
private String oldNnum;// 包类型
private String newNum;// 包类型
private ArrayList<PackageFile> files; public int getPid() {
return pid;
}
public void setPid(int pid) {
this.pid = pid;
}
public String getPackageVersion() {
return packageVersion;
}
public void setPackageVersion(String packageVersion) {
this.packageVersion = packageVersion;
}
public int getState() {
return state;
}
public void setState(int state) {
this.state = state;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
public ArrayList<PackageFile> getFiles() {
return files;
}
public void setFiles(ArrayList<PackageFile> files) {
this.files = files;
}
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public String getCarModel() {
return carModel;
}
public void setCarModel(String carModel) {
this.carModel = carModel;
}
public String getPcktype() {
return pcktype;
}
public void setPcktype(String pcktype) {
this.pcktype = pcktype;
}
public String getOldNnum() {
return oldNnum;
}
public void setOldNnum(String oldNnum) {
this.oldNnum = oldNnum;
}
public String getNewNum() {
return newNum;
}
public void setNewNum(String newNum) {
this.newNum = newNum;
} }
最新文章
- 【JavaScript】 Webpack安装及文件打包
- CUDA1.1-函数类型限定符与变量类型限定符
- CSS 3中边框怎么用
- Linux VPS 基本命令
- 模仿开发H5游戏,看你有多色
- mysql 安装配置详解
- 2 - Annotations标注
- 设计模式(十四):Command命令模式 -- 行为型模式
- Python——Flash框架——用户认证
- 推荐常用的移动端、PC端、小程序的UI框架
- JAVA-8大基本类型与包装类的例子(基础必备)
- SharePoint开启错误提示
- 集群下Dubbo负载均衡配置
- SR锁存器
- [2]注解(Annotation)-- 深入理解Java:注解(Annotation)自定义注解入门
- (转)HTTP 错误 404.2 - Not Found 由于 Web 服务器上的“ISAPI 和 CGI 限制”列表设置,无法提供您请求的页面
- 雷林鹏分享:C# 不安全代码
- Mouse Touch Stylus
- Java-子类扩展父类功能
- [转]聊聊技术选型 - Angular2 vs Vue2