mybatis-mapper的复杂映射

SqlMapConfig.xml
  
 


	
		
		
	
	
		
		
		
		
		
		
	
	
		
			
			
				
				
				
				
			
		
	
	
		
	
mapper.xml





	
	
	

	
		
		
		
		
		
		
		
		
		
		
			
			
			
			
			
			
		
		
	
	
	
	
	

		
		
		 
		 	
		 	
		 	
		 	
		 	
		 
	
	
	
	
		
		
		
		
		
		
		 
		 	
		 	
		 	
		 	
		 	
		 	
		 	
		 	 
		 	 	
		 	 	
		 	 	
		 	 	
		 	 
		 	 	
		 	 	 
		 	 	 	
		 	 	 	
		 	 	 	
		 	 	 	
		 	 	 
		 	 
		 
		 
	
	
	
	
	
	
	
	
	
	
		
		
		
		
		
		
		
		
			
			
		
		
	
	
	
	
	
	
	
orders.java
package com.itcast.mybatis.po;

import java.util.Date;
import java.util.List;

public class orders {
	private int id;
	private int users_id;
	private String number;
	private Date createtime;
	private String note;
	
	//用户信息
	private users user; 
	
	//订单明细
	private List Orderdetail;
	
	
	public List getOrderdetail() {
		return Orderdetail;
	}
	public void setOrderdetail(List orderdetail) {
		Orderdetail = orderdetail;
	}
	public users getUser() {
		return user;
	}
	public void setUser(users user) {
		this.user = user;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getUsers_id() {
		return users_id;
	}
	public void setUsers_id(int users_id) {
		this.users_id = users_id;
	}
	public String getNumber() {
		return number;
	}
	public void setNumber(String number) {
		this.number = number;
	}
	public Date getCreatetime() {
		return createtime;
	}
	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}
	public String getNote() {
		return note;
	}
	public void setNote(String note) {
		this.note = note;
	}
}
users.java
package com.itcast.mybatis.po;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

public class users implements Serializable {
private int id;
private String username;
private Date birthday;
private String sex;
private String address;

//用户创建的订单列表
private List ordersList;

public List getOrdersList() {
	return ordersList;
}
public void setOrdersList(List ordersList) {
	this.ordersList = ordersList;
}
public int getId() {
	return id;
}
public void setId(int id) {
	this.id = id;
}
public String getUsername() {
	return username;
}
public void setUsername(String username) {
	this.username = username;
}
public Date getBirthday() {
	return birthday;
}
public void setBirthday(Date birthday) {
	this.birthday = birthday;
}
public String getSex() {
	return sex;
}
public void setSex(String sex) {
	this.sex = sex;
}
public String getAddress() {
	return address;
}
public void setAddress(String address) {
	this.address = address;
}
}
items.java
package com.itcast.mybatis.po;

import java.util.Date;

public class items {
	private int id;
	private String name;
	private float price;
	private String detail;
	private String pic;
	private Date createtiome;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public float getPrice() {
		return price;
	}
	public void setPrice(float price) {
		this.price = price;
	}
	public String getDetail() {
		return detail;
	}
	public void setDetail(String detail) {
		this.detail = detail;
	}
	public String getPic() {
		return pic;
	}
	public void setPic(String pic) {
		this.pic = pic;
	}
	public Date getCreatetiome() {
		return createtiome;
	}
	public void setCreatetiome(Date createtiome) {
		this.createtiome = createtiome;
	}
}
orderdetail.java
package com.itcast.mybatis.po;

public class orderdetail {
	private int id;
	private int orders_id;
	private int items_id;
	private int items_num;
	
	//明细所对应的商品信息
	private items Items;
	
	
	
	public items getItems() {
		return Items;
	}
	public void setItems(items items) {
		Items = items;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getOrders_id() {
		return orders_id;
	}
	public void setOrders_id(int orders_id) {
		this.orders_id = orders_id;
	}
	public int getItems_id() {
		return items_id;
	}
	public void setItems_id(int items_id) {
		this.items_id = items_id;
	}
	public int getItems_num() {
		return items_num;
	}
	public void setItems_num(int items_num) {
		this.items_num = items_num;
	}
}






你可能感兴趣的:(mybatis)