parent
456e7e7a48
commit
6d748c9e66
@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.controller;
|
@ -0,0 +1,4 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.controller;
|
||||
|
@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.controller;
|
@ -0,0 +1,4 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.controller;
|
||||
|
@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.controller;
|
@ -0,0 +1,4 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.controller;
|
||||
|
@ -0,0 +1,4 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.controller;
|
||||
|
@ -0,0 +1,43 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.controller;
|
||||
|
||||
import com.how2java.tmall.pojo.Product;
|
||||
import com.how2java.tmall.pojo.PropertyValue;
|
||||
import com.how2java.tmall.service.ProductService;
|
||||
import com.how2java.tmall.service.PropertyValueService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("")
|
||||
public class PropertyValueController {
|
||||
@Autowired
|
||||
PropertyValueService propertyValueService;
|
||||
@Autowired
|
||||
ProductService productService;
|
||||
|
||||
@RequestMapping("admin_propertyValue_edit")
|
||||
public String edit(Model model,int pid) {
|
||||
Product p = productService.get(pid);
|
||||
propertyValueService.init(p);
|
||||
List<PropertyValue> pvs = propertyValueService.list(p.getId());
|
||||
|
||||
model.addAttribute("p", p);
|
||||
model.addAttribute("pvs", pvs);
|
||||
return "admin/editPropertyValue";
|
||||
}
|
||||
@RequestMapping("admin_propertyValue_update")
|
||||
@ResponseBody
|
||||
public String update(PropertyValue pv) {
|
||||
propertyValueService.update(pv);
|
||||
return "success";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,43 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.how2java.tmall.pojo.User;
|
||||
import com.how2java.tmall.service.UserService;
|
||||
import com.how2java.tmall.util.Page;
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping("")
|
||||
public class UserController {
|
||||
@Autowired
|
||||
UserService userService;
|
||||
|
||||
@RequestMapping("admin_user_list")
|
||||
public String list(Model model, Page page){
|
||||
PageHelper.offsetPage(page.getStart(),page.getCount());
|
||||
|
||||
List<User> us= userService.list();
|
||||
|
||||
int total = (int) new PageInfo<>(us).getTotal();
|
||||
page.setTotal(total);
|
||||
|
||||
model.addAttribute("us", us);
|
||||
model.addAttribute("page", page);
|
||||
|
||||
return "admin/listUser";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.mapper;
|
||||
|
||||
import com.how2java.tmall.pojo.Category;
|
||||
import com.how2java.tmall.pojo.CategoryExample;
|
||||
import java.util.List;
|
||||
|
||||
public interface CategoryMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(Category record);
|
||||
|
||||
int insertSelective(Category record);
|
||||
|
||||
List<Category> selectByExample(CategoryExample example);
|
||||
|
||||
Category selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(Category record);
|
||||
|
||||
int updateByPrimaryKey(Category record);
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.mapper;
|
||||
|
||||
import com.how2java.tmall.pojo.OrderItem;
|
||||
import com.how2java.tmall.pojo.OrderItemExample;
|
||||
import java.util.List;
|
||||
|
||||
public interface OrderItemMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(OrderItem record);
|
||||
|
||||
int insertSelective(OrderItem record);
|
||||
|
||||
List<OrderItem> selectByExample(OrderItemExample example);
|
||||
|
||||
OrderItem selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(OrderItem record);
|
||||
|
||||
int updateByPrimaryKey(OrderItem record);
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.mapper;
|
||||
|
||||
import com.how2java.tmall.pojo.Order;
|
||||
import com.how2java.tmall.pojo.OrderExample;
|
||||
import java.util.List;
|
||||
|
||||
public interface OrderMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(Order record);
|
||||
|
||||
int insertSelective(Order record);
|
||||
|
||||
List<Order> selectByExample(OrderExample example);
|
||||
|
||||
Order selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(Order record);
|
||||
|
||||
int updateByPrimaryKey(Order record);
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.mapper;
|
||||
|
||||
import com.how2java.tmall.pojo.ProductImage;
|
||||
import com.how2java.tmall.pojo.ProductImageExample;
|
||||
import java.util.List;
|
||||
|
||||
public interface ProductImageMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(ProductImage record);
|
||||
|
||||
int insertSelective(ProductImage record);
|
||||
|
||||
List<ProductImage> selectByExample(ProductImageExample example);
|
||||
|
||||
ProductImage selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(ProductImage record);
|
||||
|
||||
int updateByPrimaryKey(ProductImage record);
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.mapper;
|
||||
|
||||
import com.how2java.tmall.pojo.Product;
|
||||
import com.how2java.tmall.pojo.ProductExample;
|
||||
import java.util.List;
|
||||
|
||||
public interface ProductMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(Product record);
|
||||
|
||||
int insertSelective(Product record);
|
||||
|
||||
List<Product> selectByExample(ProductExample example);
|
||||
|
||||
Product selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(Product record);
|
||||
|
||||
int updateByPrimaryKey(Product record);
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.mapper;
|
||||
|
||||
import com.how2java.tmall.pojo.Property;
|
||||
import com.how2java.tmall.pojo.PropertyExample;
|
||||
import java.util.List;
|
||||
|
||||
public interface PropertyMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(Property record);
|
||||
|
||||
int insertSelective(Property record);
|
||||
|
||||
List<Property> selectByExample(PropertyExample example);
|
||||
|
||||
Property selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(Property record);
|
||||
|
||||
int updateByPrimaryKey(Property record);
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.mapper;
|
||||
|
||||
import com.how2java.tmall.pojo.PropertyValue;
|
||||
import com.how2java.tmall.pojo.PropertyValueExample;
|
||||
import java.util.List;
|
||||
|
||||
public interface PropertyValueMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(PropertyValue record);
|
||||
|
||||
int insertSelective(PropertyValue record);
|
||||
|
||||
List<PropertyValue> selectByExample(PropertyValueExample example);
|
||||
|
||||
PropertyValue selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(PropertyValue record);
|
||||
|
||||
int updateByPrimaryKey(PropertyValue record);
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.mapper;
|
||||
|
||||
import com.how2java.tmall.pojo.Review;
|
||||
import com.how2java.tmall.pojo.ReviewExample;
|
||||
import java.util.List;
|
||||
|
||||
public interface ReviewMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(Review record);
|
||||
|
||||
int insertSelective(Review record);
|
||||
|
||||
List<Review> selectByExample(ReviewExample example);
|
||||
|
||||
Review selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(Review record);
|
||||
|
||||
int updateByPrimaryKey(Review record);
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.mapper;
|
||||
|
||||
import com.how2java.tmall.pojo.User;
|
||||
import com.how2java.tmall.pojo.UserExample;
|
||||
import java.util.List;
|
||||
|
||||
public interface UserMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(User record);
|
||||
|
||||
int insertSelective(User record);
|
||||
|
||||
List<User> selectByExample(UserExample example);
|
||||
|
||||
User selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(User record);
|
||||
|
||||
int updateByPrimaryKey(User record);
|
||||
}
|
||||
|
@ -0,0 +1,49 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.pojo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Category {
|
||||
private Integer id;
|
||||
|
||||
private String name;
|
||||
|
||||
/*如下是非数据库字段*/
|
||||
private List<Product> products;
|
||||
|
||||
private List<List<Product>> productsByRow;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name == null ? null : name.trim();
|
||||
}
|
||||
|
||||
public List<Product> getProducts() {
|
||||
return products;
|
||||
}
|
||||
|
||||
public void setProducts(List<Product> products) {
|
||||
this.products = products;
|
||||
}
|
||||
|
||||
public List<List<Product>> getProductsByRow() {
|
||||
return productsByRow;
|
||||
}
|
||||
|
||||
public void setProductsByRow(List<List<Product>> productsByRow) {
|
||||
this.productsByRow = productsByRow;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,333 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.pojo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CategoryExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public CategoryExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Integer value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Integer value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Integer value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Integer value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Integer> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Integer> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIsNull() {
|
||||
addCriterion("name is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIsNotNull() {
|
||||
addCriterion("name is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameEqualTo(String value) {
|
||||
addCriterion("name =", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotEqualTo(String value) {
|
||||
addCriterion("name <>", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameGreaterThan(String value) {
|
||||
addCriterion("name >", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("name >=", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLessThan(String value) {
|
||||
addCriterion("name <", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLessThanOrEqualTo(String value) {
|
||||
addCriterion("name <=", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLike(String value) {
|
||||
addCriterion("name like", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotLike(String value) {
|
||||
addCriterion("name not like", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIn(List<String> values) {
|
||||
addCriterion("name in", values, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotIn(List<String> values) {
|
||||
addCriterion("name not in", values, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameBetween(String value1, String value2) {
|
||||
addCriterion("name between", value1, value2, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotBetween(String value1, String value2) {
|
||||
addCriterion("name not between", value1, value2, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,218 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.pojo;
|
||||
|
||||
import com.how2java.tmall.service.OrderService;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class Order {
|
||||
private Integer id;
|
||||
|
||||
private String orderCode;
|
||||
|
||||
private String address;
|
||||
|
||||
private String post;
|
||||
|
||||
private String receiver;
|
||||
|
||||
private String mobile;
|
||||
|
||||
private String userMessage;
|
||||
|
||||
private Date createDate;
|
||||
|
||||
private Date payDate;
|
||||
|
||||
private Date deliveryDate;
|
||||
|
||||
private Date confirmDate;
|
||||
|
||||
private Integer uid;
|
||||
|
||||
private String status;
|
||||
|
||||
|
||||
/*如下是非数据库字段*/
|
||||
private List<OrderItem> orderItems;
|
||||
|
||||
private User user;
|
||||
|
||||
private float total;
|
||||
|
||||
private int totalNumber;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOrderCode() {
|
||||
return orderCode;
|
||||
}
|
||||
|
||||
public void setOrderCode(String orderCode) {
|
||||
this.orderCode = orderCode == null ? null : orderCode.trim();
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address == null ? null : address.trim();
|
||||
}
|
||||
|
||||
public String getPost() {
|
||||
return post;
|
||||
}
|
||||
|
||||
public void setPost(String post) {
|
||||
this.post = post == null ? null : post.trim();
|
||||
}
|
||||
|
||||
public String getReceiver() {
|
||||
return receiver;
|
||||
}
|
||||
|
||||
public void setReceiver(String receiver) {
|
||||
this.receiver = receiver == null ? null : receiver.trim();
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile == null ? null : mobile.trim();
|
||||
}
|
||||
|
||||
public String getUserMessage() {
|
||||
return userMessage;
|
||||
}
|
||||
|
||||
public void setUserMessage(String userMessage) {
|
||||
this.userMessage = userMessage == null ? null : userMessage.trim();
|
||||
}
|
||||
|
||||
public Date getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateDate(Date createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
public Date getPayDate() {
|
||||
return payDate;
|
||||
}
|
||||
|
||||
public void setPayDate(Date payDate) {
|
||||
this.payDate = payDate;
|
||||
}
|
||||
|
||||
public Date getDeliveryDate() {
|
||||
return deliveryDate;
|
||||
}
|
||||
|
||||
public void setDeliveryDate(Date deliveryDate) {
|
||||
this.deliveryDate = deliveryDate;
|
||||
}
|
||||
|
||||
public Date getConfirmDate() {
|
||||
return confirmDate;
|
||||
}
|
||||
|
||||
public void setConfirmDate(Date confirmDate) {
|
||||
this.confirmDate = confirmDate;
|
||||
}
|
||||
|
||||
public Integer getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(Integer uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status == null ? null : status.trim();
|
||||
}
|
||||
|
||||
public List<OrderItem> getOrderItems() {
|
||||
return orderItems;
|
||||
}
|
||||
|
||||
public void setOrderItems(List<OrderItem> orderItems) {
|
||||
this.orderItems = orderItems;
|
||||
}
|
||||
|
||||
|
||||
public static void main(String args[]){
|
||||
Order o = new Order();
|
||||
o.setStatus(OrderService.delete);
|
||||
System.out.println(o.getStatusDesc());
|
||||
}
|
||||
public String getStatusDesc(){
|
||||
String desc ="未知";
|
||||
switch(status){
|
||||
case OrderService.waitPay:
|
||||
desc="待付款";
|
||||
break;
|
||||
case OrderService.waitDelivery:
|
||||
desc="待发货";
|
||||
break;
|
||||
case OrderService.waitConfirm:
|
||||
desc="待收货";
|
||||
break;
|
||||
case OrderService.waitReview:
|
||||
desc="等评价";
|
||||
break;
|
||||
case OrderService.finish:
|
||||
desc="完成";
|
||||
break;
|
||||
case OrderService.delete:
|
||||
desc="刪除";
|
||||
break;
|
||||
default:
|
||||
desc="未知";
|
||||
}
|
||||
return desc;
|
||||
}
|
||||
|
||||
|
||||
public float getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(float total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public int getTotalNumber() {
|
||||
return totalNumber;
|
||||
}
|
||||
|
||||
public void setTotalNumber(int totalNumber) {
|
||||
this.totalNumber = totalNumber;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,67 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.pojo;
|
||||
|
||||
public class OrderItem {
|
||||
private Integer id;
|
||||
|
||||
private Integer pid;
|
||||
|
||||
private Integer oid;
|
||||
|
||||
private Integer uid;
|
||||
|
||||
private Integer number;
|
||||
|
||||
/*非数据库字段*/
|
||||
private Product product;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getPid() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
public void setPid(Integer pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
public Integer getOid() {
|
||||
return oid;
|
||||
}
|
||||
|
||||
public void setOid(Integer oid) {
|
||||
this.oid = oid;
|
||||
}
|
||||
|
||||
public Integer getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(Integer uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public Integer getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(Integer number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public Product getProduct() {
|
||||
return product;
|
||||
}
|
||||
|
||||
public void setProduct(Product product) {
|
||||
this.product = product;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,503 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.pojo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class OrderItemExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public OrderItemExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Integer value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Integer value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Integer value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Integer value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Integer> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Integer> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidIsNull() {
|
||||
addCriterion("pid is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidIsNotNull() {
|
||||
addCriterion("pid is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidEqualTo(Integer value) {
|
||||
addCriterion("pid =", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidNotEqualTo(Integer value) {
|
||||
addCriterion("pid <>", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidGreaterThan(Integer value) {
|
||||
addCriterion("pid >", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("pid >=", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidLessThan(Integer value) {
|
||||
addCriterion("pid <", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("pid <=", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidIn(List<Integer> values) {
|
||||
addCriterion("pid in", values, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidNotIn(List<Integer> values) {
|
||||
addCriterion("pid not in", values, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidBetween(Integer value1, Integer value2) {
|
||||
addCriterion("pid between", value1, value2, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("pid not between", value1, value2, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOidIsNull() {
|
||||
addCriterion("oid is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOidIsNotNull() {
|
||||
addCriterion("oid is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOidEqualTo(Integer value) {
|
||||
addCriterion("oid =", value, "oid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOidNotEqualTo(Integer value) {
|
||||
addCriterion("oid <>", value, "oid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOidGreaterThan(Integer value) {
|
||||
addCriterion("oid >", value, "oid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOidGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("oid >=", value, "oid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOidLessThan(Integer value) {
|
||||
addCriterion("oid <", value, "oid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOidLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("oid <=", value, "oid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOidIn(List<Integer> values) {
|
||||
addCriterion("oid in", values, "oid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOidNotIn(List<Integer> values) {
|
||||
addCriterion("oid not in", values, "oid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOidBetween(Integer value1, Integer value2) {
|
||||
addCriterion("oid between", value1, value2, "oid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOidNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("oid not between", value1, value2, "oid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidIsNull() {
|
||||
addCriterion("uid is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidIsNotNull() {
|
||||
addCriterion("uid is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidEqualTo(Integer value) {
|
||||
addCriterion("uid =", value, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidNotEqualTo(Integer value) {
|
||||
addCriterion("uid <>", value, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidGreaterThan(Integer value) {
|
||||
addCriterion("uid >", value, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("uid >=", value, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidLessThan(Integer value) {
|
||||
addCriterion("uid <", value, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("uid <=", value, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidIn(List<Integer> values) {
|
||||
addCriterion("uid in", values, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidNotIn(List<Integer> values) {
|
||||
addCriterion("uid not in", values, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidBetween(Integer value1, Integer value2) {
|
||||
addCriterion("uid between", value1, value2, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("uid not between", value1, value2, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNumberIsNull() {
|
||||
addCriterion("number is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNumberIsNotNull() {
|
||||
addCriterion("number is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNumberEqualTo(Integer value) {
|
||||
addCriterion("number =", value, "number");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNumberNotEqualTo(Integer value) {
|
||||
addCriterion("number <>", value, "number");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNumberGreaterThan(Integer value) {
|
||||
addCriterion("number >", value, "number");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNumberGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("number >=", value, "number");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNumberLessThan(Integer value) {
|
||||
addCriterion("number <", value, "number");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNumberLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("number <=", value, "number");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNumberIn(List<Integer> values) {
|
||||
addCriterion("number in", values, "number");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNumberNotIn(List<Integer> values) {
|
||||
addCriterion("number not in", values, "number");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNumberBetween(Integer value1, Integer value2) {
|
||||
addCriterion("number between", value1, value2, "number");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNumberNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("number not between", value1, value2, "number");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,153 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.pojo;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class Product {
|
||||
private Integer id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String subTitle;
|
||||
|
||||
private Float originalPrice;
|
||||
|
||||
private Float promotePrice;
|
||||
|
||||
private Integer stock;
|
||||
|
||||
private Integer cid;
|
||||
|
||||
private Date createDate;
|
||||
|
||||
|
||||
/*非数据库字段*/
|
||||
private Category category;
|
||||
|
||||
private ProductImage firstProductImage;
|
||||
|
||||
private List<ProductImage> productSingleImages;
|
||||
|
||||
private List<ProductImage> productDetailImages;
|
||||
|
||||
private int saleCount;
|
||||
|
||||
private int reviewCount;
|
||||
|
||||
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(Category category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name == null ? null : name.trim();
|
||||
}
|
||||
|
||||
public String getSubTitle() {
|
||||
return subTitle;
|
||||
}
|
||||
|
||||
public void setSubTitle(String subTitle) {
|
||||
this.subTitle = subTitle == null ? null : subTitle.trim();
|
||||
}
|
||||
|
||||
public Float getOriginalPrice() {
|
||||
return originalPrice;
|
||||
}
|
||||
|
||||
public void setOriginalPrice(Float originalPrice) {
|
||||
this.originalPrice = originalPrice;
|
||||
}
|
||||
|
||||
public Float getPromotePrice() {
|
||||
return promotePrice;
|
||||
}
|
||||
|
||||
public void setPromotePrice(Float promotePrice) {
|
||||
this.promotePrice = promotePrice;
|
||||
}
|
||||
|
||||
public Integer getStock() {
|
||||
return stock;
|
||||
}
|
||||
|
||||
public void setStock(Integer stock) {
|
||||
this.stock = stock;
|
||||
}
|
||||
|
||||
public Integer getCid() {
|
||||
return cid;
|
||||
}
|
||||
|
||||
public void setCid(Integer cid) {
|
||||
this.cid = cid;
|
||||
}
|
||||
|
||||
public Date getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateDate(Date createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
public ProductImage getFirstProductImage() {
|
||||
return firstProductImage;
|
||||
}
|
||||
|
||||
|
||||
public void setFirstProductImage(ProductImage firstProductImage) {
|
||||
this.firstProductImage = firstProductImage;
|
||||
}
|
||||
|
||||
public List<ProductImage> getProductSingleImages() {
|
||||
return productSingleImages;
|
||||
}
|
||||
|
||||
public void setProductSingleImages(List<ProductImage> productSingleImages) {
|
||||
this.productSingleImages = productSingleImages;
|
||||
}
|
||||
|
||||
public List<ProductImage> getProductDetailImages() {
|
||||
return productDetailImages;
|
||||
}
|
||||
|
||||
public void setProductDetailImages(List<ProductImage> productDetailImages) {
|
||||
this.productDetailImages = productDetailImages;
|
||||
}
|
||||
|
||||
public int getSaleCount() {
|
||||
return saleCount;
|
||||
}
|
||||
|
||||
public void setSaleCount(int saleCount) {
|
||||
this.saleCount = saleCount;
|
||||
}
|
||||
|
||||
public int getReviewCount() {
|
||||
return reviewCount;
|
||||
}
|
||||
|
||||
public void setReviewCount(int reviewCount) {
|
||||
this.reviewCount = reviewCount;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,704 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.pojo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class ProductExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public ProductExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Integer value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Integer value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Integer value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Integer value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Integer> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Integer> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIsNull() {
|
||||
addCriterion("name is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIsNotNull() {
|
||||
addCriterion("name is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameEqualTo(String value) {
|
||||
addCriterion("name =", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotEqualTo(String value) {
|
||||
addCriterion("name <>", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameGreaterThan(String value) {
|
||||
addCriterion("name >", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("name >=", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLessThan(String value) {
|
||||
addCriterion("name <", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLessThanOrEqualTo(String value) {
|
||||
addCriterion("name <=", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLike(String value) {
|
||||
addCriterion("name like", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotLike(String value) {
|
||||
addCriterion("name not like", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIn(List<String> values) {
|
||||
addCriterion("name in", values, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotIn(List<String> values) {
|
||||
addCriterion("name not in", values, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameBetween(String value1, String value2) {
|
||||
addCriterion("name between", value1, value2, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotBetween(String value1, String value2) {
|
||||
addCriterion("name not between", value1, value2, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSubTitleIsNull() {
|
||||
addCriterion("subTitle is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSubTitleIsNotNull() {
|
||||
addCriterion("subTitle is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSubTitleEqualTo(String value) {
|
||||
addCriterion("subTitle =", value, "subTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSubTitleNotEqualTo(String value) {
|
||||
addCriterion("subTitle <>", value, "subTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSubTitleGreaterThan(String value) {
|
||||
addCriterion("subTitle >", value, "subTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSubTitleGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("subTitle >=", value, "subTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSubTitleLessThan(String value) {
|
||||
addCriterion("subTitle <", value, "subTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSubTitleLessThanOrEqualTo(String value) {
|
||||
addCriterion("subTitle <=", value, "subTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSubTitleLike(String value) {
|
||||
addCriterion("subTitle like", value, "subTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSubTitleNotLike(String value) {
|
||||
addCriterion("subTitle not like", value, "subTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSubTitleIn(List<String> values) {
|
||||
addCriterion("subTitle in", values, "subTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSubTitleNotIn(List<String> values) {
|
||||
addCriterion("subTitle not in", values, "subTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSubTitleBetween(String value1, String value2) {
|
||||
addCriterion("subTitle between", value1, value2, "subTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andSubTitleNotBetween(String value1, String value2) {
|
||||
addCriterion("subTitle not between", value1, value2, "subTitle");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOriginalPriceIsNull() {
|
||||
addCriterion("originalPrice is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOriginalPriceIsNotNull() {
|
||||
addCriterion("originalPrice is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOriginalPriceEqualTo(Float value) {
|
||||
addCriterion("originalPrice =", value, "originalPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOriginalPriceNotEqualTo(Float value) {
|
||||
addCriterion("originalPrice <>", value, "originalPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOriginalPriceGreaterThan(Float value) {
|
||||
addCriterion("originalPrice >", value, "originalPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOriginalPriceGreaterThanOrEqualTo(Float value) {
|
||||
addCriterion("originalPrice >=", value, "originalPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOriginalPriceLessThan(Float value) {
|
||||
addCriterion("originalPrice <", value, "originalPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOriginalPriceLessThanOrEqualTo(Float value) {
|
||||
addCriterion("originalPrice <=", value, "originalPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOriginalPriceIn(List<Float> values) {
|
||||
addCriterion("originalPrice in", values, "originalPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOriginalPriceNotIn(List<Float> values) {
|
||||
addCriterion("originalPrice not in", values, "originalPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOriginalPriceBetween(Float value1, Float value2) {
|
||||
addCriterion("originalPrice between", value1, value2, "originalPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOriginalPriceNotBetween(Float value1, Float value2) {
|
||||
addCriterion("originalPrice not between", value1, value2, "originalPrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotePriceIsNull() {
|
||||
addCriterion("promotePrice is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotePriceIsNotNull() {
|
||||
addCriterion("promotePrice is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotePriceEqualTo(Float value) {
|
||||
addCriterion("promotePrice =", value, "promotePrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotePriceNotEqualTo(Float value) {
|
||||
addCriterion("promotePrice <>", value, "promotePrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotePriceGreaterThan(Float value) {
|
||||
addCriterion("promotePrice >", value, "promotePrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotePriceGreaterThanOrEqualTo(Float value) {
|
||||
addCriterion("promotePrice >=", value, "promotePrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotePriceLessThan(Float value) {
|
||||
addCriterion("promotePrice <", value, "promotePrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotePriceLessThanOrEqualTo(Float value) {
|
||||
addCriterion("promotePrice <=", value, "promotePrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotePriceIn(List<Float> values) {
|
||||
addCriterion("promotePrice in", values, "promotePrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotePriceNotIn(List<Float> values) {
|
||||
addCriterion("promotePrice not in", values, "promotePrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotePriceBetween(Float value1, Float value2) {
|
||||
addCriterion("promotePrice between", value1, value2, "promotePrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPromotePriceNotBetween(Float value1, Float value2) {
|
||||
addCriterion("promotePrice not between", value1, value2, "promotePrice");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockIsNull() {
|
||||
addCriterion("stock is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockIsNotNull() {
|
||||
addCriterion("stock is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockEqualTo(Integer value) {
|
||||
addCriterion("stock =", value, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockNotEqualTo(Integer value) {
|
||||
addCriterion("stock <>", value, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockGreaterThan(Integer value) {
|
||||
addCriterion("stock >", value, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("stock >=", value, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockLessThan(Integer value) {
|
||||
addCriterion("stock <", value, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("stock <=", value, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockIn(List<Integer> values) {
|
||||
addCriterion("stock in", values, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockNotIn(List<Integer> values) {
|
||||
addCriterion("stock not in", values, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockBetween(Integer value1, Integer value2) {
|
||||
addCriterion("stock between", value1, value2, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStockNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("stock not between", value1, value2, "stock");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidIsNull() {
|
||||
addCriterion("cid is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidIsNotNull() {
|
||||
addCriterion("cid is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidEqualTo(Integer value) {
|
||||
addCriterion("cid =", value, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidNotEqualTo(Integer value) {
|
||||
addCriterion("cid <>", value, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidGreaterThan(Integer value) {
|
||||
addCriterion("cid >", value, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("cid >=", value, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidLessThan(Integer value) {
|
||||
addCriterion("cid <", value, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("cid <=", value, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidIn(List<Integer> values) {
|
||||
addCriterion("cid in", values, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidNotIn(List<Integer> values) {
|
||||
addCriterion("cid not in", values, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidBetween(Integer value1, Integer value2) {
|
||||
addCriterion("cid between", value1, value2, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("cid not between", value1, value2, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateIsNull() {
|
||||
addCriterion("createDate is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateIsNotNull() {
|
||||
addCriterion("createDate is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateEqualTo(Date value) {
|
||||
addCriterion("createDate =", value, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateNotEqualTo(Date value) {
|
||||
addCriterion("createDate <>", value, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateGreaterThan(Date value) {
|
||||
addCriterion("createDate >", value, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("createDate >=", value, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateLessThan(Date value) {
|
||||
addCriterion("createDate <", value, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateLessThanOrEqualTo(Date value) {
|
||||
addCriterion("createDate <=", value, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateIn(List<Date> values) {
|
||||
addCriterion("createDate in", values, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateNotIn(List<Date> values) {
|
||||
addCriterion("createDate not in", values, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateBetween(Date value1, Date value2) {
|
||||
addCriterion("createDate between", value1, value2, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateNotBetween(Date value1, Date value2) {
|
||||
addCriterion("createDate not between", value1, value2, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,36 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.pojo;
|
||||
|
||||
public class ProductImage {
|
||||
private Integer id;
|
||||
|
||||
private Integer pid;
|
||||
|
||||
private String type;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getPid() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
public void setPid(Integer pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type == null ? null : type.trim();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,393 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.pojo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ProductImageExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public ProductImageExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Integer value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Integer value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Integer value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Integer value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Integer> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Integer> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidIsNull() {
|
||||
addCriterion("pid is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidIsNotNull() {
|
||||
addCriterion("pid is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidEqualTo(Integer value) {
|
||||
addCriterion("pid =", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidNotEqualTo(Integer value) {
|
||||
addCriterion("pid <>", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidGreaterThan(Integer value) {
|
||||
addCriterion("pid >", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("pid >=", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidLessThan(Integer value) {
|
||||
addCriterion("pid <", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("pid <=", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidIn(List<Integer> values) {
|
||||
addCriterion("pid in", values, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidNotIn(List<Integer> values) {
|
||||
addCriterion("pid not in", values, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidBetween(Integer value1, Integer value2) {
|
||||
addCriterion("pid between", value1, value2, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("pid not between", value1, value2, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeIsNull() {
|
||||
addCriterion("type is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeIsNotNull() {
|
||||
addCriterion("type is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeEqualTo(String value) {
|
||||
addCriterion("type =", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotEqualTo(String value) {
|
||||
addCriterion("type <>", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeGreaterThan(String value) {
|
||||
addCriterion("type >", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("type >=", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeLessThan(String value) {
|
||||
addCriterion("type <", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeLessThanOrEqualTo(String value) {
|
||||
addCriterion("type <=", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeLike(String value) {
|
||||
addCriterion("type like", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotLike(String value) {
|
||||
addCriterion("type not like", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeIn(List<String> values) {
|
||||
addCriterion("type in", values, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotIn(List<String> values) {
|
||||
addCriterion("type not in", values, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeBetween(String value1, String value2) {
|
||||
addCriterion("type between", value1, value2, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotBetween(String value1, String value2) {
|
||||
addCriterion("type not between", value1, value2, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,46 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.pojo;
|
||||
|
||||
public class Property {
|
||||
private Integer id;
|
||||
|
||||
private Integer cid;
|
||||
|
||||
private String name;
|
||||
|
||||
/*非数据库字段*/
|
||||
private Category category;
|
||||
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(Category category) {
|
||||
this.category = category;
|
||||
}
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getCid() {
|
||||
return cid;
|
||||
}
|
||||
|
||||
public void setCid(Integer cid) {
|
||||
this.cid = cid;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name == null ? null : name.trim();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,393 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.pojo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PropertyExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public PropertyExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Integer value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Integer value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Integer value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Integer value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Integer> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Integer> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidIsNull() {
|
||||
addCriterion("cid is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidIsNotNull() {
|
||||
addCriterion("cid is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidEqualTo(Integer value) {
|
||||
addCriterion("cid =", value, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidNotEqualTo(Integer value) {
|
||||
addCriterion("cid <>", value, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidGreaterThan(Integer value) {
|
||||
addCriterion("cid >", value, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("cid >=", value, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidLessThan(Integer value) {
|
||||
addCriterion("cid <", value, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("cid <=", value, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidIn(List<Integer> values) {
|
||||
addCriterion("cid in", values, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidNotIn(List<Integer> values) {
|
||||
addCriterion("cid not in", values, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidBetween(Integer value1, Integer value2) {
|
||||
addCriterion("cid between", value1, value2, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCidNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("cid not between", value1, value2, "cid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIsNull() {
|
||||
addCriterion("name is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIsNotNull() {
|
||||
addCriterion("name is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameEqualTo(String value) {
|
||||
addCriterion("name =", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotEqualTo(String value) {
|
||||
addCriterion("name <>", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameGreaterThan(String value) {
|
||||
addCriterion("name >", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("name >=", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLessThan(String value) {
|
||||
addCriterion("name <", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLessThanOrEqualTo(String value) {
|
||||
addCriterion("name <=", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLike(String value) {
|
||||
addCriterion("name like", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotLike(String value) {
|
||||
addCriterion("name not like", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIn(List<String> values) {
|
||||
addCriterion("name in", values, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotIn(List<String> values) {
|
||||
addCriterion("name not in", values, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameBetween(String value1, String value2) {
|
||||
addCriterion("name between", value1, value2, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotBetween(String value1, String value2) {
|
||||
addCriterion("name not between", value1, value2, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,57 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.pojo;
|
||||
|
||||
public class PropertyValue {
|
||||
private Integer id;
|
||||
|
||||
private Integer pid;
|
||||
|
||||
private Integer ptid;
|
||||
|
||||
private String value;
|
||||
|
||||
/*非数据库字段*/
|
||||
private Property property;
|
||||
|
||||
public Property getProperty() {
|
||||
return property;
|
||||
}
|
||||
|
||||
public void setProperty(Property property) {
|
||||
this.property = property;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getPid() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
public void setPid(Integer pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
public Integer getPtid() {
|
||||
return ptid;
|
||||
}
|
||||
|
||||
public void setPtid(Integer ptid) {
|
||||
this.ptid = ptid;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value == null ? null : value.trim();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,453 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.pojo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PropertyValueExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public PropertyValueExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Integer value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Integer value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Integer value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Integer value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Integer> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Integer> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidIsNull() {
|
||||
addCriterion("pid is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidIsNotNull() {
|
||||
addCriterion("pid is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidEqualTo(Integer value) {
|
||||
addCriterion("pid =", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidNotEqualTo(Integer value) {
|
||||
addCriterion("pid <>", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidGreaterThan(Integer value) {
|
||||
addCriterion("pid >", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("pid >=", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidLessThan(Integer value) {
|
||||
addCriterion("pid <", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("pid <=", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidIn(List<Integer> values) {
|
||||
addCriterion("pid in", values, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidNotIn(List<Integer> values) {
|
||||
addCriterion("pid not in", values, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidBetween(Integer value1, Integer value2) {
|
||||
addCriterion("pid between", value1, value2, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("pid not between", value1, value2, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPtidIsNull() {
|
||||
addCriterion("ptid is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPtidIsNotNull() {
|
||||
addCriterion("ptid is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPtidEqualTo(Integer value) {
|
||||
addCriterion("ptid =", value, "ptid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPtidNotEqualTo(Integer value) {
|
||||
addCriterion("ptid <>", value, "ptid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPtidGreaterThan(Integer value) {
|
||||
addCriterion("ptid >", value, "ptid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPtidGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("ptid >=", value, "ptid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPtidLessThan(Integer value) {
|
||||
addCriterion("ptid <", value, "ptid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPtidLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("ptid <=", value, "ptid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPtidIn(List<Integer> values) {
|
||||
addCriterion("ptid in", values, "ptid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPtidNotIn(List<Integer> values) {
|
||||
addCriterion("ptid not in", values, "ptid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPtidBetween(Integer value1, Integer value2) {
|
||||
addCriterion("ptid between", value1, value2, "ptid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPtidNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("ptid not between", value1, value2, "ptid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andValueIsNull() {
|
||||
addCriterion("value is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andValueIsNotNull() {
|
||||
addCriterion("value is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andValueEqualTo(String value) {
|
||||
addCriterion("value =", value, "value");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andValueNotEqualTo(String value) {
|
||||
addCriterion("value <>", value, "value");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andValueGreaterThan(String value) {
|
||||
addCriterion("value >", value, "value");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andValueGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("value >=", value, "value");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andValueLessThan(String value) {
|
||||
addCriterion("value <", value, "value");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andValueLessThanOrEqualTo(String value) {
|
||||
addCriterion("value <=", value, "value");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andValueLike(String value) {
|
||||
addCriterion("value like", value, "value");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andValueNotLike(String value) {
|
||||
addCriterion("value not like", value, "value");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andValueIn(List<String> values) {
|
||||
addCriterion("value in", values, "value");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andValueNotIn(List<String> values) {
|
||||
addCriterion("value not in", values, "value");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andValueBetween(String value1, String value2) {
|
||||
addCriterion("value between", value1, value2, "value");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andValueNotBetween(String value1, String value2) {
|
||||
addCriterion("value not between", value1, value2, "value");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,68 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.pojo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class Review {
|
||||
private Integer id;
|
||||
|
||||
private String content;
|
||||
|
||||
private Integer uid;
|
||||
|
||||
private Integer pid;
|
||||
|
||||
private Date createDate;
|
||||
/*非数据库字段*/
|
||||
private User user;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content == null ? null : content.trim();
|
||||
}
|
||||
|
||||
public Integer getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(Integer uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public Integer getPid() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
public void setPid(Integer pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
public Date getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateDate(Date createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,514 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.pojo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class ReviewExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public ReviewExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Integer value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Integer value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Integer value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Integer value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Integer> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Integer> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andContentIsNull() {
|
||||
addCriterion("content is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andContentIsNotNull() {
|
||||
addCriterion("content is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andContentEqualTo(String value) {
|
||||
addCriterion("content =", value, "content");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andContentNotEqualTo(String value) {
|
||||
addCriterion("content <>", value, "content");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andContentGreaterThan(String value) {
|
||||
addCriterion("content >", value, "content");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andContentGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("content >=", value, "content");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andContentLessThan(String value) {
|
||||
addCriterion("content <", value, "content");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andContentLessThanOrEqualTo(String value) {
|
||||
addCriterion("content <=", value, "content");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andContentLike(String value) {
|
||||
addCriterion("content like", value, "content");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andContentNotLike(String value) {
|
||||
addCriterion("content not like", value, "content");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andContentIn(List<String> values) {
|
||||
addCriterion("content in", values, "content");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andContentNotIn(List<String> values) {
|
||||
addCriterion("content not in", values, "content");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andContentBetween(String value1, String value2) {
|
||||
addCriterion("content between", value1, value2, "content");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andContentNotBetween(String value1, String value2) {
|
||||
addCriterion("content not between", value1, value2, "content");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidIsNull() {
|
||||
addCriterion("uid is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidIsNotNull() {
|
||||
addCriterion("uid is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidEqualTo(Integer value) {
|
||||
addCriterion("uid =", value, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidNotEqualTo(Integer value) {
|
||||
addCriterion("uid <>", value, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidGreaterThan(Integer value) {
|
||||
addCriterion("uid >", value, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("uid >=", value, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidLessThan(Integer value) {
|
||||
addCriterion("uid <", value, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("uid <=", value, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidIn(List<Integer> values) {
|
||||
addCriterion("uid in", values, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidNotIn(List<Integer> values) {
|
||||
addCriterion("uid not in", values, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidBetween(Integer value1, Integer value2) {
|
||||
addCriterion("uid between", value1, value2, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUidNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("uid not between", value1, value2, "uid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidIsNull() {
|
||||
addCriterion("pid is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidIsNotNull() {
|
||||
addCriterion("pid is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidEqualTo(Integer value) {
|
||||
addCriterion("pid =", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidNotEqualTo(Integer value) {
|
||||
addCriterion("pid <>", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidGreaterThan(Integer value) {
|
||||
addCriterion("pid >", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("pid >=", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidLessThan(Integer value) {
|
||||
addCriterion("pid <", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("pid <=", value, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidIn(List<Integer> values) {
|
||||
addCriterion("pid in", values, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidNotIn(List<Integer> values) {
|
||||
addCriterion("pid not in", values, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidBetween(Integer value1, Integer value2) {
|
||||
addCriterion("pid between", value1, value2, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPidNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("pid not between", value1, value2, "pid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateIsNull() {
|
||||
addCriterion("createDate is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateIsNotNull() {
|
||||
addCriterion("createDate is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateEqualTo(Date value) {
|
||||
addCriterion("createDate =", value, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateNotEqualTo(Date value) {
|
||||
addCriterion("createDate <>", value, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateGreaterThan(Date value) {
|
||||
addCriterion("createDate >", value, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("createDate >=", value, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateLessThan(Date value) {
|
||||
addCriterion("createDate <", value, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateLessThanOrEqualTo(Date value) {
|
||||
addCriterion("createDate <=", value, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateIn(List<Date> values) {
|
||||
addCriterion("createDate in", values, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateNotIn(List<Date> values) {
|
||||
addCriterion("createDate not in", values, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateBetween(Date value1, Date value2) {
|
||||
addCriterion("createDate between", value1, value2, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateDateNotBetween(Date value1, Date value2) {
|
||||
addCriterion("createDate not between", value1, value2, "createDate");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,55 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.pojo;
|
||||
|
||||
public class User {
|
||||
private Integer id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String password;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name == null ? null : name.trim();
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password == null ? null : password.trim();
|
||||
}
|
||||
|
||||
public String getAnonymousName(){
|
||||
if(null==name)
|
||||
return null;
|
||||
|
||||
if(name.length()<=1)
|
||||
return "*";
|
||||
|
||||
if(name.length()==2)
|
||||
return name.substring(0,1) +"*";
|
||||
|
||||
char[] cs =name.toCharArray();
|
||||
for (int i = 1; i < cs.length-1; i++) {
|
||||
cs[i]='*';
|
||||
}
|
||||
return new String(cs);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,403 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.pojo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class UserExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public UserExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Integer value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Integer value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Integer value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Integer value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Integer> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Integer> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIsNull() {
|
||||
addCriterion("name is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIsNotNull() {
|
||||
addCriterion("name is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameEqualTo(String value) {
|
||||
addCriterion("name =", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotEqualTo(String value) {
|
||||
addCriterion("name <>", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameGreaterThan(String value) {
|
||||
addCriterion("name >", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("name >=", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLessThan(String value) {
|
||||
addCriterion("name <", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLessThanOrEqualTo(String value) {
|
||||
addCriterion("name <=", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLike(String value) {
|
||||
addCriterion("name like", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotLike(String value) {
|
||||
addCriterion("name not like", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIn(List<String> values) {
|
||||
addCriterion("name in", values, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotIn(List<String> values) {
|
||||
addCriterion("name not in", values, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameBetween(String value1, String value2) {
|
||||
addCriterion("name between", value1, value2, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotBetween(String value1, String value2) {
|
||||
addCriterion("name not between", value1, value2, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPasswordIsNull() {
|
||||
addCriterion("password is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPasswordIsNotNull() {
|
||||
addCriterion("password is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPasswordEqualTo(String value) {
|
||||
addCriterion("password =", value, "password");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPasswordNotEqualTo(String value) {
|
||||
addCriterion("password <>", value, "password");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPasswordGreaterThan(String value) {
|
||||
addCriterion("password >", value, "password");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPasswordGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("password >=", value, "password");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPasswordLessThan(String value) {
|
||||
addCriterion("password <", value, "password");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPasswordLessThanOrEqualTo(String value) {
|
||||
addCriterion("password <=", value, "password");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPasswordLike(String value) {
|
||||
addCriterion("password like", value, "password");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPasswordNotLike(String value) {
|
||||
addCriterion("password not like", value, "password");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPasswordIn(List<String> values) {
|
||||
addCriterion("password in", values, "password");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPasswordNotIn(List<String> values) {
|
||||
addCriterion("password not in", values, "password");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPasswordBetween(String value1, String value2) {
|
||||
addCriterion("password between", value1, value2, "password");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPasswordNotBetween(String value1, String value2) {
|
||||
addCriterion("password not between", value1, value2, "password");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.service;
|
||||
|
||||
import com.how2java.tmall.pojo.Category;
|
||||
import java.util.List;
|
||||
|
||||
public interface CategoryService{
|
||||
List<Category> list();
|
||||
|
||||
void add(Category category);
|
||||
|
||||
void delete(int id);
|
||||
|
||||
Category get(int id);
|
||||
|
||||
void update(Category category);
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.how2java.tmall.pojo.Order;
|
||||
import com.how2java.tmall.pojo.OrderItem;
|
||||
|
||||
public interface OrderItemService {
|
||||
|
||||
|
||||
void add(OrderItem c);
|
||||
|
||||
void delete(int id);
|
||||
void update(OrderItem c);
|
||||
OrderItem get(int id);
|
||||
List list();
|
||||
|
||||
void fill(List<Order> os);
|
||||
|
||||
void fill(Order o);
|
||||
|
||||
int getSaleCount(int pid);
|
||||
|
||||
List<OrderItem> listByUser(int uid);
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.how2java.tmall.pojo.Order;
|
||||
import com.how2java.tmall.pojo.OrderItem;
|
||||
|
||||
public interface OrderService {
|
||||
|
||||
String waitPay = "waitPay";
|
||||
String waitDelivery = "waitDelivery";
|
||||
String waitConfirm = "waitConfirm";
|
||||
String waitReview = "waitReview";
|
||||
String finish = "finish";
|
||||
String delete = "delete";
|
||||
|
||||
void add(Order c);
|
||||
float add(Order c,List<OrderItem> ois);
|
||||
void delete(int id);
|
||||
void update(Order c);
|
||||
Order get(int id);
|
||||
List list();
|
||||
List list(int uid, String excludedStatus);
|
||||
}
|
||||
|
@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.how2java.tmall.pojo.ProductImage;
|
||||
|
||||
public interface ProductImageService {
|
||||
|
||||
String type_single = "type_single";
|
||||
String type_detail = "type_detail";
|
||||
|
||||
void add(ProductImage pi);
|
||||
void delete(int id);
|
||||
void update(ProductImage pi);
|
||||
ProductImage get(int id);
|
||||
List list(int pid, String type);
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.how2java.tmall.pojo.Category;
|
||||
import com.how2java.tmall.pojo.Product;
|
||||
|
||||
public interface ProductService {
|
||||
void add(Product p);
|
||||
void delete(int id);
|
||||
void update(Product p);
|
||||
Product get(int id);
|
||||
List list(int cid);
|
||||
void setFirstProductImage(Product p);
|
||||
|
||||
void fill(List<Category> cs);
|
||||
|
||||
void fill(Category c);
|
||||
|
||||
void fillByRow(List<Category> cs);
|
||||
|
||||
void setSaleAndReviewNumber(Product p);
|
||||
|
||||
void setSaleAndReviewNumber(List<Product> ps);
|
||||
|
||||
List<Product> search(String keyword);
|
||||
}
|
||||
|
@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.service;
|
||||
|
||||
import com.how2java.tmall.pojo.Property;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface PropertyService {
|
||||
void add(Property c);
|
||||
void delete(int id);
|
||||
void update(Property c);
|
||||
Property get(int id);
|
||||
List list(int cid);
|
||||
}
|
||||
|
@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.service;
|
||||
|
||||
import com.how2java.tmall.pojo.Product;
|
||||
import com.how2java.tmall.pojo.PropertyValue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface PropertyValueService {
|
||||
void init(Product p);
|
||||
void update(PropertyValue pv);
|
||||
|
||||
PropertyValue get(int ptid, int pid);
|
||||
List<PropertyValue> list(int pid);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,21 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.how2java.tmall.pojo.Review;
|
||||
|
||||
public interface ReviewService {
|
||||
|
||||
|
||||
void add(Review c);
|
||||
|
||||
void delete(int id);
|
||||
void update(Review c);
|
||||
Review get(int id);
|
||||
List list(int pid);
|
||||
|
||||
int getCount(int pid);
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.how2java.tmall.pojo.User;
|
||||
|
||||
public interface UserService {
|
||||
void add(User c);
|
||||
void delete(int id);
|
||||
void update(User c);
|
||||
User get(int id);
|
||||
List list();
|
||||
boolean isExist(String name);
|
||||
|
||||
User get(String name, String password);
|
||||
}
|
||||
|
@ -0,0 +1,46 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.service.impl;
|
||||
|
||||
import com.how2java.tmall.mapper.CategoryMapper;
|
||||
import com.how2java.tmall.pojo.Category;
|
||||
import com.how2java.tmall.pojo.CategoryExample;
|
||||
import com.how2java.tmall.service.CategoryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CategoryServiceImpl implements CategoryService {
|
||||
@Autowired
|
||||
CategoryMapper categoryMapper;
|
||||
|
||||
@Override
|
||||
public List<Category> list() {
|
||||
CategoryExample example =new CategoryExample();
|
||||
example.setOrderByClause("id desc");
|
||||
return categoryMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(Category category) {
|
||||
categoryMapper.insert(category);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(int id) {
|
||||
categoryMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Category get(int id) {
|
||||
return categoryMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Category category) {
|
||||
categoryMapper.updateByPrimaryKeySelective(category);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,118 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.how2java.tmall.mapper.OrderItemMapper;
|
||||
import com.how2java.tmall.pojo.Order;
|
||||
import com.how2java.tmall.pojo.OrderItem;
|
||||
import com.how2java.tmall.pojo.OrderItemExample;
|
||||
import com.how2java.tmall.pojo.Product;
|
||||
import com.how2java.tmall.service.OrderItemService;
|
||||
import com.how2java.tmall.service.ProductService;
|
||||
|
||||
|
||||
@Service
|
||||
public class OrderItemServiceImpl implements OrderItemService {
|
||||
@Autowired
|
||||
OrderItemMapper orderItemMapper;
|
||||
@Autowired
|
||||
ProductService productService;
|
||||
|
||||
@Override
|
||||
public void add(OrderItem c) {
|
||||
orderItemMapper.insert(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(int id) {
|
||||
orderItemMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(OrderItem c) {
|
||||
orderItemMapper.updateByPrimaryKeySelective(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderItem get(int id) {
|
||||
OrderItem result = orderItemMapper.selectByPrimaryKey(id);
|
||||
setProduct(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<OrderItem> list(){
|
||||
OrderItemExample example =new OrderItemExample();
|
||||
example.setOrderByClause("id desc");
|
||||
return orderItemMapper.selectByExample(example);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fill(List<Order> os) {
|
||||
for (Order o : os) {
|
||||
fill(o);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSaleCount(int pid) {
|
||||
OrderItemExample example =new OrderItemExample();
|
||||
example.createCriteria().andPidEqualTo(pid);
|
||||
List<OrderItem> ois =orderItemMapper.selectByExample(example);
|
||||
int result =0;
|
||||
for (OrderItem oi : ois) {
|
||||
result+=oi.getNumber();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderItem> listByUser(int uid) {
|
||||
OrderItemExample example =new OrderItemExample();
|
||||
example.createCriteria().andUidEqualTo(uid).andOidIsNull();
|
||||
List<OrderItem> result =orderItemMapper.selectByExample(example);
|
||||
setProduct(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void fill(Order o) {
|
||||
OrderItemExample example =new OrderItemExample();
|
||||
example.createCriteria().andOidEqualTo(o.getId());
|
||||
example.setOrderByClause("id desc");
|
||||
List<OrderItem> ois =orderItemMapper.selectByExample(example);
|
||||
setProduct(ois);
|
||||
|
||||
float total = 0;
|
||||
int totalNumber = 0;
|
||||
for (OrderItem oi : ois) {
|
||||
total+=oi.getNumber()*oi.getProduct().getPromotePrice();
|
||||
totalNumber+=oi.getNumber();
|
||||
}
|
||||
o.setTotal(total);
|
||||
o.setTotalNumber(totalNumber);
|
||||
o.setOrderItems(ois);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void setProduct(List<OrderItem> ois){
|
||||
for (OrderItem oi: ois) {
|
||||
setProduct(oi);
|
||||
}
|
||||
}
|
||||
|
||||
private void setProduct(OrderItem oi) {
|
||||
Product p = productService.get(oi.getPid());
|
||||
oi.setProduct(p);
|
||||
}
|
||||
|
||||
|
||||
;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,96 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.service.impl;
|
||||
|
||||
import com.how2java.tmall.mapper.OrderMapper;
|
||||
import com.how2java.tmall.pojo.Order;
|
||||
import com.how2java.tmall.pojo.OrderExample;
|
||||
import com.how2java.tmall.pojo.OrderItem;
|
||||
import com.how2java.tmall.pojo.User;
|
||||
import com.how2java.tmall.service.OrderItemService;
|
||||
import com.how2java.tmall.service.OrderService;
|
||||
import com.how2java.tmall.service.UserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service
|
||||
public class OrderServiceImpl implements OrderService {
|
||||
@Autowired
|
||||
OrderMapper orderMapper;
|
||||
|
||||
@Autowired
|
||||
UserService userService;
|
||||
@Autowired
|
||||
OrderItemService orderItemService;
|
||||
|
||||
@Override
|
||||
public void add(Order c) {
|
||||
orderMapper.insert(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(int id) {
|
||||
orderMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Order c) {
|
||||
orderMapper.updateByPrimaryKeySelective(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Order get(int id) {
|
||||
return orderMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(propagation= Propagation.REQUIRED,rollbackForClassName="Exception")
|
||||
public float add(Order o, List<OrderItem> ois) {
|
||||
float total = 0;
|
||||
add(o);
|
||||
|
||||
if(false)
|
||||
throw new RuntimeException();
|
||||
|
||||
for (OrderItem oi: ois) {
|
||||
oi.setOid(o.getId());
|
||||
orderItemService.update(oi);
|
||||
total+=oi.getProduct().getPromotePrice()*oi.getNumber();
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
public List<Order> list(){
|
||||
OrderExample example =new OrderExample();
|
||||
example.setOrderByClause("id desc");
|
||||
return orderMapper.selectByExample(example);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List list(int uid, String excludedStatus) {
|
||||
OrderExample example =new OrderExample();
|
||||
example.createCriteria().andUidEqualTo(uid).andStatusNotEqualTo(excludedStatus);
|
||||
example.setOrderByClause("id desc");
|
||||
return orderMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
public void setUser(List<Order> os){
|
||||
for (Order o : os)
|
||||
setUser(o);
|
||||
}
|
||||
public void setUser(Order o){
|
||||
int uid = o.getUid();
|
||||
User u = userService.get(uid);
|
||||
o.setUser(u);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,52 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.how2java.tmall.mapper.ProductImageMapper;
|
||||
import com.how2java.tmall.pojo.ProductImage;
|
||||
import com.how2java.tmall.pojo.ProductImageExample;
|
||||
import com.how2java.tmall.service.ProductImageService;
|
||||
|
||||
@Service
|
||||
public class ProductImageServiceImpl implements ProductImageService {
|
||||
|
||||
@Autowired
|
||||
ProductImageMapper productImageMapper;
|
||||
@Override
|
||||
public void add(ProductImage pi) {
|
||||
productImageMapper.insert(pi);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(int id) {
|
||||
productImageMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(ProductImage pi) {
|
||||
productImageMapper.updateByPrimaryKeySelective(pi);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductImage get(int id) {
|
||||
return productImageMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List list(int pid, String type) {
|
||||
ProductImageExample example =new ProductImageExample();
|
||||
example.createCriteria()
|
||||
.andPidEqualTo(pid)
|
||||
.andTypeEqualTo(type);
|
||||
example.setOrderByClause("id desc");
|
||||
return productImageMapper.selectByExample(example);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,151 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.how2java.tmall.mapper.ProductMapper;
|
||||
import com.how2java.tmall.pojo.Category;
|
||||
import com.how2java.tmall.pojo.Product;
|
||||
import com.how2java.tmall.pojo.ProductExample;
|
||||
import com.how2java.tmall.pojo.ProductImage;
|
||||
import com.how2java.tmall.service.CategoryService;
|
||||
import com.how2java.tmall.service.OrderItemService;
|
||||
import com.how2java.tmall.service.ProductImageService;
|
||||
import com.how2java.tmall.service.ProductService;
|
||||
import com.how2java.tmall.service.ReviewService;
|
||||
@Service
|
||||
public class ProductServiceImpl implements ProductService {
|
||||
@Autowired
|
||||
ProductMapper productMapper;
|
||||
@Autowired
|
||||
CategoryService categoryService;
|
||||
@Autowired
|
||||
ProductImageService productImageService;
|
||||
@Autowired
|
||||
OrderItemService orderItemService;
|
||||
@Autowired
|
||||
ReviewService reviewService;
|
||||
|
||||
@Override
|
||||
public void add(Product p) {
|
||||
productMapper.insert(p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(int id) {
|
||||
productMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Product p) {
|
||||
productMapper.updateByPrimaryKeySelective(p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Product get(int id) {
|
||||
Product p = productMapper.selectByPrimaryKey(id);
|
||||
setFirstProductImage(p);
|
||||
setCategory(p);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
public void setCategory(List<Product> ps){
|
||||
for (Product p : ps)
|
||||
setCategory(p);
|
||||
}
|
||||
public void setCategory(Product p){
|
||||
int cid = p.getCid();
|
||||
Category c = categoryService.get(cid);
|
||||
p.setCategory(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List list(int cid) {
|
||||
ProductExample example = new ProductExample();
|
||||
example.createCriteria().andCidEqualTo(cid);
|
||||
example.setOrderByClause("id desc");
|
||||
List result = productMapper.selectByExample(example);
|
||||
setFirstProductImage(result);
|
||||
setCategory(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFirstProductImage(Product p) {
|
||||
List<ProductImage> pis = productImageService.list(p.getId(), ProductImageService.type_single);
|
||||
if (!pis.isEmpty()) {
|
||||
ProductImage pi = pis.get(0);
|
||||
p.setFirstProductImage(pi);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fill(List<Category> cs) {
|
||||
for (Category c : cs) {
|
||||
fill(c);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillByRow(List<Category> cs) {
|
||||
int productNumberEachRow = 8;
|
||||
for (Category c : cs) {
|
||||
List<Product> products = c.getProducts();
|
||||
List<List<Product>> productsByRow = new ArrayList<>();
|
||||
for (int i = 0; i < products.size(); i+=productNumberEachRow) {
|
||||
int size = i+productNumberEachRow;
|
||||
size= size>products.size()?products.size():size;
|
||||
List<Product> productsOfEachRow =products.subList(i, size);
|
||||
productsByRow.add(productsOfEachRow);
|
||||
}
|
||||
c.setProductsByRow(productsByRow);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSaleAndReviewNumber(Product p) {
|
||||
int saleCount = orderItemService.getSaleCount(p.getId());
|
||||
p.setSaleCount(saleCount);
|
||||
|
||||
int reviewCount = reviewService.getCount(p.getId());
|
||||
p.setReviewCount(reviewCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSaleAndReviewNumber(List<Product> ps) {
|
||||
for (Product p : ps) {
|
||||
setSaleAndReviewNumber(p);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Product> search(String keyword) {
|
||||
ProductExample example = new ProductExample();
|
||||
example.createCriteria().andNameLike("%" + keyword + "%");
|
||||
example.setOrderByClause("id desc");
|
||||
List result = productMapper.selectByExample(example);
|
||||
setFirstProductImage(result);
|
||||
setCategory(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fill(Category c) {
|
||||
List<Product> ps = list(c.getId());
|
||||
c.setProducts(ps);
|
||||
}
|
||||
|
||||
public void setFirstProductImage(List<Product> ps) {
|
||||
for (Product p : ps) {
|
||||
setFirstProductImage(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,54 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.service.impl;
|
||||
|
||||
import com.how2java.tmall.mapper.PropertyMapper;
|
||||
import com.how2java.tmall.pojo.Category;
|
||||
import com.how2java.tmall.pojo.Product;
|
||||
import com.how2java.tmall.pojo.Property;
|
||||
import com.how2java.tmall.pojo.PropertyExample;
|
||||
import com.how2java.tmall.service.CategoryService;
|
||||
import com.how2java.tmall.service.PropertyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service
|
||||
public class PropertyServiceImpl implements PropertyService {
|
||||
@Autowired
|
||||
PropertyMapper propertyMapper;
|
||||
|
||||
@Override
|
||||
public void add(Property p) {
|
||||
propertyMapper.insert(p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(int id) {
|
||||
propertyMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Property p) {
|
||||
propertyMapper.updateByPrimaryKeySelective(p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Property get(int id) {
|
||||
return propertyMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List list(int cid) {
|
||||
PropertyExample example =new PropertyExample();
|
||||
example.createCriteria().andCidEqualTo(cid);
|
||||
example.setOrderByClause("id desc");
|
||||
return propertyMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,73 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.service.impl;
|
||||
|
||||
import com.how2java.tmall.mapper.PropertyValueMapper;
|
||||
import com.how2java.tmall.pojo.Product;
|
||||
import com.how2java.tmall.pojo.Property;
|
||||
import com.how2java.tmall.pojo.PropertyValue;
|
||||
import com.how2java.tmall.pojo.PropertyValueExample;
|
||||
import com.how2java.tmall.service.PropertyService;
|
||||
import com.how2java.tmall.service.PropertyValueService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class PropertyValueServiceImpl implements PropertyValueService {
|
||||
|
||||
@Autowired
|
||||
PropertyValueMapper propertyValueMapper;
|
||||
|
||||
|
||||
@Autowired
|
||||
PropertyService propertyService;
|
||||
|
||||
|
||||
@Override
|
||||
public void init(Product p) {
|
||||
|
||||
List<Property> pts = propertyService.list(p.getCid());
|
||||
|
||||
for (Property pt: pts) {
|
||||
PropertyValue pv = get(pt.getId(),p.getId());
|
||||
if(null==pv){
|
||||
pv = new PropertyValue();
|
||||
pv.setPid(p.getId());
|
||||
pv.setPtid(pt.getId());
|
||||
propertyValueMapper.insert(pv);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(PropertyValue pv) {
|
||||
propertyValueMapper.updateByPrimaryKeySelective(pv);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyValue get(int ptid, int pid) {
|
||||
PropertyValueExample example = new PropertyValueExample();
|
||||
example.createCriteria().andPtidEqualTo(ptid).andPidEqualTo(pid);
|
||||
List<PropertyValue> pvs= propertyValueMapper.selectByExample(example);
|
||||
if (pvs.isEmpty())
|
||||
return null;
|
||||
return pvs.get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PropertyValue> list(int pid) {
|
||||
PropertyValueExample example = new PropertyValueExample();
|
||||
example.createCriteria().andPidEqualTo(pid);
|
||||
List<PropertyValue> result = propertyValueMapper.selectByExample(example);
|
||||
for (PropertyValue pv : result) {
|
||||
Property property = propertyService.get(pv.getPtid());
|
||||
pv.setProperty(property);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,70 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.how2java.tmall.mapper.ReviewMapper;
|
||||
import com.how2java.tmall.pojo.Review;
|
||||
import com.how2java.tmall.pojo.ReviewExample;
|
||||
import com.how2java.tmall.pojo.User;
|
||||
import com.how2java.tmall.service.ReviewService;
|
||||
import com.how2java.tmall.service.UserService;
|
||||
|
||||
@Service
|
||||
public class ReviewServiceImpl implements ReviewService {
|
||||
@Autowired
|
||||
ReviewMapper reviewMapper;
|
||||
@Autowired
|
||||
UserService userService;
|
||||
|
||||
@Override
|
||||
public void add(Review c) {
|
||||
reviewMapper.insert(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(int id) {
|
||||
reviewMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Review c) {
|
||||
reviewMapper.updateByPrimaryKeySelective(c);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Review get(int id) {
|
||||
return reviewMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public List<Review> list(int pid){
|
||||
ReviewExample example =new ReviewExample();
|
||||
example.createCriteria().andPidEqualTo(pid);
|
||||
example.setOrderByClause("id desc");
|
||||
|
||||
List<Review> result =reviewMapper.selectByExample(example);
|
||||
setUser(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setUser(List<Review> reviews){
|
||||
for (Review review : reviews) {
|
||||
setUser(review);
|
||||
}
|
||||
}
|
||||
|
||||
private void setUser(Review review) {
|
||||
int uid = review.getUid();
|
||||
User user =userService.get(uid);
|
||||
review.setUser(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount(int pid) {
|
||||
return list(pid).size();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,71 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.how2java.tmall.mapper.UserMapper;
|
||||
import com.how2java.tmall.pojo.User;
|
||||
import com.how2java.tmall.pojo.UserExample;
|
||||
import com.how2java.tmall.service.UserService;
|
||||
|
||||
@Service
|
||||
public class UserServiceImpl implements UserService {
|
||||
@Autowired
|
||||
UserMapper userMapper;
|
||||
|
||||
@Override
|
||||
public void add(User u) {
|
||||
userMapper.insert(u);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(int id) {
|
||||
userMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(User u) {
|
||||
userMapper.updateByPrimaryKeySelective(u);
|
||||
}
|
||||
|
||||
@Override
|
||||
public User get(int id) {
|
||||
return userMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public List<User> list(){
|
||||
UserExample example =new UserExample();
|
||||
example.setOrderByClause("id desc");
|
||||
return userMapper.selectByExample(example);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isExist(String name) {
|
||||
UserExample example =new UserExample();
|
||||
example.createCriteria().andNameEqualTo(name);
|
||||
List<User> result= userMapper.selectByExample(example);
|
||||
if(!result.isEmpty())
|
||||
return true;
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public User get(String name, String password) {
|
||||
UserExample example =new UserExample();
|
||||
example.createCriteria().andNameEqualTo(name).andPasswordEqualTo(password);
|
||||
List<User> result= userMapper.selectByExample(example);
|
||||
if(result.isEmpty())
|
||||
return null;
|
||||
return result.get(0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,46 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.test;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
public class TestTmall {
|
||||
|
||||
public static void main(String args[]){
|
||||
//准备分类测试数据:
|
||||
|
||||
try {
|
||||
Class.forName("com.mysql.jdbc.Driver");
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try (
|
||||
Connection c = DriverManager.getConnection("jdbc:mysql://localhost:3306/tmall_ssm?useUnicode=true&characterEncoding=utf8",
|
||||
"root", "123456789");
|
||||
Statement s = c.createStatement();
|
||||
)
|
||||
{
|
||||
|
||||
|
||||
s.execute("delete from category");
|
||||
for (int i = 1; i <=10 ; i++) {
|
||||
String sqlFormat = "insert into category values (null, '测试分类%d')";
|
||||
String sql = String.format(sqlFormat, i);
|
||||
System.out.println(sql);
|
||||
s.execute(sql);
|
||||
}
|
||||
|
||||
System.out.println("已经成功创建10条分类测试数据");
|
||||
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,70 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.util;
|
||||
|
||||
import java.awt.Image;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.ColorModel;
|
||||
import java.awt.image.DataBuffer;
|
||||
import java.awt.image.DataBufferInt;
|
||||
import java.awt.image.DirectColorModel;
|
||||
import java.awt.image.PixelGrabber;
|
||||
import java.awt.image.Raster;
|
||||
import java.awt.image.RenderedImage;
|
||||
import java.awt.image.WritableRaster;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
public class ImageUtil {
|
||||
|
||||
|
||||
public static BufferedImage change2jpg(File f) {
|
||||
try {
|
||||
Image i = Toolkit.getDefaultToolkit().createImage(f.getAbsolutePath());
|
||||
PixelGrabber pg = new PixelGrabber(i, 0, 0, -1, -1, true);
|
||||
pg.grabPixels();
|
||||
int width = pg.getWidth(), height = pg.getHeight();
|
||||
final int[] RGB_MASKS = { 0xFF0000, 0xFF00, 0xFF };
|
||||
final ColorModel RGB_OPAQUE = new DirectColorModel(32, RGB_MASKS[0], RGB_MASKS[1], RGB_MASKS[2]);
|
||||
DataBuffer buffer = new DataBufferInt((int[]) pg.getPixels(), pg.getWidth() * pg.getHeight());
|
||||
WritableRaster raster = Raster.createPackedRaster(buffer, width, height, width, RGB_MASKS, null);
|
||||
BufferedImage img = new BufferedImage(RGB_OPAQUE, raster, false, null);
|
||||
return img;
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void resizeImage(File srcFile, int width,int height, File destFile) {
|
||||
try {
|
||||
if(!destFile.getParentFile().exists())
|
||||
destFile.getParentFile().mkdirs();
|
||||
Image i = ImageIO.read(srcFile);
|
||||
i = resizeImage(i, width, height);
|
||||
ImageIO.write((RenderedImage) i, "jpg", destFile);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static Image resizeImage(Image srcImage, int width, int height) {
|
||||
try {
|
||||
|
||||
BufferedImage buffImg = null;
|
||||
buffImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
|
||||
buffImg.getGraphics().drawImage(srcImage.getScaledInstance(width, height, Image.SCALE_SMOOTH), 0, 0, null);
|
||||
|
||||
return buffImg;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.util;
|
||||
|
||||
import org.mybatis.generator.api.GeneratedXmlFile;
|
||||
import org.mybatis.generator.api.IntrospectedTable;
|
||||
import org.mybatis.generator.api.PluginAdapter;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
|
||||
public class OverIsMergeablePlugin extends PluginAdapter {
|
||||
@Override
|
||||
public boolean validate(List<String> warnings) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sqlMapGenerated(GeneratedXmlFile sqlMap, IntrospectedTable introspectedTable) {
|
||||
try {
|
||||
Field field = sqlMap.getClass().getDeclaredField("isMergeable");
|
||||
field.setAccessible(true);
|
||||
field.setBoolean(sqlMap, false);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
package com.how2java.tmall.util;
|
||||
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
public class UploadedImageFile {
|
||||
MultipartFile image;
|
||||
|
||||
public MultipartFile getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setImage(MultipartFile image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
package comparator;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import com.how2java.tmall.pojo.Product;
|
||||
|
||||
|
||||
|
||||
public class ProductAllComparator implements Comparator<Product>{
|
||||
|
||||
@Override
|
||||
public int compare(Product p1, Product p2) {
|
||||
return p2.getReviewCount()*p2.getSaleCount()-p1.getReviewCount()*p1.getSaleCount();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,21 @@
|
||||
|
||||
|
||||
package comparator;
|
||||
|
||||
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import com.how2java.tmall.pojo.Product;
|
||||
|
||||
|
||||
public class ProductDateComparator implements Comparator<Product>{
|
||||
|
||||
@Override
|
||||
public int compare(Product p1, Product p2) {
|
||||
return p1.getCreateDate().compareTo(p2.getCreateDate());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
package comparator;
|
||||
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import com.how2java.tmall.pojo.Product;
|
||||
|
||||
public class ProductPriceComparator implements Comparator<Product> {
|
||||
|
||||
@Override
|
||||
public int compare(Product p1, Product p2) {
|
||||
return (int) (p1.getPromotePrice()-p2.getPromotePrice());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
package comparator;
|
||||
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import com.how2java.tmall.pojo.Product;
|
||||
|
||||
public class ProductReviewComparator implements Comparator<Product> {
|
||||
|
||||
@Override
|
||||
public int compare(Product p1, Product p2) {
|
||||
return p2.getReviewCount()-p1.getReviewCount();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
package comparator;
|
||||
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import com.how2java.tmall.pojo.Product;
|
||||
|
||||
public class ProductSaleCountComparator implements Comparator<Product> {
|
||||
|
||||
@Override
|
||||
public int compare(Product p1, Product p2) {
|
||||
return p2.getSaleCount()-p1.getSaleCount();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
@ -0,0 +1,8 @@
|
||||
# Global logging configuration
|
||||
log4j.rootLogger=ERROR, stdout
|
||||
# MyBatis logging configuration...
|
||||
log4j.logger.com.how2java.tmall=TRACE
|
||||
# Console output...
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n
|
@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
@ -0,0 +1,107 @@
|
||||
<?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.how2java.tmall.mapper.ProductImageMapper">
|
||||
<resultMap id="BaseResultMap" type="com.how2java.tmall.pojo.ProductImage">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="pid" jdbcType="INTEGER" property="pid" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, pid, type
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.how2java.tmall.pojo.ProductImageExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
'false' as QUERYID,
|
||||
<include refid="Base_Column_List" />
|
||||
from productimage
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from productimage
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from productimage
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.how2java.tmall.pojo.ProductImage" useGeneratedKeys="true">
|
||||
insert into productimage (pid, type)
|
||||
values (#{pid,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.how2java.tmall.pojo.ProductImage" useGeneratedKeys="true">
|
||||
insert into productimage
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="pid != null">
|
||||
pid,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="pid != null">
|
||||
#{pid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.how2java.tmall.pojo.ProductImage">
|
||||
update productimage
|
||||
<set>
|
||||
<if test="pid != null">
|
||||
pid = #{pid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.how2java.tmall.pojo.ProductImage">
|
||||
update productimage
|
||||
set pid = #{pid,jdbcType=INTEGER},
|
||||
type = #{type,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1,166 @@
|
||||
<?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.how2java.tmall.mapper.ProductMapper">
|
||||
<resultMap id="BaseResultMap" type="com.how2java.tmall.pojo.Product">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="subTitle" jdbcType="VARCHAR" property="subTitle" />
|
||||
<result column="originalPrice" jdbcType="REAL" property="originalPrice" />
|
||||
<result column="promotePrice" jdbcType="REAL" property="promotePrice" />
|
||||
<result column="stock" jdbcType="INTEGER" property="stock" />
|
||||
<result column="cid" jdbcType="INTEGER" property="cid" />
|
||||
<result column="createDate" jdbcType="TIMESTAMP" property="createDate" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, name, subTitle, originalPrice, promotePrice, stock, cid, createDate
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.how2java.tmall.pojo.ProductExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
'false' as QUERYID,
|
||||
<include refid="Base_Column_List" />
|
||||
from product
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from product
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from product
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.how2java.tmall.pojo.Product" useGeneratedKeys="true">
|
||||
insert into product (name, subTitle, originalPrice,
|
||||
promotePrice, stock, cid,
|
||||
createDate)
|
||||
values (#{name,jdbcType=VARCHAR}, #{subTitle,jdbcType=VARCHAR}, #{originalPrice,jdbcType=REAL},
|
||||
#{promotePrice,jdbcType=REAL}, #{stock,jdbcType=INTEGER}, #{cid,jdbcType=INTEGER},
|
||||
#{createDate,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.how2java.tmall.pojo.Product" useGeneratedKeys="true">
|
||||
insert into product
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="subTitle != null">
|
||||
subTitle,
|
||||
</if>
|
||||
<if test="originalPrice != null">
|
||||
originalPrice,
|
||||
</if>
|
||||
<if test="promotePrice != null">
|
||||
promotePrice,
|
||||
</if>
|
||||
<if test="stock != null">
|
||||
stock,
|
||||
</if>
|
||||
<if test="cid != null">
|
||||
cid,
|
||||
</if>
|
||||
<if test="createDate != null">
|
||||
createDate,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="subTitle != null">
|
||||
#{subTitle,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="originalPrice != null">
|
||||
#{originalPrice,jdbcType=REAL},
|
||||
</if>
|
||||
<if test="promotePrice != null">
|
||||
#{promotePrice,jdbcType=REAL},
|
||||
</if>
|
||||
<if test="stock != null">
|
||||
#{stock,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="cid != null">
|
||||
#{cid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createDate != null">
|
||||
#{createDate,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.how2java.tmall.pojo.Product">
|
||||
update product
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="subTitle != null">
|
||||
subTitle = #{subTitle,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="originalPrice != null">
|
||||
originalPrice = #{originalPrice,jdbcType=REAL},
|
||||
</if>
|
||||
<if test="promotePrice != null">
|
||||
promotePrice = #{promotePrice,jdbcType=REAL},
|
||||
</if>
|
||||
<if test="stock != null">
|
||||
stock = #{stock,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="cid != null">
|
||||
cid = #{cid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createDate != null">
|
||||
createDate = #{createDate,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.how2java.tmall.pojo.Product">
|
||||
update product
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
subTitle = #{subTitle,jdbcType=VARCHAR},
|
||||
originalPrice = #{originalPrice,jdbcType=REAL},
|
||||
promotePrice = #{promotePrice,jdbcType=REAL},
|
||||
stock = #{stock,jdbcType=INTEGER},
|
||||
cid = #{cid,jdbcType=INTEGER},
|
||||
createDate = #{createDate,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1,107 @@
|
||||
<?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.how2java.tmall.mapper.PropertyMapper">
|
||||
<resultMap id="BaseResultMap" type="com.how2java.tmall.pojo.Property">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="cid" jdbcType="INTEGER" property="cid" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, cid, name
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.how2java.tmall.pojo.PropertyExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
'false' as QUERYID,
|
||||
<include refid="Base_Column_List" />
|
||||
from property
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from property
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from property
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.how2java.tmall.pojo.Property" useGeneratedKeys="true">
|
||||
insert into property (cid, name)
|
||||
values (#{cid,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.how2java.tmall.pojo.Property" useGeneratedKeys="true">
|
||||
insert into property
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="cid != null">
|
||||
cid,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="cid != null">
|
||||
#{cid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.how2java.tmall.pojo.Property">
|
||||
update property
|
||||
<set>
|
||||
<if test="cid != null">
|
||||
cid = #{cid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.how2java.tmall.pojo.Property">
|
||||
update property
|
||||
set cid = #{cid,jdbcType=INTEGER},
|
||||
name = #{name,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1,120 @@
|
||||
<?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.how2java.tmall.mapper.PropertyValueMapper">
|
||||
<resultMap id="BaseResultMap" type="com.how2java.tmall.pojo.PropertyValue">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="pid" jdbcType="INTEGER" property="pid" />
|
||||
<result column="ptid" jdbcType="INTEGER" property="ptid" />
|
||||
<result column="value" jdbcType="VARCHAR" property="value" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, pid, ptid, value
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.how2java.tmall.pojo.PropertyValueExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
'false' as QUERYID,
|
||||
<include refid="Base_Column_List" />
|
||||
from propertyvalue
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from propertyvalue
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from propertyvalue
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.how2java.tmall.pojo.PropertyValue" useGeneratedKeys="true">
|
||||
insert into propertyvalue (pid, ptid, value
|
||||
)
|
||||
values (#{pid,jdbcType=INTEGER}, #{ptid,jdbcType=INTEGER}, #{value,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.how2java.tmall.pojo.PropertyValue" useGeneratedKeys="true">
|
||||
insert into propertyvalue
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="pid != null">
|
||||
pid,
|
||||
</if>
|
||||
<if test="ptid != null">
|
||||
ptid,
|
||||
</if>
|
||||
<if test="value != null">
|
||||
value,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="pid != null">
|
||||
#{pid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="ptid != null">
|
||||
#{ptid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="value != null">
|
||||
#{value,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.how2java.tmall.pojo.PropertyValue">
|
||||
update propertyvalue
|
||||
<set>
|
||||
<if test="pid != null">
|
||||
pid = #{pid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="ptid != null">
|
||||
ptid = #{ptid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="value != null">
|
||||
value = #{value,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.how2java.tmall.pojo.PropertyValue">
|
||||
update propertyvalue
|
||||
set pid = #{pid,jdbcType=INTEGER},
|
||||
ptid = #{ptid,jdbcType=INTEGER},
|
||||
value = #{value,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1,131 @@
|
||||
<?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.how2java.tmall.mapper.ReviewMapper">
|
||||
<resultMap id="BaseResultMap" type="com.how2java.tmall.pojo.Review">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="content" jdbcType="VARCHAR" property="content" />
|
||||
<result column="uid" jdbcType="INTEGER" property="uid" />
|
||||
<result column="pid" jdbcType="INTEGER" property="pid" />
|
||||
<result column="createDate" jdbcType="TIMESTAMP" property="createDate" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, content, uid, pid, createDate
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.how2java.tmall.pojo.ReviewExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
'false' as QUERYID,
|
||||
<include refid="Base_Column_List" />
|
||||
from review
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from review
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from review
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.how2java.tmall.pojo.Review" useGeneratedKeys="true">
|
||||
insert into review (content, uid, pid,
|
||||
createDate)
|
||||
values (#{content,jdbcType=VARCHAR}, #{uid,jdbcType=INTEGER}, #{pid,jdbcType=INTEGER},
|
||||
#{createDate,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.how2java.tmall.pojo.Review" useGeneratedKeys="true">
|
||||
insert into review
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="content != null">
|
||||
content,
|
||||
</if>
|
||||
<if test="uid != null">
|
||||
uid,
|
||||
</if>
|
||||
<if test="pid != null">
|
||||
pid,
|
||||
</if>
|
||||
<if test="createDate != null">
|
||||
createDate,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="content != null">
|
||||
#{content,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="uid != null">
|
||||
#{uid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="pid != null">
|
||||
#{pid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createDate != null">
|
||||
#{createDate,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.how2java.tmall.pojo.Review">
|
||||
update review
|
||||
<set>
|
||||
<if test="content != null">
|
||||
content = #{content,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="uid != null">
|
||||
uid = #{uid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="pid != null">
|
||||
pid = #{pid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createDate != null">
|
||||
createDate = #{createDate,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.how2java.tmall.pojo.Review">
|
||||
update review
|
||||
set content = #{content,jdbcType=VARCHAR},
|
||||
uid = #{uid,jdbcType=INTEGER},
|
||||
pid = #{pid,jdbcType=INTEGER},
|
||||
createDate = #{createDate,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1,107 @@
|
||||
<?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.how2java.tmall.mapper.UserMapper">
|
||||
<resultMap id="BaseResultMap" type="com.how2java.tmall.pojo.User">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="password" jdbcType="VARCHAR" property="password" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, name, password
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.how2java.tmall.pojo.UserExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
'false' as QUERYID,
|
||||
<include refid="Base_Column_List" />
|
||||
from user
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from user
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from user
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.how2java.tmall.pojo.User" useGeneratedKeys="true">
|
||||
insert into user (name, password)
|
||||
values (#{name,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.how2java.tmall.pojo.User" useGeneratedKeys="true">
|
||||
insert into user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
#{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.how2java.tmall.pojo.User">
|
||||
update user
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.how2java.tmall.pojo.User">
|
||||
update user
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
password = #{password,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" import="java.util.*"%>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
||||
<%@include file="../include/admin/adminHeader.jsp"%>
|
||||
<%@include file="../include/admin/adminNavigator.jsp"%>
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" import="java.util.*"%>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
||||
<%@include file="../include/admin/adminHeader.jsp"%>
|
||||
<%@include file="../include/admin/adminNavigator.jsp"%>
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" import="java.util.*"%>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
||||
<%@include file="../include/admin/adminHeader.jsp"%>
|
||||
<%@include file="../include/admin/adminNavigator.jsp"%>
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" import="java.util.*"%>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
||||
<%@include file="../include/admin/adminHeader.jsp"%>
|
||||
<%@include file="../include/admin/adminNavigator.jsp"%>
|
||||
|
||||
|
@ -0,0 +1,94 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" import="java.util.*"%>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
||||
<%@include file="../include/admin/adminHeader.jsp"%>
|
||||
<%@include file="../include/admin/adminNavigator.jsp"%>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
|
||||
$("#addForm").submit(function(){
|
||||
if(!checkEmpty("name","分类名称"))
|
||||
return false;
|
||||
if(!checkEmpty("categoryPic","分类图片"))
|
||||
return false;
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<title>分类管理</title>
|
||||
|
||||
<div class="workingArea">
|
||||
<h1 class="label label-info" >分类管理</h1>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<div class="listDataTableDiv">
|
||||
<table class="table table-striped table-bordered table-hover table-condensed">
|
||||
<thead>
|
||||
<tr class="success">
|
||||
<th>ID</th>
|
||||
<th>图片</th>
|
||||
<th>分类名称</th>
|
||||
<th>属性管理</th>
|
||||
<th>产品管理</th>
|
||||
<th>编辑</th>
|
||||
<th>删除</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${cs}" var="c">
|
||||
|
||||
<tr>
|
||||
<td>${c.id}</td>
|
||||
<td><img height="40px" src="img/category/${c.id}.jpg"></td>
|
||||
<td>${c.name}</td>
|
||||
|
||||
<td><a href="admin_property_list?cid=${c.id}"><span class="glyphicon glyphicon-th-list"></span></a></td>
|
||||
<td><a href="admin_product_list?cid=${c.id}"><span class="glyphicon glyphicon-shopping-cart"></span></a></td>
|
||||
<td><a href="admin_category_edit?id=${c.id}"><span class="glyphicon glyphicon-edit"></span></a></td>
|
||||
<td><a deleteLink="true" href="admin_category_delete?id=${c.id}"><span class=" glyphicon glyphicon-trash"></span></a></td>
|
||||
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="pageDiv">
|
||||
<%@include file="../include/admin/adminPage.jsp" %>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-warning addDiv">
|
||||
<div class="panel-heading">新增分类</div>
|
||||
<div class="panel-body">
|
||||
<form method="post" id="addForm" action="admin_category_add" enctype="multipart/form-data">
|
||||
<table class="addTable">
|
||||
<tr>
|
||||
<td>分类名称</td>
|
||||
<td><input id="name" name="name" type="text" class="form-control"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>分类圖片</td>
|
||||
<td>
|
||||
<input id="categoryPic" accept="image/*" type="file" name="image" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="submitTR">
|
||||
<td colspan="2" align="center">
|
||||
<button type="submit" class="btn btn-success">提 交</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<%@include file="../include/admin/adminFooter.jsp"%>
|
@ -0,0 +1,114 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" import="java.util.*"%>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
||||
<%@include file="../include/admin/adminHeader.jsp"%>
|
||||
<%@include file="../include/admin/adminNavigator.jsp"%>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$("button.orderPageCheckOrderItems").click(function(){
|
||||
var oid = $(this).attr("oid");
|
||||
$("tr.orderPageOrderItemTR[oid="+oid+"]").toggle();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<title>订单管理</title>
|
||||
|
||||
|
||||
<div class="workingArea">
|
||||
<h1 class="label label-info" >订单管理</h1>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<div class="listDataTableDiv">
|
||||
<table class="table table-striped table-bordered table-hover1 table-condensed">
|
||||
<thead>
|
||||
<tr class="success">
|
||||
<th>ID</th>
|
||||
<th>状态</th>
|
||||
<th>金额</th>
|
||||
<th width="100px">商品数量</th>
|
||||
<th width="100px">买家名称</th>
|
||||
<th>创建时间</th>
|
||||
<th>支付时间</th>
|
||||
<th>发货时间</th>
|
||||
<th>确认收货时间</th>
|
||||
<th width="120px">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${os}" var="o">
|
||||
<tr>
|
||||
<td>${o.id}</td>
|
||||
<td>${o.statusDesc}</td>
|
||||
<td>¥<fmt:formatNumber type="number" value="${o.total}" minFractionDigits="2"/></td>
|
||||
<td align="center">${o.totalNumber}</td>
|
||||
<td align="center">${o.user.name}</td>
|
||||
|
||||
<td><fmt:formatDate value="${o.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td><fmt:formatDate value="${o.payDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td><fmt:formatDate value="${o.deliveryDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td><fmt:formatDate value="${o.confirmDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
|
||||
<td>
|
||||
<button oid=${o.id} class="orderPageCheckOrderItems btn btn-primary btn-xs">查看详情</button>
|
||||
|
||||
<c:if test="${o.status=='waitDelivery'}">
|
||||
<a href="admin_order_delivery?id=${o.id}">
|
||||
<button class="btn btn-primary btn-xs">发货</button>
|
||||
</a>
|
||||
</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="orderPageOrderItemTR" oid=${o.id}>
|
||||
<td colspan="10" align="center">
|
||||
|
||||
<div class="orderPageOrderItem">
|
||||
<table width="800px" align="center" class="orderPageOrderItemTable">
|
||||
<c:forEach items="${o.orderItems}" var="oi">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<img width="40px" height="40px" src="img/productSingle/${oi.product.firstProductImage.id}.jpg">
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href="foreproduct?pid=${oi.product.id}">
|
||||
<span>${oi.product.name}</span>
|
||||
</a>
|
||||
</td>
|
||||
<td align="right">
|
||||
|
||||
<span class="text-muted">${oi.number}个</span>
|
||||
</td>
|
||||
<td align="right">
|
||||
|
||||
<span class="text-muted">单价:¥${oi.product.promotePrice}</span>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="pageDiv">
|
||||
<%@include file="../include/admin/adminPage.jsp" %>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<%@include file="../include/admin/adminFooter.jsp"%>
|
@ -0,0 +1,136 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" import="java.util.*"%>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
||||
<%@include file="../include/admin/adminHeader.jsp"%>
|
||||
<%@include file="../include/admin/adminNavigator.jsp"%>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$("#addForm").submit(function() {
|
||||
if (!checkEmpty("name", "产品名称"))
|
||||
return false;
|
||||
// if (!checkEmpty("subTitle", "小标题"))
|
||||
// return false;
|
||||
if (!checkNumber("originalPrice", "原价格"))
|
||||
return false;
|
||||
if (!checkNumber("promotePrice", "优惠价格"))
|
||||
return false;
|
||||
if (!checkInt("stock", "库存"))
|
||||
return false;
|
||||
return true;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<title>产品管理</title>
|
||||
|
||||
<div class="workingArea">
|
||||
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="admin_category_list">所有分类</a></li>
|
||||
<li><a href="admin_product_list?cid=${c.id}">${c.name}</a></li>
|
||||
<li class="active">产品管理</li>
|
||||
</ol>
|
||||
|
||||
<div class="listDataTableDiv">
|
||||
<table
|
||||
class="table table-striped table-bordered table-hover table-condensed">
|
||||
<thead>
|
||||
<tr class="success">
|
||||
<th>ID</th>
|
||||
<th>图片</th>
|
||||
<th>产品名称</th>
|
||||
<th>产品小标题</th>
|
||||
<th width="53px">原价格</th>
|
||||
<th width="80px">优惠价格</th>
|
||||
<th width="80px">库存数量</th>
|
||||
<th width="80px">图片管理</th>
|
||||
<th width="80px">设置属性</th>
|
||||
<th width="42px">编辑</th>
|
||||
<th width="42px">删除</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${ps}" var="p">
|
||||
<tr>
|
||||
<td>${p.id}</td>
|
||||
<td>
|
||||
|
||||
<c:if test="${!empty p.firstProductImage}">
|
||||
<img width="40px" src="img/productSingle/${p.firstProductImage.id}.jpg">
|
||||
</c:if>
|
||||
|
||||
</td>
|
||||
<td>${p.name}</td>
|
||||
<td>${p.subTitle}</td>
|
||||
<td>${p.originalPrice}</td>
|
||||
<td>${p.promotePrice}</td>
|
||||
<td>${p.stock}</td>
|
||||
<td><a href="admin_productImage_list?pid=${p.id}"><span
|
||||
class="glyphicon glyphicon-picture"></span></a></td>
|
||||
<td><a href="admin_propertyValue_edit?pid=${p.id}"><span
|
||||
class="glyphicon glyphicon-th-list"></span></a></td>
|
||||
|
||||
<td><a href="admin_product_edit?id=${p.id}"><span
|
||||
class="glyphicon glyphicon-edit"></span></a></td>
|
||||
<td><a deleteLink="true"
|
||||
href="admin_product_delete?id=${p.id}"><span
|
||||
class=" glyphicon glyphicon-trash"></span></a></td>
|
||||
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="pageDiv">
|
||||
<%@include file="../include/admin/adminPage.jsp"%>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-warning addDiv">
|
||||
<div class="panel-heading">新增产品</div>
|
||||
<div class="panel-body">
|
||||
<form method="post" id="addForm" action="admin_product_add">
|
||||
<table class="addTable">
|
||||
<tr>
|
||||
<td>产品名称</td>
|
||||
<td><input id="name" name="name" type="text"
|
||||
class="form-control"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>产品小标题</td>
|
||||
<td><input id="subTitle" name="subTitle" type="text"
|
||||
class="form-control"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>原价格</td>
|
||||
<td><input id="originalPrice" value="99.98" name="originalPrice" type="text"
|
||||
class="form-control"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>优惠价格</td>
|
||||
<td><input id="promotePrice" value="19.98" name="promotePrice" type="text"
|
||||
class="form-control"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>库存</td>
|
||||
<td><input id="stock" value="99" name="stock" type="text"
|
||||
class="form-control"></td>
|
||||
</tr>
|
||||
<tr class="submitTR">
|
||||
<td colspan="2" align="center">
|
||||
<input type="hidden" name="cid" value="${c.id}">
|
||||
<button type="submit" class="btn btn-success">提 交</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<%@include file="../include/admin/adminFooter.jsp"%>
|
@ -0,0 +1,154 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" import="java.util.*"%>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
||||
<%@include file="../include/admin/adminHeader.jsp"%>
|
||||
<%@include file="../include/admin/adminNavigator.jsp"%>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$(".addFormSingle").submit(function(){
|
||||
if(checkEmpty("filepathSingle","图片文件")){
|
||||
$("#filepathSingle").value("");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$(".addFormDetail").submit(function(){
|
||||
if(checkEmpty("filepathDetail","图片文件"))
|
||||
return true;
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<title>产品图片管理</title>
|
||||
|
||||
|
||||
<div class="workingArea">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="admin_category_list">所有分类</a></li>
|
||||
<li><a href="admin_product_list?cid=${p.category.id}">${p.category.name}</a></li>
|
||||
<li class="active">${p.name}</li>
|
||||
<li class="active">产品图片管理</li>
|
||||
</ol>
|
||||
|
||||
<table class="addPictureTable" align="center">
|
||||
<tr>
|
||||
<td class="addPictureTableTD">
|
||||
<div>
|
||||
<div class="panel panel-warning addPictureDiv">
|
||||
<div class="panel-heading">新增产品<b class="text-primary"> 单个 </b>图片</div>
|
||||
<div class="panel-body">
|
||||
<form method="post" class="addFormSingle" action="admin_productImage_add" enctype="multipart/form-data">
|
||||
<table class="addTable">
|
||||
<tr>
|
||||
<td>请选择本地图片 尺寸400X400 为佳</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input id="filepathSingle" type="file" name="image" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="submitTR">
|
||||
<td align="center">
|
||||
<input type="hidden" name="type" value="type_single" />
|
||||
<input type="hidden" name="pid" value="${p.id}" />
|
||||
<button type="submit" class="btn btn-success">提 交</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-striped table-bordered table-hover table-condensed">
|
||||
<thead>
|
||||
<tr class="success">
|
||||
<th>ID</th>
|
||||
<th>产品单个图片缩略图</th>
|
||||
<th>删除</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${pisSingle}" var="pi">
|
||||
<tr>
|
||||
<td>${pi.id}</td>
|
||||
<td>
|
||||
<a title="点击查看原图" href="img/productSingle/${pi.id}.jpg"><img height="50px" src="img/productSingle/${pi.id}.jpg"></a>
|
||||
</td>
|
||||
<td><a deleteLink="true"
|
||||
href="admin_productImage_delete?id=${pi.id}"><span
|
||||
class=" glyphicon glyphicon-trash"></span></a></td>
|
||||
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<td class="addPictureTableTD">
|
||||
<div>
|
||||
|
||||
<div class="panel panel-warning addPictureDiv">
|
||||
<div class="panel-heading">新增产品<b class="text-primary"> 详情 </b>图片</div>
|
||||
<div class="panel-body">
|
||||
<form method="post" class="addFormDetail" action="admin_productImage_add" enctype="multipart/form-data">
|
||||
<table class="addTable">
|
||||
<tr>
|
||||
<td>请选择本地图片 宽度790 为佳</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input id="filepathDetail" type="file" name="image" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="submitTR">
|
||||
<td align="center">
|
||||
<input type="hidden" name="type" value="type_detail" />
|
||||
<input type="hidden" name="pid" value="${p.id}" />
|
||||
<button type="submit" class="btn btn-success">提 交</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-striped table-bordered table-hover table-condensed">
|
||||
<thead>
|
||||
<tr class="success">
|
||||
<th>ID</th>
|
||||
<th>产品详情图片缩略图</th>
|
||||
<th>删除</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${pisDetail}" var="pi">
|
||||
<tr>
|
||||
<td>${pi.id}</td>
|
||||
<td>
|
||||
<a title="点击查看原图" href="img/productDetail/${pi.id}.jpg"><img height="50px" src="img/productDetail/${pi.id}.jpg"></a>
|
||||
</td>
|
||||
<td><a deleteLink="true"
|
||||
href="admin_productImage_delete?id=${pi.id}"><span
|
||||
class=" glyphicon glyphicon-trash"></span></a></td>
|
||||
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<%@include file="../include/admin/adminFooter.jsp"%>
|
@ -0,0 +1,90 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" import="java.util.*"%>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
||||
<%@include file="../include/admin/adminHeader.jsp"%>
|
||||
<%@include file="../include/admin/adminNavigator.jsp"%>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
$("#addForm").submit(function() {
|
||||
if (checkEmpty("name", "属性名称"))
|
||||
return true;
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<title>属性管理</title>
|
||||
|
||||
|
||||
<div class="workingArea">
|
||||
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="admin_category_list">所有分类</a></li>
|
||||
<li><a href="admin_property_list?cid=${c.id}">${c.name}</a></li>
|
||||
<li class="active">属性管理</li>
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
<div class="listDataTableDiv">
|
||||
<table
|
||||
class="table table-striped table-bordered table-hover table-condensed">
|
||||
<thead>
|
||||
<tr class="success">
|
||||
<th>ID</th>
|
||||
<th>属性名称</th>
|
||||
<th>编辑</th>
|
||||
<th>删除</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${ps}" var="p">
|
||||
|
||||
<tr>
|
||||
<td>${p.id}</td>
|
||||
<td>${p.name}</td>
|
||||
<td><a href="admin_property_edit?id=${p.id}"><span
|
||||
class="glyphicon glyphicon-edit"></span></a></td>
|
||||
<td><a deleteLink="true"
|
||||
href="admin_property_delete?id=${p.id}"><span
|
||||
class=" glyphicon glyphicon-trash"></span></a></td>
|
||||
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="pageDiv">
|
||||
<%@include file="../include/admin/adminPage.jsp"%>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-warning addDiv">
|
||||
<div class="panel-heading">新增属性</div>
|
||||
<div class="panel-body">
|
||||
<form method="post" id="addForm" action="admin_property_add">
|
||||
<table class="addTable">
|
||||
<tr>
|
||||
<td>属性名称</td>
|
||||
<td><input id="name" name="name" type="text"
|
||||
class="form-control"></td>
|
||||
</tr>
|
||||
<tr class="submitTR">
|
||||
<td colspan="2" align="center">
|
||||
<input type="hidden" name="cid" value="${c.id}">
|
||||
<button type="submit" class="btn btn-success">提 交</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<%@include file="../include/admin/adminFooter.jsp"%>
|
@ -0,0 +1,48 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" import="java.util.*"%>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
||||
<%@include file="../include/admin/adminHeader.jsp"%>
|
||||
<%@include file="../include/admin/adminNavigator.jsp"%>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<title>用户管理</title>
|
||||
|
||||
|
||||
<div class="workingArea">
|
||||
<h1 class="label label-info" >用户管理</h1>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<div class="listDataTableDiv">
|
||||
<table class="table table-striped table-bordered table-hover table-condensed">
|
||||
<thead>
|
||||
<tr class="success">
|
||||
<th>ID</th>
|
||||
<th>用户名称</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${us}" var="u">
|
||||
<tr>
|
||||
<td>${u.id}</td>
|
||||
<td>${u.name}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="pageDiv">
|
||||
<%@include file="../include/admin/adminPage.jsp" %>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<%@include file="../include/admin/adminFooter.jsp"%>
|
@ -0,0 +1,9 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" isELIgnored="false"%>
|
||||
|
||||
<%@include file="../include/fore/header.jsp"%>
|
||||
<%@include file="../include/fore/top.jsp"%>
|
||||
<%@include file="../include/fore/cart/alipayPage.jsp"%>
|
||||
<%@include file="../include/fore/footer.jsp"%>
|
@ -0,0 +1,11 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" isELIgnored="false"%>
|
||||
|
||||
<%@include file="../include/fore/header.jsp"%>
|
||||
<%@include file="../include/fore/top.jsp"%>
|
||||
<%@include file="../include/fore/simpleSearch.jsp"%>
|
||||
|
||||
<%@include file="../include/fore/cart/boughtPage.jsp"%>
|
||||
<%@include file="../include/fore/footer.jsp"%>
|
@ -0,0 +1,9 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" isELIgnored="false"%>
|
||||
|
||||
<%@include file="../include/fore/header.jsp"%>
|
||||
<%@include file="../include/fore/top.jsp"%>
|
||||
<%@include file="../include/fore/cart/buyPage.jsp"%>
|
||||
<%@include file="../include/fore/footer.jsp"%>
|
@ -0,0 +1,11 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" isELIgnored="false"%>
|
||||
|
||||
<%@include file="../include/fore/header.jsp"%>
|
||||
<%@include file="../include/fore/top.jsp"%>
|
||||
<%@include file="../include/fore/simpleSearch.jsp"%>
|
||||
|
||||
<%@include file="../include/fore/cart/cartPage.jsp"%>
|
||||
<%@include file="../include/fore/footer.jsp"%>
|
@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" isELIgnored="false"%>
|
||||
|
||||
<%@include file="../include/fore/header.jsp"%>
|
||||
<%@include file="../include/fore/top.jsp"%>
|
||||
<%@include file="../include/fore/search.jsp"%>
|
||||
<%@include file="../include/fore/category/categoryPage.jsp"%>
|
||||
<%@include file="../include/fore/footer.jsp"%>
|
@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" isELIgnored="false"%>
|
||||
|
||||
<%@include file="../include/fore/header.jsp"%>
|
||||
<%@include file="../include/fore/top.jsp"%>
|
||||
<%@include file="../include/fore/simpleSearch.jsp"%>
|
||||
<%@include file="../include/fore/cart/confirmPayPage.jsp"%>
|
||||
<%@include file="../include/fore/footer.jsp"%>
|
@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" isELIgnored="false"%>
|
||||
<%@include file="../include/fore/header.jsp"%>
|
||||
<%@include file="../include/fore/top.jsp"%>
|
||||
<%@include file="../include/fore/search.jsp"%>
|
||||
<%@include file="../include/fore/home/homePage.jsp"%>
|
||||
<%@include file="../include/fore/footer.jsp"%>
|
||||
|
@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" isELIgnored="false"%>
|
||||
|
||||
<%@include file="../include/fore/header.jsp"%>
|
||||
<%@include file="../include/fore/loginPage.jsp"%>
|
||||
<%@include file="../include/fore/footer.jsp"%>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8" isELIgnored="false"%>
|
||||
|
||||
<%@include file="../include/fore/header.jsp"%>
|
||||
<%@include file="../include/fore/top.jsp"%>
|
||||
<%@include file="../include/fore/simpleSearch.jsp"%>
|
||||
<%@include file="../include/fore/cart/orderConfirmedPage.jsp"%>
|
||||
<%@include file="../include/fore/footer.jsp"%>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue