Commit ced7037f authored by Menethil's avatar Menethil
Browse files

系统通用配置支持,新增数据表litemall_system

parent ab91a8e2
......@@ -157,5 +157,8 @@
<columnOverride javaType="java.time.LocalDateTime" column="last_login_time"/>
<columnOverride javaType="java.time.LocalDateTime" column="add_time"/>
</table>
<table tableName="litemall_system">
<generatedKey column="id" sqlStatement="MySql" identity="true" />
</table>
</context>
</generatorConfiguration>
\ No newline at end of file
package org.linlinjava.litemall.db.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.linlinjava.litemall.db.domain.LitemallSystem;
import org.linlinjava.litemall.db.domain.LitemallSystemExample;
public interface LitemallSystemMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
long countByExample(LitemallSystemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
int deleteByExample(LitemallSystemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
int insert(LitemallSystem record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
int insertSelective(LitemallSystem record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
LitemallSystem selectOneByExample(LitemallSystemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
LitemallSystem selectOneByExampleSelective(@Param("example") LitemallSystemExample example, @Param("selective") LitemallSystem.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
List<LitemallSystem> selectByExampleSelective(@Param("example") LitemallSystemExample example, @Param("selective") LitemallSystem.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
List<LitemallSystem> selectByExample(LitemallSystemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
LitemallSystem selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") LitemallSystem.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
LitemallSystem selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") LitemallSystem record, @Param("example") LitemallSystemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
int updateByExample(@Param("record") LitemallSystem record, @Param("example") LitemallSystemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(LitemallSystem record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
int updateByPrimaryKey(LitemallSystem record);
}
\ No newline at end of file
package org.linlinjava.litemall.db.domain;
import java.util.ArrayList;
import java.util.Arrays;
public class LitemallSystem {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_system.id
*
* @mbg.generated
*/
private Integer id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_system.key
*
* @mbg.generated
*/
private String key;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_system.name
*
* @mbg.generated
*/
private String name;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_system.base_value
*
* @mbg.generated
*/
private String baseValue;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_system.group
*
* @mbg.generated
*/
private String group;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_system.extra_value_1
*
* @mbg.generated
*/
private String extraValue1;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_system.extra_value_2
*
* @mbg.generated
*/
private String extraValue2;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_system.extra_value_3
*
* @mbg.generated
*/
private String extraValue3;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_system.extra_value_4
*
* @mbg.generated
*/
private String extraValue4;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_system.extra_value_5
*
* @mbg.generated
*/
private String extraValue5;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column litemall_system.extra_value_6
*
* @mbg.generated
*/
private String extraValue6;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_system.id
*
* @return the value of litemall_system.id
*
* @mbg.generated
*/
public Integer getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_system.id
*
* @param id the value for litemall_system.id
*
* @mbg.generated
*/
public void setId(Integer id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_system.key
*
* @return the value of litemall_system.key
*
* @mbg.generated
*/
public String getKey() {
return key;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_system.key
*
* @param key the value for litemall_system.key
*
* @mbg.generated
*/
public void setKey(String key) {
this.key = key;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_system.name
*
* @return the value of litemall_system.name
*
* @mbg.generated
*/
public String getName() {
return name;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_system.name
*
* @param name the value for litemall_system.name
*
* @mbg.generated
*/
public void setName(String name) {
this.name = name;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_system.base_value
*
* @return the value of litemall_system.base_value
*
* @mbg.generated
*/
public String getBaseValue() {
return baseValue;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_system.base_value
*
* @param baseValue the value for litemall_system.base_value
*
* @mbg.generated
*/
public void setBaseValue(String baseValue) {
this.baseValue = baseValue;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_system.group
*
* @return the value of litemall_system.group
*
* @mbg.generated
*/
public String getGroup() {
return group;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_system.group
*
* @param group the value for litemall_system.group
*
* @mbg.generated
*/
public void setGroup(String group) {
this.group = group;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_system.extra_value_1
*
* @return the value of litemall_system.extra_value_1
*
* @mbg.generated
*/
public String getExtraValue1() {
return extraValue1;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_system.extra_value_1
*
* @param extraValue1 the value for litemall_system.extra_value_1
*
* @mbg.generated
*/
public void setExtraValue1(String extraValue1) {
this.extraValue1 = extraValue1;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_system.extra_value_2
*
* @return the value of litemall_system.extra_value_2
*
* @mbg.generated
*/
public String getExtraValue2() {
return extraValue2;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_system.extra_value_2
*
* @param extraValue2 the value for litemall_system.extra_value_2
*
* @mbg.generated
*/
public void setExtraValue2(String extraValue2) {
this.extraValue2 = extraValue2;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_system.extra_value_3
*
* @return the value of litemall_system.extra_value_3
*
* @mbg.generated
*/
public String getExtraValue3() {
return extraValue3;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_system.extra_value_3
*
* @param extraValue3 the value for litemall_system.extra_value_3
*
* @mbg.generated
*/
public void setExtraValue3(String extraValue3) {
this.extraValue3 = extraValue3;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_system.extra_value_4
*
* @return the value of litemall_system.extra_value_4
*
* @mbg.generated
*/
public String getExtraValue4() {
return extraValue4;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_system.extra_value_4
*
* @param extraValue4 the value for litemall_system.extra_value_4
*
* @mbg.generated
*/
public void setExtraValue4(String extraValue4) {
this.extraValue4 = extraValue4;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_system.extra_value_5
*
* @return the value of litemall_system.extra_value_5
*
* @mbg.generated
*/
public String getExtraValue5() {
return extraValue5;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_system.extra_value_5
*
* @param extraValue5 the value for litemall_system.extra_value_5
*
* @mbg.generated
*/
public void setExtraValue5(String extraValue5) {
this.extraValue5 = extraValue5;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column litemall_system.extra_value_6
*
* @return the value of litemall_system.extra_value_6
*
* @mbg.generated
*/
public String getExtraValue6() {
return extraValue6;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column litemall_system.extra_value_6
*
* @param extraValue6 the value for litemall_system.extra_value_6
*
* @mbg.generated
*/
public void setExtraValue6(String extraValue6) {
this.extraValue6 = extraValue6;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", key=").append(key);
sb.append(", name=").append(name);
sb.append(", baseValue=").append(baseValue);
sb.append(", group=").append(group);
sb.append(", extraValue1=").append(extraValue1);
sb.append(", extraValue2=").append(extraValue2);
sb.append(", extraValue3=").append(extraValue3);
sb.append(", extraValue4=").append(extraValue4);
sb.append(", extraValue5=").append(extraValue5);
sb.append(", extraValue6=").append(extraValue6);
sb.append("]");
return sb.toString();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
LitemallSystem other = (LitemallSystem) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getKey() == null ? other.getKey() == null : this.getKey().equals(other.getKey()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getBaseValue() == null ? other.getBaseValue() == null : this.getBaseValue().equals(other.getBaseValue()))
&& (this.getGroup() == null ? other.getGroup() == null : this.getGroup().equals(other.getGroup()))
&& (this.getExtraValue1() == null ? other.getExtraValue1() == null : this.getExtraValue1().equals(other.getExtraValue1()))
&& (this.getExtraValue2() == null ? other.getExtraValue2() == null : this.getExtraValue2().equals(other.getExtraValue2()))
&& (this.getExtraValue3() == null ? other.getExtraValue3() == null : this.getExtraValue3().equals(other.getExtraValue3()))
&& (this.getExtraValue4() == null ? other.getExtraValue4() == null : this.getExtraValue4().equals(other.getExtraValue4()))
&& (this.getExtraValue5() == null ? other.getExtraValue5() == null : this.getExtraValue5().equals(other.getExtraValue5()))
&& (this.getExtraValue6() == null ? other.getExtraValue6() == null : this.getExtraValue6().equals(other.getExtraValue6()));
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getKey() == null) ? 0 : getKey().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getBaseValue() == null) ? 0 : getBaseValue().hashCode());
result = prime * result + ((getGroup() == null) ? 0 : getGroup().hashCode());
result = prime * result + ((getExtraValue1() == null) ? 0 : getExtraValue1().hashCode());
result = prime * result + ((getExtraValue2() == null) ? 0 : getExtraValue2().hashCode());
result = prime * result + ((getExtraValue3() == null) ? 0 : getExtraValue3().hashCode());
result = prime * result + ((getExtraValue4() == null) ? 0 : getExtraValue4().hashCode());
result = prime * result + ((getExtraValue5() == null) ? 0 : getExtraValue5().hashCode());
result = prime * result + ((getExtraValue6() == null) ? 0 : getExtraValue6().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "INTEGER"),
key("key", "key", "VARCHAR"),
name("name", "name", "VARCHAR"),
baseValue("base_value", "baseValue", "VARCHAR"),
group("group", "group", "VARCHAR"),
extraValue1("extra_value_1", "extraValue1", "VARCHAR"),
extraValue2("extra_value_2", "extraValue2", "VARCHAR"),
extraValue3("extra_value_3", "extraValue3", "VARCHAR"),
extraValue4("extra_value_4", "extraValue4", "VARCHAR"),
extraValue5("extra_value_5", "extraValue5", "VARCHAR"),
extraValue6("extra_value_6", "extraValue6", "VARCHAR");
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String column;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String javaProperty;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String jdbcType;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String value() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getValue() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJavaProperty() {
return this.javaProperty;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJdbcType() {
return this.jdbcType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column(String column, String javaProperty, String jdbcType) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String desc() {
return this.column + " DESC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String asc() {
return this.column + " ASC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
}
}
\ No newline at end of file
package org.linlinjava.litemall.db.domain;
import java.util.ArrayList;
import java.util.List;
public class LitemallSystemExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_system
*
* @mbg.generated
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_system
*
* @mbg.generated
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_system
*
* @mbg.generated
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
public LitemallSystemExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public LitemallSystemExample orderBy(String orderByClause) {
this.setOrderByClause(orderByClause);
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public LitemallSystemExample orderBy(String ... orderByClauses) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < orderByClauses.length; i++) {
sb.append(orderByClauses[i]);
if (i < orderByClauses.length - 1) {
sb.append(" , ");
}
}
this.setOrderByClause(sb.toString());
return this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria(this);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table litemall_system
*
* @mbg.generated
*/
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 andKeyIsNull() {
addCriterion("`key` is null");
return (Criteria) this;
}
public Criteria andKeyIsNotNull() {
addCriterion("`key` is not null");
return (Criteria) this;
}
public Criteria andKeyEqualTo(String value) {
addCriterion("`key` =", value, "key");
return (Criteria) this;
}
public Criteria andKeyNotEqualTo(String value) {
addCriterion("`key` <>", value, "key");
return (Criteria) this;
}
public Criteria andKeyGreaterThan(String value) {
addCriterion("`key` >", value, "key");
return (Criteria) this;
}
public Criteria andKeyGreaterThanOrEqualTo(String value) {
addCriterion("`key` >=", value, "key");
return (Criteria) this;
}
public Criteria andKeyLessThan(String value) {
addCriterion("`key` <", value, "key");
return (Criteria) this;
}
public Criteria andKeyLessThanOrEqualTo(String value) {
addCriterion("`key` <=", value, "key");
return (Criteria) this;
}
public Criteria andKeyLike(String value) {
addCriterion("`key` like", value, "key");
return (Criteria) this;
}
public Criteria andKeyNotLike(String value) {
addCriterion("`key` not like", value, "key");
return (Criteria) this;
}
public Criteria andKeyIn(List<String> values) {
addCriterion("`key` in", values, "key");
return (Criteria) this;
}
public Criteria andKeyNotIn(List<String> values) {
addCriterion("`key` not in", values, "key");
return (Criteria) this;
}
public Criteria andKeyBetween(String value1, String value2) {
addCriterion("`key` between", value1, value2, "key");
return (Criteria) this;
}
public Criteria andKeyNotBetween(String value1, String value2) {
addCriterion("`key` not between", value1, value2, "key");
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 andBaseValueIsNull() {
addCriterion("base_value is null");
return (Criteria) this;
}
public Criteria andBaseValueIsNotNull() {
addCriterion("base_value is not null");
return (Criteria) this;
}
public Criteria andBaseValueEqualTo(String value) {
addCriterion("base_value =", value, "baseValue");
return (Criteria) this;
}
public Criteria andBaseValueNotEqualTo(String value) {
addCriterion("base_value <>", value, "baseValue");
return (Criteria) this;
}
public Criteria andBaseValueGreaterThan(String value) {
addCriterion("base_value >", value, "baseValue");
return (Criteria) this;
}
public Criteria andBaseValueGreaterThanOrEqualTo(String value) {
addCriterion("base_value >=", value, "baseValue");
return (Criteria) this;
}
public Criteria andBaseValueLessThan(String value) {
addCriterion("base_value <", value, "baseValue");
return (Criteria) this;
}
public Criteria andBaseValueLessThanOrEqualTo(String value) {
addCriterion("base_value <=", value, "baseValue");
return (Criteria) this;
}
public Criteria andBaseValueLike(String value) {
addCriterion("base_value like", value, "baseValue");
return (Criteria) this;
}
public Criteria andBaseValueNotLike(String value) {
addCriterion("base_value not like", value, "baseValue");
return (Criteria) this;
}
public Criteria andBaseValueIn(List<String> values) {
addCriterion("base_value in", values, "baseValue");
return (Criteria) this;
}
public Criteria andBaseValueNotIn(List<String> values) {
addCriterion("base_value not in", values, "baseValue");
return (Criteria) this;
}
public Criteria andBaseValueBetween(String value1, String value2) {
addCriterion("base_value between", value1, value2, "baseValue");
return (Criteria) this;
}
public Criteria andBaseValueNotBetween(String value1, String value2) {
addCriterion("base_value not between", value1, value2, "baseValue");
return (Criteria) this;
}
public Criteria andGroupIsNull() {
addCriterion("`group` is null");
return (Criteria) this;
}
public Criteria andGroupIsNotNull() {
addCriterion("`group` is not null");
return (Criteria) this;
}
public Criteria andGroupEqualTo(String value) {
addCriterion("`group` =", value, "group");
return (Criteria) this;
}
public Criteria andGroupNotEqualTo(String value) {
addCriterion("`group` <>", value, "group");
return (Criteria) this;
}
public Criteria andGroupGreaterThan(String value) {
addCriterion("`group` >", value, "group");
return (Criteria) this;
}
public Criteria andGroupGreaterThanOrEqualTo(String value) {
addCriterion("`group` >=", value, "group");
return (Criteria) this;
}
public Criteria andGroupLessThan(String value) {
addCriterion("`group` <", value, "group");
return (Criteria) this;
}
public Criteria andGroupLessThanOrEqualTo(String value) {
addCriterion("`group` <=", value, "group");
return (Criteria) this;
}
public Criteria andGroupLike(String value) {
addCriterion("`group` like", value, "group");
return (Criteria) this;
}
public Criteria andGroupNotLike(String value) {
addCriterion("`group` not like", value, "group");
return (Criteria) this;
}
public Criteria andGroupIn(List<String> values) {
addCriterion("`group` in", values, "group");
return (Criteria) this;
}
public Criteria andGroupNotIn(List<String> values) {
addCriterion("`group` not in", values, "group");
return (Criteria) this;
}
public Criteria andGroupBetween(String value1, String value2) {
addCriterion("`group` between", value1, value2, "group");
return (Criteria) this;
}
public Criteria andGroupNotBetween(String value1, String value2) {
addCriterion("`group` not between", value1, value2, "group");
return (Criteria) this;
}
public Criteria andExtraValue1IsNull() {
addCriterion("extra_value_1 is null");
return (Criteria) this;
}
public Criteria andExtraValue1IsNotNull() {
addCriterion("extra_value_1 is not null");
return (Criteria) this;
}
public Criteria andExtraValue1EqualTo(String value) {
addCriterion("extra_value_1 =", value, "extraValue1");
return (Criteria) this;
}
public Criteria andExtraValue1NotEqualTo(String value) {
addCriterion("extra_value_1 <>", value, "extraValue1");
return (Criteria) this;
}
public Criteria andExtraValue1GreaterThan(String value) {
addCriterion("extra_value_1 >", value, "extraValue1");
return (Criteria) this;
}
public Criteria andExtraValue1GreaterThanOrEqualTo(String value) {
addCriterion("extra_value_1 >=", value, "extraValue1");
return (Criteria) this;
}
public Criteria andExtraValue1LessThan(String value) {
addCriterion("extra_value_1 <", value, "extraValue1");
return (Criteria) this;
}
public Criteria andExtraValue1LessThanOrEqualTo(String value) {
addCriterion("extra_value_1 <=", value, "extraValue1");
return (Criteria) this;
}
public Criteria andExtraValue1Like(String value) {
addCriterion("extra_value_1 like", value, "extraValue1");
return (Criteria) this;
}
public Criteria andExtraValue1NotLike(String value) {
addCriterion("extra_value_1 not like", value, "extraValue1");
return (Criteria) this;
}
public Criteria andExtraValue1In(List<String> values) {
addCriterion("extra_value_1 in", values, "extraValue1");
return (Criteria) this;
}
public Criteria andExtraValue1NotIn(List<String> values) {
addCriterion("extra_value_1 not in", values, "extraValue1");
return (Criteria) this;
}
public Criteria andExtraValue1Between(String value1, String value2) {
addCriterion("extra_value_1 between", value1, value2, "extraValue1");
return (Criteria) this;
}
public Criteria andExtraValue1NotBetween(String value1, String value2) {
addCriterion("extra_value_1 not between", value1, value2, "extraValue1");
return (Criteria) this;
}
public Criteria andExtraValue2IsNull() {
addCriterion("extra_value_2 is null");
return (Criteria) this;
}
public Criteria andExtraValue2IsNotNull() {
addCriterion("extra_value_2 is not null");
return (Criteria) this;
}
public Criteria andExtraValue2EqualTo(String value) {
addCriterion("extra_value_2 =", value, "extraValue2");
return (Criteria) this;
}
public Criteria andExtraValue2NotEqualTo(String value) {
addCriterion("extra_value_2 <>", value, "extraValue2");
return (Criteria) this;
}
public Criteria andExtraValue2GreaterThan(String value) {
addCriterion("extra_value_2 >", value, "extraValue2");
return (Criteria) this;
}
public Criteria andExtraValue2GreaterThanOrEqualTo(String value) {
addCriterion("extra_value_2 >=", value, "extraValue2");
return (Criteria) this;
}
public Criteria andExtraValue2LessThan(String value) {
addCriterion("extra_value_2 <", value, "extraValue2");
return (Criteria) this;
}
public Criteria andExtraValue2LessThanOrEqualTo(String value) {
addCriterion("extra_value_2 <=", value, "extraValue2");
return (Criteria) this;
}
public Criteria andExtraValue2Like(String value) {
addCriterion("extra_value_2 like", value, "extraValue2");
return (Criteria) this;
}
public Criteria andExtraValue2NotLike(String value) {
addCriterion("extra_value_2 not like", value, "extraValue2");
return (Criteria) this;
}
public Criteria andExtraValue2In(List<String> values) {
addCriterion("extra_value_2 in", values, "extraValue2");
return (Criteria) this;
}
public Criteria andExtraValue2NotIn(List<String> values) {
addCriterion("extra_value_2 not in", values, "extraValue2");
return (Criteria) this;
}
public Criteria andExtraValue2Between(String value1, String value2) {
addCriterion("extra_value_2 between", value1, value2, "extraValue2");
return (Criteria) this;
}
public Criteria andExtraValue2NotBetween(String value1, String value2) {
addCriterion("extra_value_2 not between", value1, value2, "extraValue2");
return (Criteria) this;
}
public Criteria andExtraValue3IsNull() {
addCriterion("extra_value_3 is null");
return (Criteria) this;
}
public Criteria andExtraValue3IsNotNull() {
addCriterion("extra_value_3 is not null");
return (Criteria) this;
}
public Criteria andExtraValue3EqualTo(String value) {
addCriterion("extra_value_3 =", value, "extraValue3");
return (Criteria) this;
}
public Criteria andExtraValue3NotEqualTo(String value) {
addCriterion("extra_value_3 <>", value, "extraValue3");
return (Criteria) this;
}
public Criteria andExtraValue3GreaterThan(String value) {
addCriterion("extra_value_3 >", value, "extraValue3");
return (Criteria) this;
}
public Criteria andExtraValue3GreaterThanOrEqualTo(String value) {
addCriterion("extra_value_3 >=", value, "extraValue3");
return (Criteria) this;
}
public Criteria andExtraValue3LessThan(String value) {
addCriterion("extra_value_3 <", value, "extraValue3");
return (Criteria) this;
}
public Criteria andExtraValue3LessThanOrEqualTo(String value) {
addCriterion("extra_value_3 <=", value, "extraValue3");
return (Criteria) this;
}
public Criteria andExtraValue3Like(String value) {
addCriterion("extra_value_3 like", value, "extraValue3");
return (Criteria) this;
}
public Criteria andExtraValue3NotLike(String value) {
addCriterion("extra_value_3 not like", value, "extraValue3");
return (Criteria) this;
}
public Criteria andExtraValue3In(List<String> values) {
addCriterion("extra_value_3 in", values, "extraValue3");
return (Criteria) this;
}
public Criteria andExtraValue3NotIn(List<String> values) {
addCriterion("extra_value_3 not in", values, "extraValue3");
return (Criteria) this;
}
public Criteria andExtraValue3Between(String value1, String value2) {
addCriterion("extra_value_3 between", value1, value2, "extraValue3");
return (Criteria) this;
}
public Criteria andExtraValue3NotBetween(String value1, String value2) {
addCriterion("extra_value_3 not between", value1, value2, "extraValue3");
return (Criteria) this;
}
public Criteria andExtraValue4IsNull() {
addCriterion("extra_value_4 is null");
return (Criteria) this;
}
public Criteria andExtraValue4IsNotNull() {
addCriterion("extra_value_4 is not null");
return (Criteria) this;
}
public Criteria andExtraValue4EqualTo(String value) {
addCriterion("extra_value_4 =", value, "extraValue4");
return (Criteria) this;
}
public Criteria andExtraValue4NotEqualTo(String value) {
addCriterion("extra_value_4 <>", value, "extraValue4");
return (Criteria) this;
}
public Criteria andExtraValue4GreaterThan(String value) {
addCriterion("extra_value_4 >", value, "extraValue4");
return (Criteria) this;
}
public Criteria andExtraValue4GreaterThanOrEqualTo(String value) {
addCriterion("extra_value_4 >=", value, "extraValue4");
return (Criteria) this;
}
public Criteria andExtraValue4LessThan(String value) {
addCriterion("extra_value_4 <", value, "extraValue4");
return (Criteria) this;
}
public Criteria andExtraValue4LessThanOrEqualTo(String value) {
addCriterion("extra_value_4 <=", value, "extraValue4");
return (Criteria) this;
}
public Criteria andExtraValue4Like(String value) {
addCriterion("extra_value_4 like", value, "extraValue4");
return (Criteria) this;
}
public Criteria andExtraValue4NotLike(String value) {
addCriterion("extra_value_4 not like", value, "extraValue4");
return (Criteria) this;
}
public Criteria andExtraValue4In(List<String> values) {
addCriterion("extra_value_4 in", values, "extraValue4");
return (Criteria) this;
}
public Criteria andExtraValue4NotIn(List<String> values) {
addCriterion("extra_value_4 not in", values, "extraValue4");
return (Criteria) this;
}
public Criteria andExtraValue4Between(String value1, String value2) {
addCriterion("extra_value_4 between", value1, value2, "extraValue4");
return (Criteria) this;
}
public Criteria andExtraValue4NotBetween(String value1, String value2) {
addCriterion("extra_value_4 not between", value1, value2, "extraValue4");
return (Criteria) this;
}
public Criteria andExtraValue5IsNull() {
addCriterion("extra_value_5 is null");
return (Criteria) this;
}
public Criteria andExtraValue5IsNotNull() {
addCriterion("extra_value_5 is not null");
return (Criteria) this;
}
public Criteria andExtraValue5EqualTo(String value) {
addCriterion("extra_value_5 =", value, "extraValue5");
return (Criteria) this;
}
public Criteria andExtraValue5NotEqualTo(String value) {
addCriterion("extra_value_5 <>", value, "extraValue5");
return (Criteria) this;
}
public Criteria andExtraValue5GreaterThan(String value) {
addCriterion("extra_value_5 >", value, "extraValue5");
return (Criteria) this;
}
public Criteria andExtraValue5GreaterThanOrEqualTo(String value) {
addCriterion("extra_value_5 >=", value, "extraValue5");
return (Criteria) this;
}
public Criteria andExtraValue5LessThan(String value) {
addCriterion("extra_value_5 <", value, "extraValue5");
return (Criteria) this;
}
public Criteria andExtraValue5LessThanOrEqualTo(String value) {
addCriterion("extra_value_5 <=", value, "extraValue5");
return (Criteria) this;
}
public Criteria andExtraValue5Like(String value) {
addCriterion("extra_value_5 like", value, "extraValue5");
return (Criteria) this;
}
public Criteria andExtraValue5NotLike(String value) {
addCriterion("extra_value_5 not like", value, "extraValue5");
return (Criteria) this;
}
public Criteria andExtraValue5In(List<String> values) {
addCriterion("extra_value_5 in", values, "extraValue5");
return (Criteria) this;
}
public Criteria andExtraValue5NotIn(List<String> values) {
addCriterion("extra_value_5 not in", values, "extraValue5");
return (Criteria) this;
}
public Criteria andExtraValue5Between(String value1, String value2) {
addCriterion("extra_value_5 between", value1, value2, "extraValue5");
return (Criteria) this;
}
public Criteria andExtraValue5NotBetween(String value1, String value2) {
addCriterion("extra_value_5 not between", value1, value2, "extraValue5");
return (Criteria) this;
}
public Criteria andExtraValue6IsNull() {
addCriterion("extra_value_6 is null");
return (Criteria) this;
}
public Criteria andExtraValue6IsNotNull() {
addCriterion("extra_value_6 is not null");
return (Criteria) this;
}
public Criteria andExtraValue6EqualTo(String value) {
addCriterion("extra_value_6 =", value, "extraValue6");
return (Criteria) this;
}
public Criteria andExtraValue6NotEqualTo(String value) {
addCriterion("extra_value_6 <>", value, "extraValue6");
return (Criteria) this;
}
public Criteria andExtraValue6GreaterThan(String value) {
addCriterion("extra_value_6 >", value, "extraValue6");
return (Criteria) this;
}
public Criteria andExtraValue6GreaterThanOrEqualTo(String value) {
addCriterion("extra_value_6 >=", value, "extraValue6");
return (Criteria) this;
}
public Criteria andExtraValue6LessThan(String value) {
addCriterion("extra_value_6 <", value, "extraValue6");
return (Criteria) this;
}
public Criteria andExtraValue6LessThanOrEqualTo(String value) {
addCriterion("extra_value_6 <=", value, "extraValue6");
return (Criteria) this;
}
public Criteria andExtraValue6Like(String value) {
addCriterion("extra_value_6 like", value, "extraValue6");
return (Criteria) this;
}
public Criteria andExtraValue6NotLike(String value) {
addCriterion("extra_value_6 not like", value, "extraValue6");
return (Criteria) this;
}
public Criteria andExtraValue6In(List<String> values) {
addCriterion("extra_value_6 in", values, "extraValue6");
return (Criteria) this;
}
public Criteria andExtraValue6NotIn(List<String> values) {
addCriterion("extra_value_6 not in", values, "extraValue6");
return (Criteria) this;
}
public Criteria andExtraValue6Between(String value1, String value2) {
addCriterion("extra_value_6 between", value1, value2, "extraValue6");
return (Criteria) this;
}
public Criteria andExtraValue6NotBetween(String value1, String value2) {
addCriterion("extra_value_6 not between", value1, value2, "extraValue6");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table litemall_system
*
* @mbg.generated do_not_delete_during_merge
*/
public static class Criteria extends GeneratedCriteria {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private LitemallSystemExample example;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
protected Criteria(LitemallSystemExample example) {
super();
this.example = example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public LitemallSystemExample example() {
return this.example;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIf(boolean ifAdd, ICriteriaAdd add) {
if (ifAdd) {
add.add(this);
}
return this;
}
/**
* This interface was generated by MyBatis Generator.
* This interface corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public interface ICriteriaAdd {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Criteria add(Criteria add);
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table litemall_system
*
* @mbg.generated
*/
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);
}
}
}
\ No newline at end of file
package org.linlinjava.litemall.db.service;
import org.linlinjava.litemall.db.dao.LitemallSystemMapper;
import org.linlinjava.litemall.db.domain.LitemallSystem;
import org.linlinjava.litemall.db.domain.LitemallSystemExample;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class LitemallSystemCfgService {
@Resource
private LitemallSystemMapper systemMapper;
public void add(LitemallSystem litemallSystem) {
systemMapper.insert(litemallSystem);
}
public List<LitemallSystem> queryAll() {
LitemallSystemExample example = new LitemallSystemExample();
example.or();
return systemMapper.selectByExample(example);
}
public LitemallSystem queryByKeyName(String keyName, String groupName) {
LitemallSystemExample example = new LitemallSystemExample();
example.or().andGroupEqualTo(groupName).andKeyEqualTo(keyName);
return systemMapper.selectOneByExample(example);
}
public List<LitemallSystem> queryByGroup(String groupName) {
LitemallSystemExample example = new LitemallSystemExample();
example.or().andGroupEqualTo(groupName);
return systemMapper.selectByExample(example);
}
public void deleteById(Integer id) {
systemMapper.deleteByPrimaryKey(id);
}
}
<?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="org.linlinjava.litemall.db.dao.LitemallSystemMapper">
<resultMap id="BaseResultMap" type="org.linlinjava.litemall.db.domain.LitemallSystem">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="key" jdbcType="VARCHAR" property="key" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="base_value" jdbcType="VARCHAR" property="baseValue" />
<result column="group" jdbcType="VARCHAR" property="group" />
<result column="extra_value_1" jdbcType="VARCHAR" property="extraValue1" />
<result column="extra_value_2" jdbcType="VARCHAR" property="extraValue2" />
<result column="extra_value_3" jdbcType="VARCHAR" property="extraValue3" />
<result column="extra_value_4" jdbcType="VARCHAR" property="extraValue4" />
<result column="extra_value_5" jdbcType="VARCHAR" property="extraValue5" />
<result column="extra_value_6" jdbcType="VARCHAR" property="extraValue6" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<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="Update_By_Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="example.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">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, `key`, `name`, base_value, `group`, extra_value_1, extra_value_2, extra_value_3,
extra_value_4, extra_value_5, extra_value_6
</sql>
<select id="selectByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallSystemExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from litemall_system
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<if test="example.distinct">
distinct
</if>
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.value}
</foreach>
</when>
<otherwise>
id, `key`, `name`, base_value, `group`, extra_value_1, extra_value_2, extra_value_3,
extra_value_4, extra_value_5, extra_value_6
</otherwise>
</choose>
from litemall_system
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from litemall_system
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.value}
</foreach>
</when>
<otherwise>
id, `key`, `name`, base_value, `group`, extra_value_1, extra_value_2, extra_value_3,
extra_value_4, extra_value_5, extra_value_6
</otherwise>
</choose>
from litemall_system
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from litemall_system
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallSystemExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from litemall_system
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="org.linlinjava.litemall.db.domain.LitemallSystem">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into litemall_system (`key`, `name`, base_value,
`group`, extra_value_1, extra_value_2,
extra_value_3, extra_value_4, extra_value_5,
extra_value_6)
values (#{key,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{baseValue,jdbcType=VARCHAR},
#{group,jdbcType=VARCHAR}, #{extraValue1,jdbcType=VARCHAR}, #{extraValue2,jdbcType=VARCHAR},
#{extraValue3,jdbcType=VARCHAR}, #{extraValue4,jdbcType=VARCHAR}, #{extraValue5,jdbcType=VARCHAR},
#{extraValue6,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="org.linlinjava.litemall.db.domain.LitemallSystem">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into litemall_system
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="key != null">
`key`,
</if>
<if test="name != null">
`name`,
</if>
<if test="baseValue != null">
base_value,
</if>
<if test="group != null">
`group`,
</if>
<if test="extraValue1 != null">
extra_value_1,
</if>
<if test="extraValue2 != null">
extra_value_2,
</if>
<if test="extraValue3 != null">
extra_value_3,
</if>
<if test="extraValue4 != null">
extra_value_4,
</if>
<if test="extraValue5 != null">
extra_value_5,
</if>
<if test="extraValue6 != null">
extra_value_6,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="key != null">
#{key,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="baseValue != null">
#{baseValue,jdbcType=VARCHAR},
</if>
<if test="group != null">
#{group,jdbcType=VARCHAR},
</if>
<if test="extraValue1 != null">
#{extraValue1,jdbcType=VARCHAR},
</if>
<if test="extraValue2 != null">
#{extraValue2,jdbcType=VARCHAR},
</if>
<if test="extraValue3 != null">
#{extraValue3,jdbcType=VARCHAR},
</if>
<if test="extraValue4 != null">
#{extraValue4,jdbcType=VARCHAR},
</if>
<if test="extraValue5 != null">
#{extraValue5,jdbcType=VARCHAR},
</if>
<if test="extraValue6 != null">
#{extraValue6,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallSystemExample" resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from litemall_system
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update litemall_system
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.key != null">
`key` = #{record.key,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.baseValue != null">
base_value = #{record.baseValue,jdbcType=VARCHAR},
</if>
<if test="record.group != null">
`group` = #{record.group,jdbcType=VARCHAR},
</if>
<if test="record.extraValue1 != null">
extra_value_1 = #{record.extraValue1,jdbcType=VARCHAR},
</if>
<if test="record.extraValue2 != null">
extra_value_2 = #{record.extraValue2,jdbcType=VARCHAR},
</if>
<if test="record.extraValue3 != null">
extra_value_3 = #{record.extraValue3,jdbcType=VARCHAR},
</if>
<if test="record.extraValue4 != null">
extra_value_4 = #{record.extraValue4,jdbcType=VARCHAR},
</if>
<if test="record.extraValue5 != null">
extra_value_5 = #{record.extraValue5,jdbcType=VARCHAR},
</if>
<if test="record.extraValue6 != null">
extra_value_6 = #{record.extraValue6,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update litemall_system
set id = #{record.id,jdbcType=INTEGER},
`key` = #{record.key,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
base_value = #{record.baseValue,jdbcType=VARCHAR},
`group` = #{record.group,jdbcType=VARCHAR},
extra_value_1 = #{record.extraValue1,jdbcType=VARCHAR},
extra_value_2 = #{record.extraValue2,jdbcType=VARCHAR},
extra_value_3 = #{record.extraValue3,jdbcType=VARCHAR},
extra_value_4 = #{record.extraValue4,jdbcType=VARCHAR},
extra_value_5 = #{record.extraValue5,jdbcType=VARCHAR},
extra_value_6 = #{record.extraValue6,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="org.linlinjava.litemall.db.domain.LitemallSystem">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update litemall_system
<set>
<if test="key != null">
`key` = #{key,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="baseValue != null">
base_value = #{baseValue,jdbcType=VARCHAR},
</if>
<if test="group != null">
`group` = #{group,jdbcType=VARCHAR},
</if>
<if test="extraValue1 != null">
extra_value_1 = #{extraValue1,jdbcType=VARCHAR},
</if>
<if test="extraValue2 != null">
extra_value_2 = #{extraValue2,jdbcType=VARCHAR},
</if>
<if test="extraValue3 != null">
extra_value_3 = #{extraValue3,jdbcType=VARCHAR},
</if>
<if test="extraValue4 != null">
extra_value_4 = #{extraValue4,jdbcType=VARCHAR},
</if>
<if test="extraValue5 != null">
extra_value_5 = #{extraValue5,jdbcType=VARCHAR},
</if>
<if test="extraValue6 != null">
extra_value_6 = #{extraValue6,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="org.linlinjava.litemall.db.domain.LitemallSystem">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update litemall_system
set `key` = #{key,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
base_value = #{baseValue,jdbcType=VARCHAR},
`group` = #{group,jdbcType=VARCHAR},
extra_value_1 = #{extraValue1,jdbcType=VARCHAR},
extra_value_2 = #{extraValue2,jdbcType=VARCHAR},
extra_value_3 = #{extraValue3,jdbcType=VARCHAR},
extra_value_4 = #{extraValue4,jdbcType=VARCHAR},
extra_value_5 = #{extraValue5,jdbcType=VARCHAR},
extra_value_6 = #{extraValue6,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectOneByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallSystemExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<include refid="Base_Column_List" />
from litemall_system
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
limit 1
</select>
<select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
select
<choose>
<when test="selective != null and selective.length > 0">
<foreach collection="selective" item="column" separator=",">
${column.value}
</foreach>
</when>
<otherwise>
id, `key`, `name`, base_value, `group`, extra_value_1, extra_value_2, extra_value_3,
extra_value_4, extra_value_5, extra_value_6
</otherwise>
</choose>
from litemall_system
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
<if test="example.orderByClause != null">
order by ${example.orderByClause}
</if>
limit 1
</select>
</mapper>
\ No newline at end of file
package org.linlinjava.litemall.wx.service;
import org.linlinjava.litemall.db.domain.LitemallSystem;
import org.linlinjava.litemall.db.service.LitemallSystemCfgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.List;
/**
* 系统通用设置服务类,注意用 getSystemConfig() 方法直接获取初始化的静态实例,重新读取配置调用 inist() 方法
*/
@Component
public class SystemConfig {
public final static int LIMIT_NEW = 10001;
public final static int LIMIT_HOT = 10002;
public final static int LIMIT_BRAND = 10003;
public final static int LIMIT_TOPIC = 10004;
public final static int LIMIT_CALLIST = 10005;
public final static int LIMIT_CALGOOD = 10006;
public final static int BANNER_NEW = 11001;
public final static int BANNER_HOT = 11002;
public final static int BANNER_TITLE = 11101;
public final static int BANNER_IMAGE = 11102;
@Autowired
private LitemallSystemCfgService systemCfgService;
private List<LitemallSystem> systemConfigs;
private LitemallSystem indexLimitCfg;
private LitemallSystem newBannerCfg;
private LitemallSystem hotBannerCfg;
private static SystemConfig systemConfig;
public static SystemConfig getSystemConfig() {
return systemConfig;
}
@PostConstruct
public void inist() {
systemConfig = this;
systemConfig.systemConfigs = systemCfgService.queryAll();
systemConfig.inistConfigs();
}
public String getBannerInfo(final int banner, final int field) {
LitemallSystem cfg = null;
switch (banner) {
case BANNER_NEW:
cfg = newBannerCfg;
break;
case BANNER_HOT:
cfg = hotBannerCfg;
break;
}
if (cfg != null) {
switch (field) {
case BANNER_TITLE:
return cfg.getBaseValue();
case BANNER_IMAGE:
return cfg.getExtraValue1();
}
}
return null;
}
public Integer getIndexLimit(final int arg) {
switch (arg) {
case LIMIT_NEW:
return Integer.parseInt(indexLimitCfg.getExtraValue1());
case LIMIT_HOT:
return Integer.parseInt(indexLimitCfg.getExtraValue2());
case LIMIT_BRAND:
return Integer.parseInt(indexLimitCfg.getExtraValue3());
case LIMIT_TOPIC:
return Integer.parseInt(indexLimitCfg.getExtraValue4());
case LIMIT_CALLIST:
return Integer.parseInt(indexLimitCfg.getExtraValue5());
case LIMIT_CALGOOD:
return Integer.parseInt(indexLimitCfg.getExtraValue6());
}
return -1;
}
private void inistConfigs() {
for (LitemallSystem cfg : systemConfigs) {
if ("index_banner".equals(cfg.getGroup()) && "new".equals(cfg.getKey()))
newBannerCfg = cfg;
if ("index_banner".equals(cfg.getGroup()) && "hot".equals(cfg.getKey()))
hotBannerCfg = cfg;
if ("index_limit".equals(cfg.getGroup()))
indexLimitCfg = cfg;
}
}
}
......@@ -7,6 +7,7 @@ import org.linlinjava.litemall.db.domain.*;
import org.linlinjava.litemall.db.service.*;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.wx.annotation.LoginUser;
import org.linlinjava.litemall.wx.service.SystemConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -47,40 +48,39 @@ public class WxGoodsController {
@Autowired
private LitemallSearchHistoryService searchHistoryService;
@Autowired
private LitemallCartService cartService;
@Autowired
private LitemallGoodsSpecificationService goodsSpecificationService;
/**
* 商品详情
*
* <p>
* 用户可以不登录。
* 如果用户登录,则记录用户足迹以及返回用户收藏信息。
*
* @param userId 用户ID
* @param id 商品ID
* @param id 商品ID
* @return 商品详情
* 成功则
* {
* errno: 0,
* errmsg: '成功',
* data:
* {
* info: xxx,
* userHasCollect: xxx,
* issue: xxx,
* comment: xxx,
* specificationList: xxx,
* productList: xxx,
* attribute: xxx,
* brand: xxx
* }
* }
* 失败则 { errno: XXX, errmsg: XXX }
* 成功则
* {
* errno: 0,
* errmsg: '成功',
* data:
* {
* info: xxx,
* userHasCollect: xxx,
* issue: xxx,
* comment: xxx,
* specificationList: xxx,
* productList: xxx,
* attribute: xxx,
* brand: xxx
* }
* }
* 失败则 { errno: XXX, errmsg: XXX }
*/
@GetMapping("detail")
public Object detail(@LoginUser Integer userId, Integer id) {
if(id == null){
if (id == null) {
return ResponseUtil.badArgument();
}
......@@ -107,7 +107,7 @@ public class WxGoodsController {
List<LitemallComment> comments = commentService.queryGoodsByGid(id, 0, 2);
List<Map<String, Object>> commentsVo = new ArrayList<>(comments.size());
int commentCount = commentService.countGoodsByGid(id, 0, 2);
for(LitemallComment comment : comments){
for (LitemallComment comment : comments) {
Map<String, Object> c = new HashMap<>();
c.put("id", comment.getId());
c.put("addTime", comment.getAddTime());
......@@ -124,12 +124,12 @@ public class WxGoodsController {
// 用户收藏
int userHasCollect = 0;
if(userId != null) {
if (userId != null) {
userHasCollect = collectService.count(userId, id);
}
// 记录用户的足迹
if(userId != null) {
if (userId != null) {
LitemallFootprint footprint = new LitemallFootprint();
footprint.setAddTime(LocalDateTime.now());
footprint.setUserId(userId);
......@@ -152,39 +152,38 @@ public class WxGoodsController {
/**
* 商品分类类目
*
* <p>
* TODO 可能应该合并到WxCatalogController中
*
* @param id 分类类目ID
* @return 商品分类类目
* 成功则
* {
* errno: 0,
* errmsg: '成功',
* data:
* {
* currentCategory: xxx,
* parentCategory: xxx,
* brotherCategory: xxx
* }
* }
* 失败则 { errno: XXX, errmsg: XXX }
* 成功则
* {
* errno: 0,
* errmsg: '成功',
* data:
* {
* currentCategory: xxx,
* parentCategory: xxx,
* brotherCategory: xxx
* }
* }
* 失败则 { errno: XXX, errmsg: XXX }
*/
@GetMapping("category")
public Object category(Integer id) {
if(id == null){
if (id == null) {
return ResponseUtil.badArgument();
}
LitemallCategory cur = categoryService.findById(id);
LitemallCategory parent = null;
List<LitemallCategory> children = null;
if(cur.getPid() == 0){
if (cur.getPid() == 0) {
parent = cur;
children = categoryService.queryByPid(cur.getId());
cur = children.get(0);
}
else{
} else {
parent = categoryService.findById(cur.getPid());
children = categoryService.queryByPid(cur.getPid());
}
......@@ -197,33 +196,33 @@ public class WxGoodsController {
/**
* 根据条件搜素商品
*
* <p>
* 1. 这里的前五个参数都是可选的,甚至都是空
* 2. 用户是可选登录,如果登录,则记录用户的搜索关键字
*
* @param categoryId 分类类目ID
* @param brandId 品牌商ID
* @param keyword 关键字
* @param isNew 是否新品
* @param isHot 是否热买
* @param userId 用户ID
* @param page 分页页数
* @param size 分页大小
* @param sort 排序方式
* @param order 排序类型,顺序或者降序
* @param brandId 品牌商ID
* @param keyword 关键字
* @param isNew 是否新品
* @param isHot 是否热买
* @param userId 用户ID
* @param page 分页页数
* @param size 分页大小
* @param sort 排序方式
* @param order 排序类型,顺序或者降序
* @return 根据条件搜素的商品详情
* 成功则
* {
* errno: 0,
* errmsg: '成功',
* data:
* {
* goodsList: xxx,
* filterCategoryList: xxx,
* count: xxx
* }
* }
* 失败则 { errno: XXX, errmsg: XXX }
* 成功则
* {
* errno: 0,
* errmsg: '成功',
* data:
* {
* goodsList: xxx,
* filterCategoryList: xxx,
* count: xxx
* }
* }
* 失败则 { errno: XXX, errmsg: XXX }
*/
@GetMapping("list")
public Object list(Integer categoryId, Integer brandId, String keyword, Boolean isNew, Boolean isHot,
......@@ -249,7 +248,7 @@ public class WxGoodsController {
// 查询商品所属类目列表。
List<Integer> goodsCatIds = goodsService.getCatIds(brandId, keyword, isHot, isNew);
List<LitemallCategory> categoryList = null;
if(goodsCatIds.size() != 0) {
if (goodsCatIds.size() != 0) {
categoryList = categoryService.queryL2ByIds(goodsCatIds);
}
......@@ -262,27 +261,27 @@ public class WxGoodsController {
/**
* 新品首发页面的横幅数据
*
* <p>
* TODO 其实可以删除
*
* @return 新品首发页面的栏目数据
* 成功则
* {
* errno: 0,
* errmsg: '成功',
* data:
* {
* bannerInfo: xxx
* }
* }
* 失败则 { errno: XXX, errmsg: XXX }
* 成功则
* {
* errno: 0,
* errmsg: '成功',
* data:
* {
* bannerInfo: xxx
* }
* }
* 失败则 { errno: XXX, errmsg: XXX }
*/
@GetMapping("new")
public Object newGoods() {
Map<String, String> bannerInfo = new HashMap<>();
bannerInfo.put("url", "");
bannerInfo.put("name", "坚持初心,为你寻觅世间好物");
bannerInfo.put("imgUrl", "http://yanxuan.nosdn.127.net/8976116db321744084774643a933c5ce.png");
bannerInfo.put("name", SystemConfig.getSystemConfig().getBannerInfo(SystemConfig.BANNER_NEW, SystemConfig.BANNER_TITLE));
bannerInfo.put("imgUrl", SystemConfig.getSystemConfig().getBannerInfo(SystemConfig.BANNER_NEW, SystemConfig.BANNER_IMAGE));
Map<String, Object> data = new HashMap<>();
data.put("bannerInfo", bannerInfo);
......@@ -291,27 +290,27 @@ public class WxGoodsController {
/**
* 人气推荐页面的横幅数据
*
* <p>
* TODO 其实可以删除
*
* @return 人气推荐页面的栏目数据
* 成功则
* {
* errno: 0,
* errmsg: '成功',
* data:
* {
* bannerInfo: xxx
* }
* }
* 失败则 { errno: XXX, errmsg: XXX }
* 成功则
* {
* errno: 0,
* errmsg: '成功',
* data:
* {
* bannerInfo: xxx
* }
* }
* 失败则 { errno: XXX, errmsg: XXX }
*/
@GetMapping("hot")
public Object hotGoods() {
Map<String, String> bannerInfo = new HashMap<>();
bannerInfo.put("url", "");
bannerInfo.put("name", "大家都在买的严选好物");
bannerInfo.put("imgUrl", "http://yanxuan.nosdn.127.net/8976116db321744084774643a933c5ce.png");
bannerInfo.put("name", SystemConfig.getSystemConfig().getBannerInfo(SystemConfig.BANNER_HOT, SystemConfig.BANNER_TITLE));
bannerInfo.put("imgUrl", SystemConfig.getSystemConfig().getBannerInfo(SystemConfig.BANNER_HOT, SystemConfig.BANNER_IMAGE));
Map<String, Object> data = new HashMap<>();
data.put("bannerInfo", bannerInfo);
return ResponseUtil.ok(data);
......@@ -321,25 +320,25 @@ public class WxGoodsController {
* 商品页面推荐商品
*
* @return 商品页面推荐商品
* 成功则
* {
* errno: 0,
* errmsg: '成功',
* data:
* {
* goodsList: xxx
* }
* }
* 失败则 { errno: XXX, errmsg: XXX }
* 成功则
* {
* errno: 0,
* errmsg: '成功',
* data:
* {
* goodsList: xxx
* }
* }
* 失败则 { errno: XXX, errmsg: XXX }
*/
@GetMapping("related")
public Object related(Integer id) {
if(id == null){
if (id == null) {
return ResponseUtil.badArgument();
}
LitemallGoods goods = goodsService.findById(id);
if(goods == null){
if (goods == null) {
return ResponseUtil.badArgumentValue();
}
......@@ -358,16 +357,16 @@ public class WxGoodsController {
* 在售的商品总数
*
* @return 在售的商品总数
* 成功则
* {
* errno: 0,
* errmsg: '成功',
* data:
* {
* goodsCount: xxx
* }
* }
* 失败则 { errno: XXX, errmsg: XXX }
* 成功则
* {
* errno: 0,
* errmsg: '成功',
* data:
* {
* goodsCount: xxx
* }
* }
* 失败则 { errno: XXX, errmsg: XXX }
*/
@GetMapping("count")
public Object count() {
......
......@@ -5,6 +5,7 @@ import org.apache.commons.logging.LogFactory;
import org.linlinjava.litemall.db.domain.*;
import org.linlinjava.litemall.db.service.*;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.wx.service.SystemConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -30,28 +31,26 @@ public class WxHomeController {
private LitemallTopicService topicService;
@Autowired
private LitemallCategoryService categoryService;
@Autowired
private LitemallCartService cartService;
/**
* app首页
*
* @return app首页相关信息
* 成功则
* {
* errno: 0,
* errmsg: '成功',
* data:
* {
* banner: xxx,
* channel: xxx,
* newGoodsList: xxx,
* hotGoodsList: xxx,
* topicList: xxx,
* floorGoodsList: xxx
* }
* }
* 失败则 { errno: XXX, errmsg: XXX }
* 成功则
* {
* errno: 0,
* errmsg: '成功',
* data:
* {
* banner: xxx,
* channel: xxx,
* newGoodsList: xxx,
* hotGoodsList: xxx,
* topicList: xxx,
* floorGoodsList: xxx
* }
* }
* 失败则 { errno: XXX, errmsg: XXX }
*/
@GetMapping("/index")
public Object index() {
......@@ -63,20 +62,20 @@ public class WxHomeController {
List<LitemallCategory> channel = categoryService.queryChannel();
data.put("channel", channel);
List<LitemallGoods> newGoods = goodsService.queryByNew(0, 4);
List<LitemallGoods> newGoods = goodsService.queryByNew(0, SystemConfig.getSystemConfig().getIndexLimit(SystemConfig.LIMIT_NEW));
data.put("newGoodsList", newGoods);
List<LitemallGoods> hotGoods = goodsService.queryByHot(0, 3);
List<LitemallGoods> hotGoods = goodsService.queryByHot(0, SystemConfig.getSystemConfig().getIndexLimit(SystemConfig.LIMIT_HOT));
data.put("hotGoodsList", hotGoods);
List<LitemallBrand> brandList = brandService.query(0,4);
List<LitemallBrand> brandList = brandService.query(0, SystemConfig.getSystemConfig().getIndexLimit(SystemConfig.LIMIT_BRAND));
data.put("brandList", brandList);
List<LitemallTopic> topicList = topicService.queryList(0, 3);
List<LitemallTopic> topicList = topicService.queryList(0, SystemConfig.getSystemConfig().getIndexLimit(SystemConfig.LIMIT_TOPIC));
data.put("topicList", topicList);
List<Map> categoryList = new ArrayList<>();
List<LitemallCategory> catL1List = categoryService.queryL1WithoutRecommend(0, 6);
List<LitemallCategory> catL1List = categoryService.queryL1WithoutRecommend(0, SystemConfig.getSystemConfig().getIndexLimit(SystemConfig.LIMIT_CALLIST));
for (LitemallCategory catL1 : catL1List) {
List<LitemallCategory> catL2List = categoryService.queryByPid(catL1.getId());
List<Integer> l2List = new ArrayList<>();
......@@ -85,11 +84,10 @@ public class WxHomeController {
}
List<LitemallGoods> categoryGoods = null;
if(l2List.size() == 0){
if (l2List.size() == 0) {
categoryGoods = new ArrayList<>();
}
else{
categoryGoods = goodsService.queryByCategory(l2List, 0, 5);
} else {
categoryGoods = goodsService.queryByCategory(l2List, 0, SystemConfig.getSystemConfig().getIndexLimit(SystemConfig.LIMIT_CALGOOD));
}
Map catGoods = new HashMap();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment