重新生成代码

This commit is contained in:
shuzheng 2017-04-05 23:20:25 +08:00
parent 201eb808b4
commit abd77f6bbe
82 changed files with 1083 additions and 2286 deletions

View File

@ -1,6 +1,5 @@
package com.zheng.cms.admin.jms; package com.zheng.cms.admin.jms;
import com.zheng.cms.rpc.api.UserService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -21,9 +20,6 @@ public class DefaultMessageQueueListener implements MessageListener {
@Autowired @Autowired
ThreadPoolTaskExecutor threadPoolTaskExecutor; ThreadPoolTaskExecutor threadPoolTaskExecutor;
@Autowired
UserService userService;
public void onMessage(final Message message) { public void onMessage(final Message message) {
// 使用线程池多线程处理 // 使用线程池多线程处理
threadPoolTaskExecutor.execute(new Runnable() { threadPoolTaskExecutor.execute(new Runnable() {

View File

@ -1,53 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- 查找最新的schemaLocation 访问 http://www.springframework.org/schema/ --> <!-- 查找最新的schemaLocation 访问 http://www.springframework.org/schema/ -->
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:amq="http://activemq.apache.org/schema/core" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:jms="http://www.springframework.org/schema/jms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/beans/spring-beans-3.2.xsd">
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/jms
http://www.springframework.org/schema/jms/spring-jms-4.1.xsd
http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core-5.8.0.xsd">
<!-- 连接工厂 --> <!-- 连接工厂 -->
<bean id="activeMqConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> <bean id="activeMqConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="${AvtiveMQ.brokerURL}"/> <property name="brokerURL" value="${AvtiveMQ.brokerURL}"/>
<property name="useAsyncSend" value="true"/> <property name="useAsyncSend" value="true"/>
</bean> </bean>
<bean id="connectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory"> <bean id="connectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
<property name="targetConnectionFactory" ref="activeMqConnectionFactory"/> <property name="targetConnectionFactory" ref="activeMqConnectionFactory"/>
<property name="sessionCacheSize" value="100"/> <property name="sessionCacheSize" value="100"/>
</bean> </bean>
<!-- 点对点队列 --> <!-- 点对点队列 -->
<bean id="defaultQueueDestination" class="org.apache.activemq.command.ActiveMQQueue"> <bean id="defaultQueueDestination" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg index="0" value="com.zheng.cms.admin.queue.default"/> <constructor-arg index="0" value="com.zheng.cms.admin.queue.default"/>
</bean> </bean>
<!-- 一对多队列 --> <!-- 一对多队列 -->
<bean id="defaultTopicDestination" class="org.apache.activemq.command.ActiveMQTopic"> <bean id="defaultTopicDestination" class="org.apache.activemq.command.ActiveMQTopic">
<constructor-arg index="0" value="com.zheng.cms.admin.topic.default"/> <constructor-arg index="0" value="com.zheng.cms.admin.topic.default"/>
</bean> </bean>
<!-- 生产者 --> <!-- 生产者 -->
<bean id="jmsQueueTemplate" class="org.springframework.jms.core.JmsTemplate"> <bean id="jmsQueueTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="connectionFactory"/> <property name="connectionFactory" ref="connectionFactory"/>
<property name="pubSubDomain" value="false" /> <property name="pubSubDomain" value="false"/>
</bean> </bean>
<bean id="jmsTopicTemplate" class="org.springframework.jms.core.JmsTemplate"> <bean id="jmsTopicTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="connectionFactory"/> <property name="connectionFactory" ref="connectionFactory"/>
<property name="pubSubDomain" value="true" /> <property name="pubSubDomain" value="true"/>
</bean> </bean>
<!-- 消费者 --> <!-- 消费者 -->
<bean id="defaultMessageQueueListener" class="com.zheng.cms.admin.jms.DefaultMessageQueueListener"/> <bean id="defaultMessageQueueListener" class="com.zheng.cms.admin.jms.DefaultMessageQueueListener"/>
<bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer"> <bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="connectionFactory"/> <property name="connectionFactory" ref="connectionFactory"/>
<property name="destination" ref="defaultQueueDestination"/> <property name="destination" ref="defaultQueueDestination"/>
<property name="messageListener" ref="defaultMessageQueueListener"/> <property name="messageListener" ref="defaultMessageQueueListener"/>
<property name="sessionTransacted" value="true"/> <property name="sessionTransacted" value="true"/>
<!--<property name="concurrency" value="4-10"/>--> <!--<property name="concurrency" value="4-10"/>-->
</bean> </bean>
</beans> </beans>

View File

@ -31,8 +31,6 @@
<dubbo:reference id="cmsPageService" interface="com.zheng.cms.rpc.api.CmsPageService" mock="true"/> <dubbo:reference id="cmsPageService" interface="com.zheng.cms.rpc.api.CmsPageService" mock="true"/>
<!-- 设置 --> <!-- 设置 -->
<dubbo:reference id="cmsSettingService" interface="com.zheng.cms.rpc.api.CmsSettingService" mock="true"/> <dubbo:reference id="cmsSettingService" interface="com.zheng.cms.rpc.api.CmsSettingService" mock="true"/>
<!-- 用户 -->
<dubbo:reference id="userService" interface="com.zheng.cms.rpc.api.UserService" mock="true"/>
<!-- 接口服务 --> <!-- 接口服务 -->
<dubbo:reference id="upmsApiService" interface="com.zheng.upms.rpc.api.UpmsApiService" mock="true" registry="upmsRegistry"/> <dubbo:reference id="upmsApiService" interface="com.zheng.upms.rpc.api.UpmsApiService" mock="true" registry="upmsRegistry"/>

View File

@ -1,30 +0,0 @@
package com.zheng.cms.dao.mapper;
import com.zheng.cms.dao.model.CmsBook;
import com.zheng.cms.dao.model.CmsBookExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface CmsBookMapper {
long countByExample(CmsBookExample example);
int deleteByExample(CmsBookExample example);
int deleteByPrimaryKey(Integer bookId);
int insert(CmsBook record);
int insertSelective(CmsBook record);
List<CmsBook> selectByExample(CmsBookExample example);
CmsBook selectByPrimaryKey(Integer bookId);
int updateByExampleSelective(@Param("record") CmsBook record, @Param("example") CmsBookExample example);
int updateByExample(@Param("record") CmsBook record, @Param("example") CmsBookExample example);
int updateByPrimaryKeySelective(CmsBook record);
int updateByPrimaryKey(CmsBook record);
}

View File

@ -0,0 +1,30 @@
package com.zheng.cms.dao.mapper;
import com.zheng.cms.dao.model.CmsSystem;
import com.zheng.cms.dao.model.CmsSystemExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface CmsSystemMapper {
long countByExample(CmsSystemExample example);
int deleteByExample(CmsSystemExample example);
int deleteByPrimaryKey(Integer systemId);
int insert(CmsSystem record);
int insertSelective(CmsSystem record);
List<CmsSystem> selectByExample(CmsSystemExample example);
CmsSystem selectByPrimaryKey(Integer systemId);
int updateByExampleSelective(@Param("record") CmsSystem record, @Param("example") CmsSystemExample example);
int updateByExample(@Param("record") CmsSystem record, @Param("example") CmsSystemExample example);
int updateByPrimaryKeySelective(CmsSystem record);
int updateByPrimaryKey(CmsSystem record);
}

View File

@ -1,36 +0,0 @@
package com.zheng.cms.dao.mapper;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.dao.model.CmsUserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface CmsUserMapper {
long countByExample(CmsUserExample example);
int deleteByExample(CmsUserExample example);
int deleteByPrimaryKey(Integer userId);
int insert(CmsUser record);
int insertSelective(CmsUser record);
List<CmsUser> selectByExampleWithBLOBs(CmsUserExample example);
List<CmsUser> selectByExample(CmsUserExample example);
CmsUser selectByPrimaryKey(Integer userId);
int updateByExampleSelective(@Param("record") CmsUser record, @Param("example") CmsUserExample example);
int updateByExampleWithBLOBs(@Param("record") CmsUser record, @Param("example") CmsUserExample example);
int updateByExample(@Param("record") CmsUser record, @Param("example") CmsUserExample example);
int updateByPrimaryKeySelective(CmsUser record);
int updateByPrimaryKeyWithBLOBs(CmsUser record);
int updateByPrimaryKey(CmsUser record);
}

View File

@ -94,6 +94,20 @@ public class CmsArticle implements Serializable {
*/ */
private Integer readnumber; private Integer readnumber;
/**
* 置顶等级
*
* @mbg.generated
*/
private Integer top;
/**
* 所属系统
*
* @mbg.generated
*/
private Integer systemId;
/** /**
* 创建时间 * 创建时间
* *
@ -221,6 +235,22 @@ public class CmsArticle implements Serializable {
this.readnumber = readnumber; this.readnumber = readnumber;
} }
public Integer getTop() {
return top;
}
public void setTop(Integer top) {
this.top = top;
}
public Integer getSystemId() {
return systemId;
}
public void setSystemId(Integer systemId) {
this.systemId = systemId;
}
public Long getCtime() { public Long getCtime() {
return ctime; return ctime;
} }
@ -264,6 +294,8 @@ public class CmsArticle implements Serializable {
sb.append(", status=").append(status); sb.append(", status=").append(status);
sb.append(", userId=").append(userId); sb.append(", userId=").append(userId);
sb.append(", readnumber=").append(readnumber); sb.append(", readnumber=").append(readnumber);
sb.append(", top=").append(top);
sb.append(", systemId=").append(systemId);
sb.append(", ctime=").append(ctime); sb.append(", ctime=").append(ctime);
sb.append(", orders=").append(orders); sb.append(", orders=").append(orders);
sb.append(", content=").append(content); sb.append(", content=").append(content);
@ -296,6 +328,8 @@ public class CmsArticle implements Serializable {
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getReadnumber() == null ? other.getReadnumber() == null : this.getReadnumber().equals(other.getReadnumber())) && (this.getReadnumber() == null ? other.getReadnumber() == null : this.getReadnumber().equals(other.getReadnumber()))
&& (this.getTop() == null ? other.getTop() == null : this.getTop().equals(other.getTop()))
&& (this.getSystemId() == null ? other.getSystemId() == null : this.getSystemId().equals(other.getSystemId()))
&& (this.getCtime() == null ? other.getCtime() == null : this.getCtime().equals(other.getCtime())) && (this.getCtime() == null ? other.getCtime() == null : this.getCtime().equals(other.getCtime()))
&& (this.getOrders() == null ? other.getOrders() == null : this.getOrders().equals(other.getOrders())) && (this.getOrders() == null ? other.getOrders() == null : this.getOrders().equals(other.getOrders()))
&& (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent())); && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()));
@ -318,6 +352,8 @@ public class CmsArticle implements Serializable {
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getReadnumber() == null) ? 0 : getReadnumber().hashCode()); result = prime * result + ((getReadnumber() == null) ? 0 : getReadnumber().hashCode());
result = prime * result + ((getTop() == null) ? 0 : getTop().hashCode());
result = prime * result + ((getSystemId() == null) ? 0 : getSystemId().hashCode());
result = prime * result + ((getCtime() == null) ? 0 : getCtime().hashCode()); result = prime * result + ((getCtime() == null) ? 0 : getCtime().hashCode());
result = prime * result + ((getOrders() == null) ? 0 : getOrders().hashCode()); result = prime * result + ((getOrders() == null) ? 0 : getOrders().hashCode());
result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode()); result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());

View File

@ -967,6 +967,126 @@ public class CmsArticleExample implements Serializable {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTopIsNull() {
addCriterion("top is null");
return (Criteria) this;
}
public Criteria andTopIsNotNull() {
addCriterion("top is not null");
return (Criteria) this;
}
public Criteria andTopEqualTo(Integer value) {
addCriterion("top =", value, "top");
return (Criteria) this;
}
public Criteria andTopNotEqualTo(Integer value) {
addCriterion("top <>", value, "top");
return (Criteria) this;
}
public Criteria andTopGreaterThan(Integer value) {
addCriterion("top >", value, "top");
return (Criteria) this;
}
public Criteria andTopGreaterThanOrEqualTo(Integer value) {
addCriterion("top >=", value, "top");
return (Criteria) this;
}
public Criteria andTopLessThan(Integer value) {
addCriterion("top <", value, "top");
return (Criteria) this;
}
public Criteria andTopLessThanOrEqualTo(Integer value) {
addCriterion("top <=", value, "top");
return (Criteria) this;
}
public Criteria andTopIn(List<Integer> values) {
addCriterion("top in", values, "top");
return (Criteria) this;
}
public Criteria andTopNotIn(List<Integer> values) {
addCriterion("top not in", values, "top");
return (Criteria) this;
}
public Criteria andTopBetween(Integer value1, Integer value2) {
addCriterion("top between", value1, value2, "top");
return (Criteria) this;
}
public Criteria andTopNotBetween(Integer value1, Integer value2) {
addCriterion("top not between", value1, value2, "top");
return (Criteria) this;
}
public Criteria andSystemIdIsNull() {
addCriterion("system_id is null");
return (Criteria) this;
}
public Criteria andSystemIdIsNotNull() {
addCriterion("system_id is not null");
return (Criteria) this;
}
public Criteria andSystemIdEqualTo(Integer value) {
addCriterion("system_id =", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdNotEqualTo(Integer value) {
addCriterion("system_id <>", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdGreaterThan(Integer value) {
addCriterion("system_id >", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdGreaterThanOrEqualTo(Integer value) {
addCriterion("system_id >=", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdLessThan(Integer value) {
addCriterion("system_id <", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdLessThanOrEqualTo(Integer value) {
addCriterion("system_id <=", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdIn(List<Integer> values) {
addCriterion("system_id in", values, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdNotIn(List<Integer> values) {
addCriterion("system_id not in", values, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdBetween(Integer value1, Integer value2) {
addCriterion("system_id between", value1, value2, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdNotBetween(Integer value1, Integer value2) {
addCriterion("system_id not between", value1, value2, "systemId");
return (Criteria) this;
}
public Criteria andCtimeIsNull() { public Criteria andCtimeIsNull() {
addCriterion("ctime is null"); addCriterion("ctime is null");
return (Criteria) this; return (Criteria) this;

View File

@ -1,92 +0,0 @@
package com.zheng.cms.dao.model;
import java.io.Serializable;
public class CmsBook implements Serializable {
/**
* 编号
*
* @mbg.generated
*/
private Integer bookId;
/**
* 用户编号
*
* @mbg.generated
*/
private Integer userId;
/**
* 书名
*
* @mbg.generated
*/
private String name;
private static final long serialVersionUID = 1L;
public Integer getBookId() {
return bookId;
}
public void setBookId(Integer bookId) {
this.bookId = bookId;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", bookId=").append(bookId);
sb.append(", userId=").append(userId);
sb.append(", name=").append(name);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
CmsBook other = (CmsBook) that;
return (this.getBookId() == null ? other.getBookId() == null : this.getBookId().equals(other.getBookId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getBookId() == null) ? 0 : getBookId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
return result;
}
}

View File

@ -1,413 +0,0 @@
package com.zheng.cms.dao.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class CmsBookExample implements Serializable {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
private static final long serialVersionUID = 1L;
private Integer limit;
private Integer offset;
public CmsBookExample() {
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;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public Integer getLimit() {
return limit;
}
public void setOffset(Integer offset) {
this.offset = offset;
}
public Integer getOffset() {
return offset;
}
protected abstract static class GeneratedCriteria implements Serializable {
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 andBookIdIsNull() {
addCriterion("book_id is null");
return (Criteria) this;
}
public Criteria andBookIdIsNotNull() {
addCriterion("book_id is not null");
return (Criteria) this;
}
public Criteria andBookIdEqualTo(Integer value) {
addCriterion("book_id =", value, "bookId");
return (Criteria) this;
}
public Criteria andBookIdNotEqualTo(Integer value) {
addCriterion("book_id <>", value, "bookId");
return (Criteria) this;
}
public Criteria andBookIdGreaterThan(Integer value) {
addCriterion("book_id >", value, "bookId");
return (Criteria) this;
}
public Criteria andBookIdGreaterThanOrEqualTo(Integer value) {
addCriterion("book_id >=", value, "bookId");
return (Criteria) this;
}
public Criteria andBookIdLessThan(Integer value) {
addCriterion("book_id <", value, "bookId");
return (Criteria) this;
}
public Criteria andBookIdLessThanOrEqualTo(Integer value) {
addCriterion("book_id <=", value, "bookId");
return (Criteria) this;
}
public Criteria andBookIdIn(List<Integer> values) {
addCriterion("book_id in", values, "bookId");
return (Criteria) this;
}
public Criteria andBookIdNotIn(List<Integer> values) {
addCriterion("book_id not in", values, "bookId");
return (Criteria) this;
}
public Criteria andBookIdBetween(Integer value1, Integer value2) {
addCriterion("book_id between", value1, value2, "bookId");
return (Criteria) this;
}
public Criteria andBookIdNotBetween(Integer value1, Integer value2) {
addCriterion("book_id not between", value1, value2, "bookId");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Integer value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Integer value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Integer value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Integer value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Integer value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Integer value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Integer> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Integer> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Integer value1, Integer value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Integer value1, Integer value2) {
addCriterion("user_id not between", value1, value2, "userId");
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 implements Serializable {
protected Criteria() {
super();
}
}
public static class Criterion implements Serializable {
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);
}
}
}

View File

@ -59,6 +59,13 @@ public class CmsCategory implements Serializable {
*/ */
private String alias; private String alias;
/**
* 所属系统
*
* @mbg.generated
*/
private Integer systemId;
/** /**
* 创建时间 * 创建时间
* *
@ -139,6 +146,14 @@ public class CmsCategory implements Serializable {
this.alias = alias; this.alias = alias;
} }
public Integer getSystemId() {
return systemId;
}
public void setSystemId(Integer systemId) {
this.systemId = systemId;
}
public Long getCtime() { public Long getCtime() {
return ctime; return ctime;
} }
@ -169,6 +184,7 @@ public class CmsCategory implements Serializable {
sb.append(", icon=").append(icon); sb.append(", icon=").append(icon);
sb.append(", type=").append(type); sb.append(", type=").append(type);
sb.append(", alias=").append(alias); sb.append(", alias=").append(alias);
sb.append(", systemId=").append(systemId);
sb.append(", ctime=").append(ctime); sb.append(", ctime=").append(ctime);
sb.append(", orders=").append(orders); sb.append(", orders=").append(orders);
sb.append("]"); sb.append("]");
@ -195,6 +211,7 @@ public class CmsCategory implements Serializable {
&& (this.getIcon() == null ? other.getIcon() == null : this.getIcon().equals(other.getIcon())) && (this.getIcon() == null ? other.getIcon() == null : this.getIcon().equals(other.getIcon()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getAlias() == null ? other.getAlias() == null : this.getAlias().equals(other.getAlias())) && (this.getAlias() == null ? other.getAlias() == null : this.getAlias().equals(other.getAlias()))
&& (this.getSystemId() == null ? other.getSystemId() == null : this.getSystemId().equals(other.getSystemId()))
&& (this.getCtime() == null ? other.getCtime() == null : this.getCtime().equals(other.getCtime())) && (this.getCtime() == null ? other.getCtime() == null : this.getCtime().equals(other.getCtime()))
&& (this.getOrders() == null ? other.getOrders() == null : this.getOrders().equals(other.getOrders())); && (this.getOrders() == null ? other.getOrders() == null : this.getOrders().equals(other.getOrders()));
} }
@ -211,6 +228,7 @@ public class CmsCategory implements Serializable {
result = prime * result + ((getIcon() == null) ? 0 : getIcon().hashCode()); result = prime * result + ((getIcon() == null) ? 0 : getIcon().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getAlias() == null) ? 0 : getAlias().hashCode()); result = prime * result + ((getAlias() == null) ? 0 : getAlias().hashCode());
result = prime * result + ((getSystemId() == null) ? 0 : getSystemId().hashCode());
result = prime * result + ((getCtime() == null) ? 0 : getCtime().hashCode()); result = prime * result + ((getCtime() == null) ? 0 : getCtime().hashCode());
result = prime * result + ((getOrders() == null) ? 0 : getOrders().hashCode()); result = prime * result + ((getOrders() == null) ? 0 : getOrders().hashCode());
return result; return result;

View File

@ -647,6 +647,66 @@ public class CmsCategoryExample implements Serializable {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSystemIdIsNull() {
addCriterion("system_id is null");
return (Criteria) this;
}
public Criteria andSystemIdIsNotNull() {
addCriterion("system_id is not null");
return (Criteria) this;
}
public Criteria andSystemIdEqualTo(Integer value) {
addCriterion("system_id =", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdNotEqualTo(Integer value) {
addCriterion("system_id <>", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdGreaterThan(Integer value) {
addCriterion("system_id >", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdGreaterThanOrEqualTo(Integer value) {
addCriterion("system_id >=", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdLessThan(Integer value) {
addCriterion("system_id <", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdLessThanOrEqualTo(Integer value) {
addCriterion("system_id <=", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdIn(List<Integer> values) {
addCriterion("system_id in", values, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdNotIn(List<Integer> values) {
addCriterion("system_id not in", values, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdBetween(Integer value1, Integer value2) {
addCriterion("system_id between", value1, value2, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdNotBetween(Integer value1, Integer value2) {
addCriterion("system_id not between", value1, value2, "systemId");
return (Criteria) this;
}
public Criteria andCtimeIsNull() { public Criteria andCtimeIsNull() {
addCriterion("ctime is null"); addCriterion("ctime is null");
return (Criteria) this; return (Criteria) this;

View File

@ -52,6 +52,13 @@ public class CmsComment implements Serializable {
*/ */
private String agent; private String agent;
/**
* 所属系统
*
* @mbg.generated
*/
private Integer systemId;
/** /**
* 创建时间 * 创建时间
* *
@ -124,6 +131,14 @@ public class CmsComment implements Serializable {
this.agent = agent; this.agent = agent;
} }
public Integer getSystemId() {
return systemId;
}
public void setSystemId(Integer systemId) {
this.systemId = systemId;
}
public Long getCtime() { public Long getCtime() {
return ctime; return ctime;
} }
@ -153,6 +168,7 @@ public class CmsComment implements Serializable {
sb.append(", status=").append(status); sb.append(", status=").append(status);
sb.append(", ip=").append(ip); sb.append(", ip=").append(ip);
sb.append(", agent=").append(agent); sb.append(", agent=").append(agent);
sb.append(", systemId=").append(systemId);
sb.append(", ctime=").append(ctime); sb.append(", ctime=").append(ctime);
sb.append(", content=").append(content); sb.append(", content=").append(content);
sb.append("]"); sb.append("]");
@ -178,6 +194,7 @@ public class CmsComment implements Serializable {
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getIp() == null ? other.getIp() == null : this.getIp().equals(other.getIp())) && (this.getIp() == null ? other.getIp() == null : this.getIp().equals(other.getIp()))
&& (this.getAgent() == null ? other.getAgent() == null : this.getAgent().equals(other.getAgent())) && (this.getAgent() == null ? other.getAgent() == null : this.getAgent().equals(other.getAgent()))
&& (this.getSystemId() == null ? other.getSystemId() == null : this.getSystemId().equals(other.getSystemId()))
&& (this.getCtime() == null ? other.getCtime() == null : this.getCtime().equals(other.getCtime())) && (this.getCtime() == null ? other.getCtime() == null : this.getCtime().equals(other.getCtime()))
&& (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent())); && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()));
} }
@ -193,6 +210,7 @@ public class CmsComment implements Serializable {
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getIp() == null) ? 0 : getIp().hashCode()); result = prime * result + ((getIp() == null) ? 0 : getIp().hashCode());
result = prime * result + ((getAgent() == null) ? 0 : getAgent().hashCode()); result = prime * result + ((getAgent() == null) ? 0 : getAgent().hashCode());
result = prime * result + ((getSystemId() == null) ? 0 : getSystemId().hashCode());
result = prime * result + ((getCtime() == null) ? 0 : getCtime().hashCode()); result = prime * result + ((getCtime() == null) ? 0 : getCtime().hashCode());
result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode()); result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
return result; return result;

View File

@ -567,6 +567,66 @@ public class CmsCommentExample implements Serializable {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSystemIdIsNull() {
addCriterion("system_id is null");
return (Criteria) this;
}
public Criteria andSystemIdIsNotNull() {
addCriterion("system_id is not null");
return (Criteria) this;
}
public Criteria andSystemIdEqualTo(Integer value) {
addCriterion("system_id =", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdNotEqualTo(Integer value) {
addCriterion("system_id <>", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdGreaterThan(Integer value) {
addCriterion("system_id >", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdGreaterThanOrEqualTo(Integer value) {
addCriterion("system_id >=", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdLessThan(Integer value) {
addCriterion("system_id <", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdLessThanOrEqualTo(Integer value) {
addCriterion("system_id <=", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdIn(List<Integer> values) {
addCriterion("system_id in", values, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdNotIn(List<Integer> values) {
addCriterion("system_id not in", values, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdBetween(Integer value1, Integer value2) {
addCriterion("system_id between", value1, value2, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdNotBetween(Integer value1, Integer value2) {
addCriterion("system_id not between", value1, value2, "systemId");
return (Criteria) this;
}
public Criteria andCtimeIsNull() { public Criteria andCtimeIsNull() {
addCriterion("ctime is null"); addCriterion("ctime is null");
return (Criteria) this; return (Criteria) this;

View File

@ -0,0 +1,146 @@
package com.zheng.cms.dao.model;
import java.io.Serializable;
public class CmsSystem implements Serializable {
/**
* 编号
*
* @mbg.generated
*/
private Integer systemId;
/**
* 系统名称
*
* @mbg.generated
*/
private String name;
/**
* 别名
*
* @mbg.generated
*/
private String code;
/**
* 描述
*
* @mbg.generated
*/
private String description;
/**
* 创建时间
*
* @mbg.generated
*/
private Long ctime;
/**
* 排序
*
* @mbg.generated
*/
private Long orders;
private static final long serialVersionUID = 1L;
public Integer getSystemId() {
return systemId;
}
public void setSystemId(Integer systemId) {
this.systemId = systemId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Long getCtime() {
return ctime;
}
public void setCtime(Long ctime) {
this.ctime = ctime;
}
public Long getOrders() {
return orders;
}
public void setOrders(Long orders) {
this.orders = orders;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", systemId=").append(systemId);
sb.append(", name=").append(name);
sb.append(", code=").append(code);
sb.append(", description=").append(description);
sb.append(", ctime=").append(ctime);
sb.append(", orders=").append(orders);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
CmsSystem other = (CmsSystem) that;
return (this.getSystemId() == null ? other.getSystemId() == null : this.getSystemId().equals(other.getSystemId()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
&& (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
&& (this.getCtime() == null ? other.getCtime() == null : this.getCtime().equals(other.getCtime()))
&& (this.getOrders() == null ? other.getOrders() == null : this.getOrders().equals(other.getOrders()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getSystemId() == null) ? 0 : getSystemId().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
result = prime * result + ((getCtime() == null) ? 0 : getCtime().hashCode());
result = prime * result + ((getOrders() == null) ? 0 : getOrders().hashCode());
return result;
}
}

View File

@ -4,7 +4,7 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class CmsUserExample implements Serializable { public class CmsSystemExample implements Serializable {
protected String orderByClause; protected String orderByClause;
protected boolean distinct; protected boolean distinct;
@ -17,7 +17,7 @@ public class CmsUserExample implements Serializable {
private Integer offset; private Integer offset;
public CmsUserExample() { public CmsSystemExample() {
oredCriteria = new ArrayList<Criteria>(); oredCriteria = new ArrayList<Criteria>();
} }
@ -127,333 +127,273 @@ public class CmsUserExample implements Serializable {
criteria.add(new Criterion(condition, value1, value2)); criteria.add(new Criterion(condition, value1, value2));
} }
public Criteria andUserIdIsNull() { public Criteria andSystemIdIsNull() {
addCriterion("user_id is null"); addCriterion("system_id is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUserIdIsNotNull() { public Criteria andSystemIdIsNotNull() {
addCriterion("user_id is not null"); addCriterion("system_id is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUserIdEqualTo(Integer value) { public Criteria andSystemIdEqualTo(Integer value) {
addCriterion("user_id =", value, "userId"); addCriterion("system_id =", value, "systemId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUserIdNotEqualTo(Integer value) { public Criteria andSystemIdNotEqualTo(Integer value) {
addCriterion("user_id <>", value, "userId"); addCriterion("system_id <>", value, "systemId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUserIdGreaterThan(Integer value) { public Criteria andSystemIdGreaterThan(Integer value) {
addCriterion("user_id >", value, "userId"); addCriterion("system_id >", value, "systemId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUserIdGreaterThanOrEqualTo(Integer value) { public Criteria andSystemIdGreaterThanOrEqualTo(Integer value) {
addCriterion("user_id >=", value, "userId"); addCriterion("system_id >=", value, "systemId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUserIdLessThan(Integer value) { public Criteria andSystemIdLessThan(Integer value) {
addCriterion("user_id <", value, "userId"); addCriterion("system_id <", value, "systemId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUserIdLessThanOrEqualTo(Integer value) { public Criteria andSystemIdLessThanOrEqualTo(Integer value) {
addCriterion("user_id <=", value, "userId"); addCriterion("system_id <=", value, "systemId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUserIdIn(List<Integer> values) { public Criteria andSystemIdIn(List<Integer> values) {
addCriterion("user_id in", values, "userId"); addCriterion("system_id in", values, "systemId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUserIdNotIn(List<Integer> values) { public Criteria andSystemIdNotIn(List<Integer> values) {
addCriterion("user_id not in", values, "userId"); addCriterion("system_id not in", values, "systemId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUserIdBetween(Integer value1, Integer value2) { public Criteria andSystemIdBetween(Integer value1, Integer value2) {
addCriterion("user_id between", value1, value2, "userId"); addCriterion("system_id between", value1, value2, "systemId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUserIdNotBetween(Integer value1, Integer value2) { public Criteria andSystemIdNotBetween(Integer value1, Integer value2) {
addCriterion("user_id not between", value1, value2, "userId"); addCriterion("system_id not between", value1, value2, "systemId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUsernameIsNull() { public Criteria andNameIsNull() {
addCriterion("username is null"); addCriterion("name is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUsernameIsNotNull() { public Criteria andNameIsNotNull() {
addCriterion("username is not null"); addCriterion("name is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUsernameEqualTo(String value) { public Criteria andNameEqualTo(String value) {
addCriterion("username =", value, "username"); addCriterion("name =", value, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUsernameNotEqualTo(String value) { public Criteria andNameNotEqualTo(String value) {
addCriterion("username <>", value, "username"); addCriterion("name <>", value, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUsernameGreaterThan(String value) { public Criteria andNameGreaterThan(String value) {
addCriterion("username >", value, "username"); addCriterion("name >", value, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUsernameGreaterThanOrEqualTo(String value) { public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("username >=", value, "username"); addCriterion("name >=", value, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUsernameLessThan(String value) { public Criteria andNameLessThan(String value) {
addCriterion("username <", value, "username"); addCriterion("name <", value, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUsernameLessThanOrEqualTo(String value) { public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("username <=", value, "username"); addCriterion("name <=", value, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUsernameLike(String value) { public Criteria andNameLike(String value) {
addCriterion("username like", value, "username"); addCriterion("name like", value, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUsernameNotLike(String value) { public Criteria andNameNotLike(String value) {
addCriterion("username not like", value, "username"); addCriterion("name not like", value, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUsernameIn(List<String> values) { public Criteria andNameIn(List<String> values) {
addCriterion("username in", values, "username"); addCriterion("name in", values, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUsernameNotIn(List<String> values) { public Criteria andNameNotIn(List<String> values) {
addCriterion("username not in", values, "username"); addCriterion("name not in", values, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUsernameBetween(String value1, String value2) { public Criteria andNameBetween(String value1, String value2) {
addCriterion("username between", value1, value2, "username"); addCriterion("name between", value1, value2, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUsernameNotBetween(String value1, String value2) { public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("username not between", value1, value2, "username"); addCriterion("name not between", value1, value2, "name");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordIsNull() { public Criteria andCodeIsNull() {
addCriterion("password is null"); addCriterion("code is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordIsNotNull() { public Criteria andCodeIsNotNull() {
addCriterion("password is not null"); addCriterion("code is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordEqualTo(String value) { public Criteria andCodeEqualTo(String value) {
addCriterion("password =", value, "password"); addCriterion("code =", value, "code");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordNotEqualTo(String value) { public Criteria andCodeNotEqualTo(String value) {
addCriterion("password <>", value, "password"); addCriterion("code <>", value, "code");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordGreaterThan(String value) { public Criteria andCodeGreaterThan(String value) {
addCriterion("password >", value, "password"); addCriterion("code >", value, "code");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordGreaterThanOrEqualTo(String value) { public Criteria andCodeGreaterThanOrEqualTo(String value) {
addCriterion("password >=", value, "password"); addCriterion("code >=", value, "code");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordLessThan(String value) { public Criteria andCodeLessThan(String value) {
addCriterion("password <", value, "password"); addCriterion("code <", value, "code");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordLessThanOrEqualTo(String value) { public Criteria andCodeLessThanOrEqualTo(String value) {
addCriterion("password <=", value, "password"); addCriterion("code <=", value, "code");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordLike(String value) { public Criteria andCodeLike(String value) {
addCriterion("password like", value, "password"); addCriterion("code like", value, "code");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordNotLike(String value) { public Criteria andCodeNotLike(String value) {
addCriterion("password not like", value, "password"); addCriterion("code not like", value, "code");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordIn(List<String> values) { public Criteria andCodeIn(List<String> values) {
addCriterion("password in", values, "password"); addCriterion("code in", values, "code");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordNotIn(List<String> values) { public Criteria andCodeNotIn(List<String> values) {
addCriterion("password not in", values, "password"); addCriterion("code not in", values, "code");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordBetween(String value1, String value2) { public Criteria andCodeBetween(String value1, String value2) {
addCriterion("password between", value1, value2, "password"); addCriterion("code between", value1, value2, "code");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPasswordNotBetween(String value1, String value2) { public Criteria andCodeNotBetween(String value1, String value2) {
addCriterion("password not between", value1, value2, "password"); addCriterion("code not between", value1, value2, "code");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNicknameIsNull() { public Criteria andDescriptionIsNull() {
addCriterion("nickname is null"); addCriterion("description is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNicknameIsNotNull() { public Criteria andDescriptionIsNotNull() {
addCriterion("nickname is not null"); addCriterion("description is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNicknameEqualTo(String value) { public Criteria andDescriptionEqualTo(String value) {
addCriterion("nickname =", value, "nickname"); addCriterion("description =", value, "description");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNicknameNotEqualTo(String value) { public Criteria andDescriptionNotEqualTo(String value) {
addCriterion("nickname <>", value, "nickname"); addCriterion("description <>", value, "description");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNicknameGreaterThan(String value) { public Criteria andDescriptionGreaterThan(String value) {
addCriterion("nickname >", value, "nickname"); addCriterion("description >", value, "description");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNicknameGreaterThanOrEqualTo(String value) { public Criteria andDescriptionGreaterThanOrEqualTo(String value) {
addCriterion("nickname >=", value, "nickname"); addCriterion("description >=", value, "description");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNicknameLessThan(String value) { public Criteria andDescriptionLessThan(String value) {
addCriterion("nickname <", value, "nickname"); addCriterion("description <", value, "description");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNicknameLessThanOrEqualTo(String value) { public Criteria andDescriptionLessThanOrEqualTo(String value) {
addCriterion("nickname <=", value, "nickname"); addCriterion("description <=", value, "description");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNicknameLike(String value) { public Criteria andDescriptionLike(String value) {
addCriterion("nickname like", value, "nickname"); addCriterion("description like", value, "description");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNicknameNotLike(String value) { public Criteria andDescriptionNotLike(String value) {
addCriterion("nickname not like", value, "nickname"); addCriterion("description not like", value, "description");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNicknameIn(List<String> values) { public Criteria andDescriptionIn(List<String> values) {
addCriterion("nickname in", values, "nickname"); addCriterion("description in", values, "description");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNicknameNotIn(List<String> values) { public Criteria andDescriptionNotIn(List<String> values) {
addCriterion("nickname not in", values, "nickname"); addCriterion("description not in", values, "description");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNicknameBetween(String value1, String value2) { public Criteria andDescriptionBetween(String value1, String value2) {
addCriterion("nickname between", value1, value2, "nickname"); addCriterion("description between", value1, value2, "description");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andNicknameNotBetween(String value1, String value2) { public Criteria andDescriptionNotBetween(String value1, String value2) {
addCriterion("nickname not between", value1, value2, "nickname"); addCriterion("description not between", value1, value2, "description");
return (Criteria) this;
}
public Criteria andSexIsNull() {
addCriterion("sex is null");
return (Criteria) this;
}
public Criteria andSexIsNotNull() {
addCriterion("sex is not null");
return (Criteria) this;
}
public Criteria andSexEqualTo(Integer value) {
addCriterion("sex =", value, "sex");
return (Criteria) this;
}
public Criteria andSexNotEqualTo(Integer value) {
addCriterion("sex <>", value, "sex");
return (Criteria) this;
}
public Criteria andSexGreaterThan(Integer value) {
addCriterion("sex >", value, "sex");
return (Criteria) this;
}
public Criteria andSexGreaterThanOrEqualTo(Integer value) {
addCriterion("sex >=", value, "sex");
return (Criteria) this;
}
public Criteria andSexLessThan(Integer value) {
addCriterion("sex <", value, "sex");
return (Criteria) this;
}
public Criteria andSexLessThanOrEqualTo(Integer value) {
addCriterion("sex <=", value, "sex");
return (Criteria) this;
}
public Criteria andSexIn(List<Integer> values) {
addCriterion("sex in", values, "sex");
return (Criteria) this;
}
public Criteria andSexNotIn(List<Integer> values) {
addCriterion("sex not in", values, "sex");
return (Criteria) this;
}
public Criteria andSexBetween(Integer value1, Integer value2) {
addCriterion("sex between", value1, value2, "sex");
return (Criteria) this;
}
public Criteria andSexNotBetween(Integer value1, Integer value2) {
addCriterion("sex not between", value1, value2, "sex");
return (Criteria) this; return (Criteria) this;
} }
@ -516,6 +456,66 @@ public class CmsUserExample implements Serializable {
addCriterion("ctime not between", value1, value2, "ctime"); addCriterion("ctime not between", value1, value2, "ctime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOrdersIsNull() {
addCriterion("orders is null");
return (Criteria) this;
}
public Criteria andOrdersIsNotNull() {
addCriterion("orders is not null");
return (Criteria) this;
}
public Criteria andOrdersEqualTo(Long value) {
addCriterion("orders =", value, "orders");
return (Criteria) this;
}
public Criteria andOrdersNotEqualTo(Long value) {
addCriterion("orders <>", value, "orders");
return (Criteria) this;
}
public Criteria andOrdersGreaterThan(Long value) {
addCriterion("orders >", value, "orders");
return (Criteria) this;
}
public Criteria andOrdersGreaterThanOrEqualTo(Long value) {
addCriterion("orders >=", value, "orders");
return (Criteria) this;
}
public Criteria andOrdersLessThan(Long value) {
addCriterion("orders <", value, "orders");
return (Criteria) this;
}
public Criteria andOrdersLessThanOrEqualTo(Long value) {
addCriterion("orders <=", value, "orders");
return (Criteria) this;
}
public Criteria andOrdersIn(List<Long> values) {
addCriterion("orders in", values, "orders");
return (Criteria) this;
}
public Criteria andOrdersNotIn(List<Long> values) {
addCriterion("orders not in", values, "orders");
return (Criteria) this;
}
public Criteria andOrdersBetween(Long value1, Long value2) {
addCriterion("orders between", value1, value2, "orders");
return (Criteria) this;
}
public Criteria andOrdersNotBetween(Long value1, Long value2) {
addCriterion("orders not between", value1, value2, "orders");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria implements Serializable { public static class Criteria extends GeneratedCriteria implements Serializable {

View File

@ -45,6 +45,13 @@ public class CmsTag implements Serializable {
*/ */
private String alias; private String alias;
/**
* 所属系统
*
* @mbg.generated
*/
private Integer systemId;
/** /**
* 创建时间 * 创建时间
* *
@ -109,6 +116,14 @@ public class CmsTag implements Serializable {
this.alias = alias; this.alias = alias;
} }
public Integer getSystemId() {
return systemId;
}
public void setSystemId(Integer systemId) {
this.systemId = systemId;
}
public Long getCtime() { public Long getCtime() {
return ctime; return ctime;
} }
@ -137,6 +152,7 @@ public class CmsTag implements Serializable {
sb.append(", icon=").append(icon); sb.append(", icon=").append(icon);
sb.append(", type=").append(type); sb.append(", type=").append(type);
sb.append(", alias=").append(alias); sb.append(", alias=").append(alias);
sb.append(", systemId=").append(systemId);
sb.append(", ctime=").append(ctime); sb.append(", ctime=").append(ctime);
sb.append(", orders=").append(orders); sb.append(", orders=").append(orders);
sb.append("]"); sb.append("]");
@ -161,6 +177,7 @@ public class CmsTag implements Serializable {
&& (this.getIcon() == null ? other.getIcon() == null : this.getIcon().equals(other.getIcon())) && (this.getIcon() == null ? other.getIcon() == null : this.getIcon().equals(other.getIcon()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getAlias() == null ? other.getAlias() == null : this.getAlias().equals(other.getAlias())) && (this.getAlias() == null ? other.getAlias() == null : this.getAlias().equals(other.getAlias()))
&& (this.getSystemId() == null ? other.getSystemId() == null : this.getSystemId().equals(other.getSystemId()))
&& (this.getCtime() == null ? other.getCtime() == null : this.getCtime().equals(other.getCtime())) && (this.getCtime() == null ? other.getCtime() == null : this.getCtime().equals(other.getCtime()))
&& (this.getOrders() == null ? other.getOrders() == null : this.getOrders().equals(other.getOrders())); && (this.getOrders() == null ? other.getOrders() == null : this.getOrders().equals(other.getOrders()));
} }
@ -175,6 +192,7 @@ public class CmsTag implements Serializable {
result = prime * result + ((getIcon() == null) ? 0 : getIcon().hashCode()); result = prime * result + ((getIcon() == null) ? 0 : getIcon().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getAlias() == null) ? 0 : getAlias().hashCode()); result = prime * result + ((getAlias() == null) ? 0 : getAlias().hashCode());
result = prime * result + ((getSystemId() == null) ? 0 : getSystemId().hashCode());
result = prime * result + ((getCtime() == null) ? 0 : getCtime().hashCode()); result = prime * result + ((getCtime() == null) ? 0 : getCtime().hashCode());
result = prime * result + ((getOrders() == null) ? 0 : getOrders().hashCode()); result = prime * result + ((getOrders() == null) ? 0 : getOrders().hashCode());
return result; return result;

View File

@ -527,6 +527,66 @@ public class CmsTagExample implements Serializable {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andSystemIdIsNull() {
addCriterion("system_id is null");
return (Criteria) this;
}
public Criteria andSystemIdIsNotNull() {
addCriterion("system_id is not null");
return (Criteria) this;
}
public Criteria andSystemIdEqualTo(Integer value) {
addCriterion("system_id =", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdNotEqualTo(Integer value) {
addCriterion("system_id <>", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdGreaterThan(Integer value) {
addCriterion("system_id >", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdGreaterThanOrEqualTo(Integer value) {
addCriterion("system_id >=", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdLessThan(Integer value) {
addCriterion("system_id <", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdLessThanOrEqualTo(Integer value) {
addCriterion("system_id <=", value, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdIn(List<Integer> values) {
addCriterion("system_id in", values, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdNotIn(List<Integer> values) {
addCriterion("system_id not in", values, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdBetween(Integer value1, Integer value2) {
addCriterion("system_id between", value1, value2, "systemId");
return (Criteria) this;
}
public Criteria andSystemIdNotBetween(Integer value1, Integer value2) {
addCriterion("system_id not between", value1, value2, "systemId");
return (Criteria) this;
}
public Criteria andCtimeIsNull() { public Criteria andCtimeIsNull() {
addCriterion("ctime is null"); addCriterion("ctime is null");
return (Criteria) this; return (Criteria) this;

View File

@ -1,164 +0,0 @@
package com.zheng.cms.dao.model;
import java.io.Serializable;
public class CmsUser implements Serializable {
/**
* 编号
*
* @mbg.generated
*/
private Integer userId;
/**
* 账号
*
* @mbg.generated
*/
private String username;
/**
* 密码
*
* @mbg.generated
*/
private String password;
/**
* 昵称
*
* @mbg.generated
*/
private String nickname;
/**
* 0未知,1男,2女
*
* @mbg.generated
*/
private Integer sex;
/**
* 创建时间
*
* @mbg.generated
*/
private Long ctime;
/**
* 备注
*
* @mbg.generated
*/
private String content;
private static final long serialVersionUID = 1L;
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public Integer getSex() {
return sex;
}
public void setSex(Integer sex) {
this.sex = sex;
}
public Long getCtime() {
return ctime;
}
public void setCtime(Long ctime) {
this.ctime = ctime;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", userId=").append(userId);
sb.append(", username=").append(username);
sb.append(", password=").append(password);
sb.append(", nickname=").append(nickname);
sb.append(", sex=").append(sex);
sb.append(", ctime=").append(ctime);
sb.append(", content=").append(content);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
CmsUser other = (CmsUser) that;
return (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername()))
&& (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
&& (this.getNickname() == null ? other.getNickname() == null : this.getNickname().equals(other.getNickname()))
&& (this.getSex() == null ? other.getSex() == null : this.getSex().equals(other.getSex()))
&& (this.getCtime() == null ? other.getCtime() == null : this.getCtime().equals(other.getCtime()))
&& (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode());
result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
result = prime * result + ((getNickname() == null) ? 0 : getNickname().hashCode());
result = prime * result + ((getSex() == null) ? 0 : getSex().hashCode());
result = prime * result + ((getCtime() == null) ? 0 : getCtime().hashCode());
result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
return result;
}
}

View File

@ -1,8 +1,5 @@
package com.zheng.cms.job.jms; package com.zheng.cms.job.jms;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.rpc.api.UserService;
import net.sf.json.JSONObject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -11,8 +8,6 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import javax.jms.Message; import javax.jms.Message;
import javax.jms.MessageListener; import javax.jms.MessageListener;
import javax.jms.TextMessage; import javax.jms.TextMessage;
import java.text.SimpleDateFormat;
import java.util.Date;
/** /**
* MQ消费者 * MQ消费者
@ -25,9 +20,6 @@ public class DefaultMessageQueueListener implements MessageListener {
@Autowired @Autowired
ThreadPoolTaskExecutor threadPoolTaskExecutor; ThreadPoolTaskExecutor threadPoolTaskExecutor;
@Autowired
UserService userService;
public void onMessage(final Message message) { public void onMessage(final Message message) {
// 使用线程池多线程处理 // 使用线程池多线程处理
threadPoolTaskExecutor.execute(new Runnable() { threadPoolTaskExecutor.execute(new Runnable() {
@ -35,15 +27,7 @@ public class DefaultMessageQueueListener implements MessageListener {
TextMessage textMessage = (TextMessage) message; TextMessage textMessage = (TextMessage) message;
try { try {
String text = textMessage.getText(); String text = textMessage.getText();
JSONObject json = JSONObject.fromObject(text); _log.info("消费:{}", text);
CmsUser user = (CmsUser) JSONObject.toBean(json, CmsUser.class);
if (user.getUsername().equals("1")) {
_log.info("消费开始时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(System.currentTimeMillis())));
}
if (user.getUsername().equals("1000")) {
_log.info("消费结束时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(System.currentTimeMillis())));
}
userService.insertSelective(user);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -1,23 +0,0 @@
package com.zheng.cms.dao.model;
import java.io.Serializable;
import java.util.List;
/**
* 用户VO
* Created by shuzheng on 2016/11/14.
*/
public class UserVO extends CmsUser implements Serializable {
private static final long serialVersionUID = 1L;
private List<CmsBook> books;
public List<CmsBook> getBooks() {
return books;
}
public void setBooks(List<CmsBook> books) {
this.books = books;
}
}

View File

@ -6,7 +6,7 @@ import com.zheng.cms.dao.model.CmsArticleCategoryExample;
/** /**
* CmsArticleCategoryService接口 * CmsArticleCategoryService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public interface CmsArticleCategoryService extends BaseService<CmsArticleCategory, CmsArticleCategoryExample> { public interface CmsArticleCategoryService extends BaseService<CmsArticleCategory, CmsArticleCategoryExample> {

View File

@ -7,7 +7,7 @@ import com.zheng.cms.dao.model.CmsArticleCategoryExample;
/** /**
* 降级实现CmsArticleCategoryService接口 * 降级实现CmsArticleCategoryService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public class CmsArticleCategoryServiceMock extends BaseServiceMock<CmsArticleCategoryMapper, CmsArticleCategory, CmsArticleCategoryExample> implements CmsArticleCategoryService { public class CmsArticleCategoryServiceMock extends BaseServiceMock<CmsArticleCategoryMapper, CmsArticleCategory, CmsArticleCategoryExample> implements CmsArticleCategoryService {

View File

@ -6,7 +6,7 @@ import com.zheng.cms.dao.model.CmsArticleExample;
/** /**
* CmsArticleService接口 * CmsArticleService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public interface CmsArticleService extends BaseService<CmsArticle, CmsArticleExample> { public interface CmsArticleService extends BaseService<CmsArticle, CmsArticleExample> {

View File

@ -7,7 +7,7 @@ import com.zheng.cms.dao.model.CmsArticleExample;
/** /**
* 降级实现CmsArticleService接口 * 降级实现CmsArticleService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public class CmsArticleServiceMock extends BaseServiceMock<CmsArticleMapper, CmsArticle, CmsArticleExample> implements CmsArticleService { public class CmsArticleServiceMock extends BaseServiceMock<CmsArticleMapper, CmsArticle, CmsArticleExample> implements CmsArticleService {

View File

@ -6,7 +6,7 @@ import com.zheng.cms.dao.model.CmsArticleTagExample;
/** /**
* CmsArticleTagService接口 * CmsArticleTagService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public interface CmsArticleTagService extends BaseService<CmsArticleTag, CmsArticleTagExample> { public interface CmsArticleTagService extends BaseService<CmsArticleTag, CmsArticleTagExample> {

View File

@ -7,7 +7,7 @@ import com.zheng.cms.dao.model.CmsArticleTagExample;
/** /**
* 降级实现CmsArticleTagService接口 * 降级实现CmsArticleTagService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public class CmsArticleTagServiceMock extends BaseServiceMock<CmsArticleTagMapper, CmsArticleTag, CmsArticleTagExample> implements CmsArticleTagService { public class CmsArticleTagServiceMock extends BaseServiceMock<CmsArticleTagMapper, CmsArticleTag, CmsArticleTagExample> implements CmsArticleTagService {

View File

@ -1,13 +0,0 @@
package com.zheng.cms.rpc.api;
import com.zheng.common.base.BaseService;
import com.zheng.cms.dao.model.CmsBook;
import com.zheng.cms.dao.model.CmsBookExample;
/**
* CmsBookService接口
* Created by shuzheng on 2017/3/20.
*/
public interface CmsBookService extends BaseService<CmsBook, CmsBookExample> {
}

View File

@ -1,14 +0,0 @@
package com.zheng.cms.rpc.api;
import com.zheng.common.base.BaseServiceMock;
import com.zheng.cms.dao.mapper.CmsBookMapper;
import com.zheng.cms.dao.model.CmsBook;
import com.zheng.cms.dao.model.CmsBookExample;
/**
* 降级实现CmsBookService接口
* Created by shuzheng on 2017/3/20.
*/
public class CmsBookServiceMock extends BaseServiceMock<CmsBookMapper, CmsBook, CmsBookExample> implements CmsBookService {
}

View File

@ -6,7 +6,7 @@ import com.zheng.cms.dao.model.CmsCategoryExample;
/** /**
* CmsCategoryService接口 * CmsCategoryService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public interface CmsCategoryService extends BaseService<CmsCategory, CmsCategoryExample> { public interface CmsCategoryService extends BaseService<CmsCategory, CmsCategoryExample> {

View File

@ -7,7 +7,7 @@ import com.zheng.cms.dao.model.CmsCategoryExample;
/** /**
* 降级实现CmsCategoryService接口 * 降级实现CmsCategoryService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public class CmsCategoryServiceMock extends BaseServiceMock<CmsCategoryMapper, CmsCategory, CmsCategoryExample> implements CmsCategoryService { public class CmsCategoryServiceMock extends BaseServiceMock<CmsCategoryMapper, CmsCategory, CmsCategoryExample> implements CmsCategoryService {

View File

@ -6,7 +6,7 @@ import com.zheng.cms.dao.model.CmsCategoryTagExample;
/** /**
* CmsCategoryTagService接口 * CmsCategoryTagService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public interface CmsCategoryTagService extends BaseService<CmsCategoryTag, CmsCategoryTagExample> { public interface CmsCategoryTagService extends BaseService<CmsCategoryTag, CmsCategoryTagExample> {

View File

@ -7,7 +7,7 @@ import com.zheng.cms.dao.model.CmsCategoryTagExample;
/** /**
* 降级实现CmsCategoryTagService接口 * 降级实现CmsCategoryTagService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public class CmsCategoryTagServiceMock extends BaseServiceMock<CmsCategoryTagMapper, CmsCategoryTag, CmsCategoryTagExample> implements CmsCategoryTagService { public class CmsCategoryTagServiceMock extends BaseServiceMock<CmsCategoryTagMapper, CmsCategoryTag, CmsCategoryTagExample> implements CmsCategoryTagService {

View File

@ -6,7 +6,7 @@ import com.zheng.cms.dao.model.CmsCommentExample;
/** /**
* CmsCommentService接口 * CmsCommentService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public interface CmsCommentService extends BaseService<CmsComment, CmsCommentExample> { public interface CmsCommentService extends BaseService<CmsComment, CmsCommentExample> {

View File

@ -7,7 +7,7 @@ import com.zheng.cms.dao.model.CmsCommentExample;
/** /**
* 降级实现CmsCommentService接口 * 降级实现CmsCommentService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public class CmsCommentServiceMock extends BaseServiceMock<CmsCommentMapper, CmsComment, CmsCommentExample> implements CmsCommentService { public class CmsCommentServiceMock extends BaseServiceMock<CmsCommentMapper, CmsComment, CmsCommentExample> implements CmsCommentService {

View File

@ -6,7 +6,7 @@ import com.zheng.cms.dao.model.CmsMenuExample;
/** /**
* CmsMenuService接口 * CmsMenuService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public interface CmsMenuService extends BaseService<CmsMenu, CmsMenuExample> { public interface CmsMenuService extends BaseService<CmsMenu, CmsMenuExample> {

View File

@ -7,7 +7,7 @@ import com.zheng.cms.dao.model.CmsMenuExample;
/** /**
* 降级实现CmsMenuService接口 * 降级实现CmsMenuService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public class CmsMenuServiceMock extends BaseServiceMock<CmsMenuMapper, CmsMenu, CmsMenuExample> implements CmsMenuService { public class CmsMenuServiceMock extends BaseServiceMock<CmsMenuMapper, CmsMenu, CmsMenuExample> implements CmsMenuService {

View File

@ -6,7 +6,7 @@ import com.zheng.cms.dao.model.CmsPageExample;
/** /**
* CmsPageService接口 * CmsPageService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public interface CmsPageService extends BaseService<CmsPage, CmsPageExample> { public interface CmsPageService extends BaseService<CmsPage, CmsPageExample> {

View File

@ -7,7 +7,7 @@ import com.zheng.cms.dao.model.CmsPageExample;
/** /**
* 降级实现CmsPageService接口 * 降级实现CmsPageService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public class CmsPageServiceMock extends BaseServiceMock<CmsPageMapper, CmsPage, CmsPageExample> implements CmsPageService { public class CmsPageServiceMock extends BaseServiceMock<CmsPageMapper, CmsPage, CmsPageExample> implements CmsPageService {

View File

@ -6,7 +6,7 @@ import com.zheng.cms.dao.model.CmsSettingExample;
/** /**
* CmsSettingService接口 * CmsSettingService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public interface CmsSettingService extends BaseService<CmsSetting, CmsSettingExample> { public interface CmsSettingService extends BaseService<CmsSetting, CmsSettingExample> {

View File

@ -7,7 +7,7 @@ import com.zheng.cms.dao.model.CmsSettingExample;
/** /**
* 降级实现CmsSettingService接口 * 降级实现CmsSettingService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public class CmsSettingServiceMock extends BaseServiceMock<CmsSettingMapper, CmsSetting, CmsSettingExample> implements CmsSettingService { public class CmsSettingServiceMock extends BaseServiceMock<CmsSettingMapper, CmsSetting, CmsSettingExample> implements CmsSettingService {

View File

@ -0,0 +1,13 @@
package com.zheng.cms.rpc.api;
import com.zheng.common.base.BaseService;
import com.zheng.cms.dao.model.CmsSystem;
import com.zheng.cms.dao.model.CmsSystemExample;
/**
* CmsSystemService接口
* Created by shuzheng on 2017/4/5.
*/
public interface CmsSystemService extends BaseService<CmsSystem, CmsSystemExample> {
}

View File

@ -0,0 +1,14 @@
package com.zheng.cms.rpc.api;
import com.zheng.common.base.BaseServiceMock;
import com.zheng.cms.dao.mapper.CmsSystemMapper;
import com.zheng.cms.dao.model.CmsSystem;
import com.zheng.cms.dao.model.CmsSystemExample;
/**
* 降级实现CmsSystemService接口
* Created by shuzheng on 2017/4/5.
*/
public class CmsSystemServiceMock extends BaseServiceMock<CmsSystemMapper, CmsSystem, CmsSystemExample> implements CmsSystemService {
}

View File

@ -6,7 +6,7 @@ import com.zheng.cms.dao.model.CmsTagExample;
/** /**
* CmsTagService接口 * CmsTagService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public interface CmsTagService extends BaseService<CmsTag, CmsTagExample> { public interface CmsTagService extends BaseService<CmsTag, CmsTagExample> {

View File

@ -7,7 +7,7 @@ import com.zheng.cms.dao.model.CmsTagExample;
/** /**
* 降级实现CmsTagService接口 * 降级实现CmsTagService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public class CmsTagServiceMock extends BaseServiceMock<CmsTagMapper, CmsTag, CmsTagExample> implements CmsTagService { public class CmsTagServiceMock extends BaseServiceMock<CmsTagMapper, CmsTag, CmsTagExample> implements CmsTagService {

View File

@ -6,7 +6,7 @@ import com.zheng.cms.dao.model.CmsTopicExample;
/** /**
* CmsTopicService接口 * CmsTopicService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public interface CmsTopicService extends BaseService<CmsTopic, CmsTopicExample> { public interface CmsTopicService extends BaseService<CmsTopic, CmsTopicExample> {

View File

@ -7,7 +7,7 @@ import com.zheng.cms.dao.model.CmsTopicExample;
/** /**
* 降级实现CmsTopicService接口 * 降级实现CmsTopicService接口
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
public class CmsTopicServiceMock extends BaseServiceMock<CmsTopicMapper, CmsTopic, CmsTopicExample> implements CmsTopicService { public class CmsTopicServiceMock extends BaseServiceMock<CmsTopicMapper, CmsTopic, CmsTopicExample> implements CmsTopicService {

View File

@ -1,13 +0,0 @@
package com.zheng.cms.rpc.api;
import com.zheng.common.base.BaseService;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.dao.model.CmsUserExample;
/**
* CmsUserService接口
* Created by shuzheng on 2017/3/20.
*/
public interface CmsUserService extends BaseService<CmsUser, CmsUserExample> {
}

View File

@ -1,14 +0,0 @@
package com.zheng.cms.rpc.api;
import com.zheng.common.base.BaseServiceMock;
import com.zheng.cms.dao.mapper.CmsUserMapper;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.dao.model.CmsUserExample;
/**
* 降级实现CmsUserService接口
* Created by shuzheng on 2017/3/20.
*/
public class CmsUserServiceMock extends BaseServiceMock<CmsUserMapper, CmsUser, CmsUserExample> implements CmsUserService {
}

View File

@ -1,21 +0,0 @@
package com.zheng.cms.rpc.api;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.dao.model.CmsUserExample;
import com.zheng.cms.dao.model.UserVO;
import com.zheng.common.base.BaseService;
/**
* 用户service接口
* Created by shuzheng on 2016/11/14.
*/
public interface UserService extends BaseService<CmsUser, CmsUserExample> {
/**
* 获取带book数据的用户
* @param id
* @return
*/
UserVO selectUserWithBook(int id);
}

View File

@ -1,20 +0,0 @@
package com.zheng.cms.rpc.api;
import com.zheng.cms.dao.mapper.CmsUserMapper;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.dao.model.CmsUserExample;
import com.zheng.cms.dao.model.UserVO;
import com.zheng.common.base.BaseServiceMock;
/**
* 降级实现UserService接口
* Created by shuzheng on 2017/2/14.
*/
public class UserServiceMock extends BaseServiceMock<CmsUserMapper, CmsUser, CmsUserExample> implements UserService {
@Override
public UserVO selectUserWithBook(int id) {
return null;
}
}

View File

@ -15,6 +15,8 @@
<result column="status" jdbcType="TINYINT" property="status" /> <result column="status" jdbcType="TINYINT" property="status" />
<result column="user_id" jdbcType="INTEGER" property="userId" /> <result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="readnumber" jdbcType="INTEGER" property="readnumber" /> <result column="readnumber" jdbcType="INTEGER" property="readnumber" />
<result column="top" jdbcType="INTEGER" property="top" />
<result column="system_id" jdbcType="INTEGER" property="systemId" />
<result column="ctime" jdbcType="BIGINT" property="ctime" /> <result column="ctime" jdbcType="BIGINT" property="ctime" />
<result column="orders" jdbcType="BIGINT" property="orders" /> <result column="orders" jdbcType="BIGINT" property="orders" />
</resultMap> </resultMap>
@ -81,7 +83,7 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
article_id, topic_id, title, author, fromurl, image, keywords, description, type, article_id, topic_id, title, author, fromurl, image, keywords, description, type,
allowcomments, status, user_id, readnumber, ctime, orders allowcomments, status, user_id, readnumber, top, system_id, ctime, orders
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
content content
@ -147,14 +149,16 @@
author, fromurl, image, author, fromurl, image,
keywords, description, type, keywords, description, type,
allowcomments, status, user_id, allowcomments, status, user_id,
readnumber, ctime, orders, readnumber, top, system_id,
content) ctime, orders, content
)
values (#{articleId,jdbcType=INTEGER}, #{topicId,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, values (#{articleId,jdbcType=INTEGER}, #{topicId,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR},
#{author,jdbcType=VARCHAR}, #{fromurl,jdbcType=VARCHAR}, #{image,jdbcType=VARCHAR}, #{author,jdbcType=VARCHAR}, #{fromurl,jdbcType=VARCHAR}, #{image,jdbcType=VARCHAR},
#{keywords,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, #{keywords,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT},
#{allowcomments,jdbcType=TINYINT}, #{status,jdbcType=TINYINT}, #{userId,jdbcType=INTEGER}, #{allowcomments,jdbcType=TINYINT}, #{status,jdbcType=TINYINT}, #{userId,jdbcType=INTEGER},
#{readnumber,jdbcType=INTEGER}, #{ctime,jdbcType=BIGINT}, #{orders,jdbcType=BIGINT}, #{readnumber,jdbcType=INTEGER}, #{top,jdbcType=INTEGER}, #{systemId,jdbcType=INTEGER},
#{content,jdbcType=LONGVARCHAR}) #{ctime,jdbcType=BIGINT}, #{orders,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR}
)
</insert> </insert>
<insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsArticle"> <insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsArticle">
insert into cms_article insert into cms_article
@ -198,6 +202,12 @@
<if test="readnumber != null"> <if test="readnumber != null">
readnumber, readnumber,
</if> </if>
<if test="top != null">
top,
</if>
<if test="systemId != null">
system_id,
</if>
<if test="ctime != null"> <if test="ctime != null">
ctime, ctime,
</if> </if>
@ -248,6 +258,12 @@
<if test="readnumber != null"> <if test="readnumber != null">
#{readnumber,jdbcType=INTEGER}, #{readnumber,jdbcType=INTEGER},
</if> </if>
<if test="top != null">
#{top,jdbcType=INTEGER},
</if>
<if test="systemId != null">
#{systemId,jdbcType=INTEGER},
</if>
<if test="ctime != null"> <if test="ctime != null">
#{ctime,jdbcType=BIGINT}, #{ctime,jdbcType=BIGINT},
</if> </if>
@ -307,6 +323,12 @@
<if test="record.readnumber != null"> <if test="record.readnumber != null">
readnumber = #{record.readnumber,jdbcType=INTEGER}, readnumber = #{record.readnumber,jdbcType=INTEGER},
</if> </if>
<if test="record.top != null">
top = #{record.top,jdbcType=INTEGER},
</if>
<if test="record.systemId != null">
system_id = #{record.systemId,jdbcType=INTEGER},
</if>
<if test="record.ctime != null"> <if test="record.ctime != null">
ctime = #{record.ctime,jdbcType=BIGINT}, ctime = #{record.ctime,jdbcType=BIGINT},
</if> </if>
@ -336,6 +358,8 @@
status = #{record.status,jdbcType=TINYINT}, status = #{record.status,jdbcType=TINYINT},
user_id = #{record.userId,jdbcType=INTEGER}, user_id = #{record.userId,jdbcType=INTEGER},
readnumber = #{record.readnumber,jdbcType=INTEGER}, readnumber = #{record.readnumber,jdbcType=INTEGER},
top = #{record.top,jdbcType=INTEGER},
system_id = #{record.systemId,jdbcType=INTEGER},
ctime = #{record.ctime,jdbcType=BIGINT}, ctime = #{record.ctime,jdbcType=BIGINT},
orders = #{record.orders,jdbcType=BIGINT}, orders = #{record.orders,jdbcType=BIGINT},
content = #{record.content,jdbcType=LONGVARCHAR} content = #{record.content,jdbcType=LONGVARCHAR}
@ -358,6 +382,8 @@
status = #{record.status,jdbcType=TINYINT}, status = #{record.status,jdbcType=TINYINT},
user_id = #{record.userId,jdbcType=INTEGER}, user_id = #{record.userId,jdbcType=INTEGER},
readnumber = #{record.readnumber,jdbcType=INTEGER}, readnumber = #{record.readnumber,jdbcType=INTEGER},
top = #{record.top,jdbcType=INTEGER},
system_id = #{record.systemId,jdbcType=INTEGER},
ctime = #{record.ctime,jdbcType=BIGINT}, ctime = #{record.ctime,jdbcType=BIGINT},
orders = #{record.orders,jdbcType=BIGINT} orders = #{record.orders,jdbcType=BIGINT}
<if test="_parameter != null"> <if test="_parameter != null">
@ -403,6 +429,12 @@
<if test="readnumber != null"> <if test="readnumber != null">
readnumber = #{readnumber,jdbcType=INTEGER}, readnumber = #{readnumber,jdbcType=INTEGER},
</if> </if>
<if test="top != null">
top = #{top,jdbcType=INTEGER},
</if>
<if test="systemId != null">
system_id = #{systemId,jdbcType=INTEGER},
</if>
<if test="ctime != null"> <if test="ctime != null">
ctime = #{ctime,jdbcType=BIGINT}, ctime = #{ctime,jdbcType=BIGINT},
</if> </if>
@ -429,6 +461,8 @@
status = #{status,jdbcType=TINYINT}, status = #{status,jdbcType=TINYINT},
user_id = #{userId,jdbcType=INTEGER}, user_id = #{userId,jdbcType=INTEGER},
readnumber = #{readnumber,jdbcType=INTEGER}, readnumber = #{readnumber,jdbcType=INTEGER},
top = #{top,jdbcType=INTEGER},
system_id = #{systemId,jdbcType=INTEGER},
ctime = #{ctime,jdbcType=BIGINT}, ctime = #{ctime,jdbcType=BIGINT},
orders = #{orders,jdbcType=BIGINT}, orders = #{orders,jdbcType=BIGINT},
content = #{content,jdbcType=LONGVARCHAR} content = #{content,jdbcType=LONGVARCHAR}
@ -448,6 +482,8 @@
status = #{status,jdbcType=TINYINT}, status = #{status,jdbcType=TINYINT},
user_id = #{userId,jdbcType=INTEGER}, user_id = #{userId,jdbcType=INTEGER},
readnumber = #{readnumber,jdbcType=INTEGER}, readnumber = #{readnumber,jdbcType=INTEGER},
top = #{top,jdbcType=INTEGER},
system_id = #{systemId,jdbcType=INTEGER},
ctime = #{ctime,jdbcType=BIGINT}, ctime = #{ctime,jdbcType=BIGINT},
orders = #{orders,jdbcType=BIGINT} orders = #{orders,jdbcType=BIGINT}
where article_id = #{articleId,jdbcType=INTEGER} where article_id = #{articleId,jdbcType=INTEGER}

View File

@ -10,6 +10,7 @@
<result column="icon" jdbcType="VARCHAR" property="icon" /> <result column="icon" jdbcType="VARCHAR" property="icon" />
<result column="type" jdbcType="TINYINT" property="type" /> <result column="type" jdbcType="TINYINT" property="type" />
<result column="alias" jdbcType="VARCHAR" property="alias" /> <result column="alias" jdbcType="VARCHAR" property="alias" />
<result column="system_id" jdbcType="INTEGER" property="systemId" />
<result column="ctime" jdbcType="BIGINT" property="ctime" /> <result column="ctime" jdbcType="BIGINT" property="ctime" />
<result column="orders" jdbcType="BIGINT" property="orders" /> <result column="orders" jdbcType="BIGINT" property="orders" />
</resultMap> </resultMap>
@ -72,7 +73,8 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
category_id, pid, level, name, description, icon, type, alias, ctime, orders category_id, pid, level, name, description, icon, type, alias, system_id, ctime,
orders
</sql> </sql>
<select id="selectByExample" parameterType="com.zheng.cms.dao.model.CmsCategoryExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.zheng.cms.dao.model.CmsCategoryExample" resultMap="BaseResultMap">
select select
@ -115,12 +117,12 @@
<insert id="insert" parameterType="com.zheng.cms.dao.model.CmsCategory"> <insert id="insert" parameterType="com.zheng.cms.dao.model.CmsCategory">
insert into cms_category (category_id, pid, level, insert into cms_category (category_id, pid, level,
name, description, icon, name, description, icon,
type, alias, ctime, type, alias, system_id,
orders) ctime, orders)
values (#{categoryId,jdbcType=INTEGER}, #{pid,jdbcType=INTEGER}, #{level,jdbcType=TINYINT}, values (#{categoryId,jdbcType=INTEGER}, #{pid,jdbcType=INTEGER}, #{level,jdbcType=TINYINT},
#{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR},
#{type,jdbcType=TINYINT}, #{alias,jdbcType=VARCHAR}, #{ctime,jdbcType=BIGINT}, #{type,jdbcType=TINYINT}, #{alias,jdbcType=VARCHAR}, #{systemId,jdbcType=INTEGER},
#{orders,jdbcType=BIGINT}) #{ctime,jdbcType=BIGINT}, #{orders,jdbcType=BIGINT})
</insert> </insert>
<insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsCategory"> <insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsCategory">
insert into cms_category insert into cms_category
@ -149,6 +151,9 @@
<if test="alias != null"> <if test="alias != null">
alias, alias,
</if> </if>
<if test="systemId != null">
system_id,
</if>
<if test="ctime != null"> <if test="ctime != null">
ctime, ctime,
</if> </if>
@ -181,6 +186,9 @@
<if test="alias != null"> <if test="alias != null">
#{alias,jdbcType=VARCHAR}, #{alias,jdbcType=VARCHAR},
</if> </if>
<if test="systemId != null">
#{systemId,jdbcType=INTEGER},
</if>
<if test="ctime != null"> <if test="ctime != null">
#{ctime,jdbcType=BIGINT}, #{ctime,jdbcType=BIGINT},
</if> </if>
@ -222,6 +230,9 @@
<if test="record.alias != null"> <if test="record.alias != null">
alias = #{record.alias,jdbcType=VARCHAR}, alias = #{record.alias,jdbcType=VARCHAR},
</if> </if>
<if test="record.systemId != null">
system_id = #{record.systemId,jdbcType=INTEGER},
</if>
<if test="record.ctime != null"> <if test="record.ctime != null">
ctime = #{record.ctime,jdbcType=BIGINT}, ctime = #{record.ctime,jdbcType=BIGINT},
</if> </if>
@ -243,6 +254,7 @@
icon = #{record.icon,jdbcType=VARCHAR}, icon = #{record.icon,jdbcType=VARCHAR},
type = #{record.type,jdbcType=TINYINT}, type = #{record.type,jdbcType=TINYINT},
alias = #{record.alias,jdbcType=VARCHAR}, alias = #{record.alias,jdbcType=VARCHAR},
system_id = #{record.systemId,jdbcType=INTEGER},
ctime = #{record.ctime,jdbcType=BIGINT}, ctime = #{record.ctime,jdbcType=BIGINT},
orders = #{record.orders,jdbcType=BIGINT} orders = #{record.orders,jdbcType=BIGINT}
<if test="_parameter != null"> <if test="_parameter != null">
@ -273,6 +285,9 @@
<if test="alias != null"> <if test="alias != null">
alias = #{alias,jdbcType=VARCHAR}, alias = #{alias,jdbcType=VARCHAR},
</if> </if>
<if test="systemId != null">
system_id = #{systemId,jdbcType=INTEGER},
</if>
<if test="ctime != null"> <if test="ctime != null">
ctime = #{ctime,jdbcType=BIGINT}, ctime = #{ctime,jdbcType=BIGINT},
</if> </if>
@ -291,6 +306,7 @@
icon = #{icon,jdbcType=VARCHAR}, icon = #{icon,jdbcType=VARCHAR},
type = #{type,jdbcType=TINYINT}, type = #{type,jdbcType=TINYINT},
alias = #{alias,jdbcType=VARCHAR}, alias = #{alias,jdbcType=VARCHAR},
system_id = #{systemId,jdbcType=INTEGER},
ctime = #{ctime,jdbcType=BIGINT}, ctime = #{ctime,jdbcType=BIGINT},
orders = #{orders,jdbcType=BIGINT} orders = #{orders,jdbcType=BIGINT}
where category_id = #{categoryId,jdbcType=INTEGER} where category_id = #{categoryId,jdbcType=INTEGER}

View File

@ -9,6 +9,7 @@
<result column="status" jdbcType="TINYINT" property="status" /> <result column="status" jdbcType="TINYINT" property="status" />
<result column="ip" jdbcType="VARCHAR" property="ip" /> <result column="ip" jdbcType="VARCHAR" property="ip" />
<result column="agent" jdbcType="VARCHAR" property="agent" /> <result column="agent" jdbcType="VARCHAR" property="agent" />
<result column="system_id" jdbcType="INTEGER" property="systemId" />
<result column="ctime" jdbcType="BIGINT" property="ctime" /> <result column="ctime" jdbcType="BIGINT" property="ctime" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.zheng.cms.dao.model.CmsComment"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.zheng.cms.dao.model.CmsComment">
@ -73,7 +74,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
comment_id, pid, article_id, user_id, status, ip, agent, ctime comment_id, pid, article_id, user_id, status, ip, agent, system_id, ctime
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
content content
@ -137,12 +138,12 @@
<insert id="insert" parameterType="com.zheng.cms.dao.model.CmsComment"> <insert id="insert" parameterType="com.zheng.cms.dao.model.CmsComment">
insert into cms_comment (comment_id, pid, article_id, insert into cms_comment (comment_id, pid, article_id,
user_id, status, ip, user_id, status, ip,
agent, ctime, content agent, system_id, ctime,
) content)
values (#{commentId,jdbcType=INTEGER}, #{pid,jdbcType=INTEGER}, #{articleId,jdbcType=INTEGER}, values (#{commentId,jdbcType=INTEGER}, #{pid,jdbcType=INTEGER}, #{articleId,jdbcType=INTEGER},
#{userId,jdbcType=INTEGER}, #{status,jdbcType=TINYINT}, #{ip,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER}, #{status,jdbcType=TINYINT}, #{ip,jdbcType=VARCHAR},
#{agent,jdbcType=VARCHAR}, #{ctime,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR} #{agent,jdbcType=VARCHAR}, #{systemId,jdbcType=INTEGER}, #{ctime,jdbcType=BIGINT},
) #{content,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsComment"> <insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsComment">
insert into cms_comment insert into cms_comment
@ -168,6 +169,9 @@
<if test="agent != null"> <if test="agent != null">
agent, agent,
</if> </if>
<if test="systemId != null">
system_id,
</if>
<if test="ctime != null"> <if test="ctime != null">
ctime, ctime,
</if> </if>
@ -197,6 +201,9 @@
<if test="agent != null"> <if test="agent != null">
#{agent,jdbcType=VARCHAR}, #{agent,jdbcType=VARCHAR},
</if> </if>
<if test="systemId != null">
#{systemId,jdbcType=INTEGER},
</if>
<if test="ctime != null"> <if test="ctime != null">
#{ctime,jdbcType=BIGINT}, #{ctime,jdbcType=BIGINT},
</if> </if>
@ -235,6 +242,9 @@
<if test="record.agent != null"> <if test="record.agent != null">
agent = #{record.agent,jdbcType=VARCHAR}, agent = #{record.agent,jdbcType=VARCHAR},
</if> </if>
<if test="record.systemId != null">
system_id = #{record.systemId,jdbcType=INTEGER},
</if>
<if test="record.ctime != null"> <if test="record.ctime != null">
ctime = #{record.ctime,jdbcType=BIGINT}, ctime = #{record.ctime,jdbcType=BIGINT},
</if> </if>
@ -255,6 +265,7 @@
status = #{record.status,jdbcType=TINYINT}, status = #{record.status,jdbcType=TINYINT},
ip = #{record.ip,jdbcType=VARCHAR}, ip = #{record.ip,jdbcType=VARCHAR},
agent = #{record.agent,jdbcType=VARCHAR}, agent = #{record.agent,jdbcType=VARCHAR},
system_id = #{record.systemId,jdbcType=INTEGER},
ctime = #{record.ctime,jdbcType=BIGINT}, ctime = #{record.ctime,jdbcType=BIGINT},
content = #{record.content,jdbcType=LONGVARCHAR} content = #{record.content,jdbcType=LONGVARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
@ -270,6 +281,7 @@
status = #{record.status,jdbcType=TINYINT}, status = #{record.status,jdbcType=TINYINT},
ip = #{record.ip,jdbcType=VARCHAR}, ip = #{record.ip,jdbcType=VARCHAR},
agent = #{record.agent,jdbcType=VARCHAR}, agent = #{record.agent,jdbcType=VARCHAR},
system_id = #{record.systemId,jdbcType=INTEGER},
ctime = #{record.ctime,jdbcType=BIGINT} ctime = #{record.ctime,jdbcType=BIGINT}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -296,6 +308,9 @@
<if test="agent != null"> <if test="agent != null">
agent = #{agent,jdbcType=VARCHAR}, agent = #{agent,jdbcType=VARCHAR},
</if> </if>
<if test="systemId != null">
system_id = #{systemId,jdbcType=INTEGER},
</if>
<if test="ctime != null"> <if test="ctime != null">
ctime = #{ctime,jdbcType=BIGINT}, ctime = #{ctime,jdbcType=BIGINT},
</if> </if>
@ -313,6 +328,7 @@
status = #{status,jdbcType=TINYINT}, status = #{status,jdbcType=TINYINT},
ip = #{ip,jdbcType=VARCHAR}, ip = #{ip,jdbcType=VARCHAR},
agent = #{agent,jdbcType=VARCHAR}, agent = #{agent,jdbcType=VARCHAR},
system_id = #{systemId,jdbcType=INTEGER},
ctime = #{ctime,jdbcType=BIGINT}, ctime = #{ctime,jdbcType=BIGINT},
content = #{content,jdbcType=LONGVARCHAR} content = #{content,jdbcType=LONGVARCHAR}
where comment_id = #{commentId,jdbcType=INTEGER} where comment_id = #{commentId,jdbcType=INTEGER}
@ -325,6 +341,7 @@
status = #{status,jdbcType=TINYINT}, status = #{status,jdbcType=TINYINT},
ip = #{ip,jdbcType=VARCHAR}, ip = #{ip,jdbcType=VARCHAR},
agent = #{agent,jdbcType=VARCHAR}, agent = #{agent,jdbcType=VARCHAR},
system_id = #{systemId,jdbcType=INTEGER},
ctime = #{ctime,jdbcType=BIGINT} ctime = #{ctime,jdbcType=BIGINT}
where comment_id = #{commentId,jdbcType=INTEGER} where comment_id = #{commentId,jdbcType=INTEGER}
</update> </update>

View File

@ -1,10 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zheng.cms.dao.mapper.CmsBookMapper"> <mapper namespace="com.zheng.cms.dao.mapper.CmsSystemMapper">
<resultMap id="BaseResultMap" type="com.zheng.cms.dao.model.CmsBook"> <resultMap id="BaseResultMap" type="com.zheng.cms.dao.model.CmsSystem">
<id column="book_id" jdbcType="INTEGER" property="bookId" /> <id column="system_id" jdbcType="INTEGER" property="systemId" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="name" jdbcType="VARCHAR" property="name" /> <result column="name" jdbcType="VARCHAR" property="name" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="ctime" jdbcType="BIGINT" property="ctime" />
<result column="orders" jdbcType="BIGINT" property="orders" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -65,15 +68,15 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
book_id, user_id, name system_id, name, code, description, ctime, orders
</sql> </sql>
<select id="selectByExample" parameterType="com.zheng.cms.dao.model.CmsBookExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.zheng.cms.dao.model.CmsSystemExample" resultMap="BaseResultMap">
select select
<if test="distinct"> <if test="distinct">
distinct distinct
</if> </if>
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from cms_book from cms_system
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@ -92,99 +95,143 @@
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from cms_book from cms_system
where book_id = #{bookId,jdbcType=INTEGER} where system_id = #{systemId,jdbcType=INTEGER}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from cms_book delete from cms_system
where book_id = #{bookId,jdbcType=INTEGER} where system_id = #{systemId,jdbcType=INTEGER}
</delete> </delete>
<delete id="deleteByExample" parameterType="com.zheng.cms.dao.model.CmsBookExample"> <delete id="deleteByExample" parameterType="com.zheng.cms.dao.model.CmsSystemExample">
delete from cms_book delete from cms_system
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.zheng.cms.dao.model.CmsBook"> <insert id="insert" parameterType="com.zheng.cms.dao.model.CmsSystem">
insert into cms_book (book_id, user_id, name insert into cms_system (system_id, name, code,
description, ctime, orders
) )
values (#{bookId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR} values (#{systemId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{ctime,jdbcType=BIGINT}, #{orders,jdbcType=BIGINT}
) )
</insert> </insert>
<insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsBook"> <insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsSystem">
insert into cms_book insert into cms_system
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="bookId != null"> <if test="systemId != null">
book_id, system_id,
</if>
<if test="userId != null">
user_id,
</if> </if>
<if test="name != null"> <if test="name != null">
name, name,
</if> </if>
<if test="code != null">
code,
</if>
<if test="description != null">
description,
</if>
<if test="ctime != null">
ctime,
</if>
<if test="orders != null">
orders,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="bookId != null"> <if test="systemId != null">
#{bookId,jdbcType=INTEGER}, #{systemId,jdbcType=INTEGER},
</if>
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if> </if>
<if test="name != null"> <if test="name != null">
#{name,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
</if> </if>
<if test="code != null">
#{code,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="ctime != null">
#{ctime,jdbcType=BIGINT},
</if>
<if test="orders != null">
#{orders,jdbcType=BIGINT},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.zheng.cms.dao.model.CmsBookExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.zheng.cms.dao.model.CmsSystemExample" resultType="java.lang.Long">
select count(*) from cms_book select count(*) from cms_system
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
</select> </select>
<update id="updateByExampleSelective" parameterType="map"> <update id="updateByExampleSelective" parameterType="map">
update cms_book update cms_system
<set> <set>
<if test="record.bookId != null"> <if test="record.systemId != null">
book_id = #{record.bookId,jdbcType=INTEGER}, system_id = #{record.systemId,jdbcType=INTEGER},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=INTEGER},
</if> </if>
<if test="record.name != null"> <if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR},
</if> </if>
<if test="record.code != null">
code = #{record.code,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.ctime != null">
ctime = #{record.ctime,jdbcType=BIGINT},
</if>
<if test="record.orders != null">
orders = #{record.orders,jdbcType=BIGINT},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
</update> </update>
<update id="updateByExample" parameterType="map"> <update id="updateByExample" parameterType="map">
update cms_book update cms_system
set book_id = #{record.bookId,jdbcType=INTEGER}, set system_id = #{record.systemId,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=INTEGER}, name = #{record.name,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR} code = #{record.code,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
ctime = #{record.ctime,jdbcType=BIGINT},
orders = #{record.orders,jdbcType=BIGINT}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
</update> </update>
<update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.dao.model.CmsBook"> <update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.dao.model.CmsSystem">
update cms_book update cms_system
<set> <set>
<if test="userId != null">
user_id = #{userId,jdbcType=INTEGER},
</if>
<if test="name != null"> <if test="name != null">
name = #{name,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR},
</if> </if>
<if test="code != null">
code = #{code,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="ctime != null">
ctime = #{ctime,jdbcType=BIGINT},
</if>
<if test="orders != null">
orders = #{orders,jdbcType=BIGINT},
</if>
</set> </set>
where book_id = #{bookId,jdbcType=INTEGER} where system_id = #{systemId,jdbcType=INTEGER}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.zheng.cms.dao.model.CmsBook"> <update id="updateByPrimaryKey" parameterType="com.zheng.cms.dao.model.CmsSystem">
update cms_book update cms_system
set user_id = #{userId,jdbcType=INTEGER}, set name = #{name,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR} code = #{code,jdbcType=VARCHAR},
where book_id = #{bookId,jdbcType=INTEGER} description = #{description,jdbcType=VARCHAR},
ctime = #{ctime,jdbcType=BIGINT},
orders = #{orders,jdbcType=BIGINT}
where system_id = #{systemId,jdbcType=INTEGER}
</update> </update>
<cache type="org.mybatis.caches.ehcache.LoggingEhcache" /> <cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
</mapper> </mapper>

View File

@ -8,6 +8,7 @@
<result column="icon" jdbcType="VARCHAR" property="icon" /> <result column="icon" jdbcType="VARCHAR" property="icon" />
<result column="type" jdbcType="TINYINT" property="type" /> <result column="type" jdbcType="TINYINT" property="type" />
<result column="alias" jdbcType="VARCHAR" property="alias" /> <result column="alias" jdbcType="VARCHAR" property="alias" />
<result column="system_id" jdbcType="INTEGER" property="systemId" />
<result column="ctime" jdbcType="BIGINT" property="ctime" /> <result column="ctime" jdbcType="BIGINT" property="ctime" />
<result column="orders" jdbcType="BIGINT" property="orders" /> <result column="orders" jdbcType="BIGINT" property="orders" />
</resultMap> </resultMap>
@ -70,7 +71,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
tag_id, name, description, icon, type, alias, ctime, orders tag_id, name, description, icon, type, alias, system_id, ctime, orders
</sql> </sql>
<select id="selectByExample" parameterType="com.zheng.cms.dao.model.CmsTagExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.zheng.cms.dao.model.CmsTagExample" resultMap="BaseResultMap">
select select
@ -113,10 +114,12 @@
<insert id="insert" parameterType="com.zheng.cms.dao.model.CmsTag"> <insert id="insert" parameterType="com.zheng.cms.dao.model.CmsTag">
insert into cms_tag (tag_id, name, description, insert into cms_tag (tag_id, name, description,
icon, type, alias, icon, type, alias,
ctime, orders) system_id, ctime, orders
)
values (#{tagId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, values (#{tagId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{icon,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, #{alias,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, #{alias,jdbcType=VARCHAR},
#{ctime,jdbcType=BIGINT}, #{orders,jdbcType=BIGINT}) #{systemId,jdbcType=INTEGER}, #{ctime,jdbcType=BIGINT}, #{orders,jdbcType=BIGINT}
)
</insert> </insert>
<insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsTag"> <insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsTag">
insert into cms_tag insert into cms_tag
@ -139,6 +142,9 @@
<if test="alias != null"> <if test="alias != null">
alias, alias,
</if> </if>
<if test="systemId != null">
system_id,
</if>
<if test="ctime != null"> <if test="ctime != null">
ctime, ctime,
</if> </if>
@ -165,6 +171,9 @@
<if test="alias != null"> <if test="alias != null">
#{alias,jdbcType=VARCHAR}, #{alias,jdbcType=VARCHAR},
</if> </if>
<if test="systemId != null">
#{systemId,jdbcType=INTEGER},
</if>
<if test="ctime != null"> <if test="ctime != null">
#{ctime,jdbcType=BIGINT}, #{ctime,jdbcType=BIGINT},
</if> </if>
@ -200,6 +209,9 @@
<if test="record.alias != null"> <if test="record.alias != null">
alias = #{record.alias,jdbcType=VARCHAR}, alias = #{record.alias,jdbcType=VARCHAR},
</if> </if>
<if test="record.systemId != null">
system_id = #{record.systemId,jdbcType=INTEGER},
</if>
<if test="record.ctime != null"> <if test="record.ctime != null">
ctime = #{record.ctime,jdbcType=BIGINT}, ctime = #{record.ctime,jdbcType=BIGINT},
</if> </if>
@ -219,6 +231,7 @@
icon = #{record.icon,jdbcType=VARCHAR}, icon = #{record.icon,jdbcType=VARCHAR},
type = #{record.type,jdbcType=TINYINT}, type = #{record.type,jdbcType=TINYINT},
alias = #{record.alias,jdbcType=VARCHAR}, alias = #{record.alias,jdbcType=VARCHAR},
system_id = #{record.systemId,jdbcType=INTEGER},
ctime = #{record.ctime,jdbcType=BIGINT}, ctime = #{record.ctime,jdbcType=BIGINT},
orders = #{record.orders,jdbcType=BIGINT} orders = #{record.orders,jdbcType=BIGINT}
<if test="_parameter != null"> <if test="_parameter != null">
@ -243,6 +256,9 @@
<if test="alias != null"> <if test="alias != null">
alias = #{alias,jdbcType=VARCHAR}, alias = #{alias,jdbcType=VARCHAR},
</if> </if>
<if test="systemId != null">
system_id = #{systemId,jdbcType=INTEGER},
</if>
<if test="ctime != null"> <if test="ctime != null">
ctime = #{ctime,jdbcType=BIGINT}, ctime = #{ctime,jdbcType=BIGINT},
</if> </if>
@ -259,6 +275,7 @@
icon = #{icon,jdbcType=VARCHAR}, icon = #{icon,jdbcType=VARCHAR},
type = #{type,jdbcType=TINYINT}, type = #{type,jdbcType=TINYINT},
alias = #{alias,jdbcType=VARCHAR}, alias = #{alias,jdbcType=VARCHAR},
system_id = #{systemId,jdbcType=INTEGER},
ctime = #{ctime,jdbcType=BIGINT}, ctime = #{ctime,jdbcType=BIGINT},
orders = #{orders,jdbcType=BIGINT} orders = #{orders,jdbcType=BIGINT}
where tag_id = #{tagId,jdbcType=INTEGER} where tag_id = #{tagId,jdbcType=INTEGER}

View File

@ -1,296 +0,0 @@
<?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.zheng.cms.dao.mapper.CmsUserMapper">
<resultMap id="BaseResultMap" type="com.zheng.cms.dao.model.CmsUser">
<id column="user_id" jdbcType="INTEGER" property="userId" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="nickname" jdbcType="VARCHAR" property="nickname" />
<result column="sex" jdbcType="INTEGER" property="sex" />
<result column="ctime" jdbcType="BIGINT" property="ctime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.zheng.cms.dao.model.CmsUser">
<result column="content" jdbcType="LONGVARCHAR" property="content" />
</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="Update_By_Example_Where_Clause">
<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">
user_id, username, password, nickname, sex, ctime
</sql>
<sql id="Blob_Column_List">
content
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.zheng.cms.dao.model.CmsUserExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from cms_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.zheng.cms.dao.model.CmsUserExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limit != null">
<if test="offset != null">
limit ${offset}, ${limit}
</if>
<if test="offset == null">
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from cms_user
where user_id = #{userId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from cms_user
where user_id = #{userId,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.zheng.cms.dao.model.CmsUserExample">
delete from cms_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.zheng.cms.dao.model.CmsUser">
insert into cms_user (user_id, username, password,
nickname, sex, ctime,
content)
values (#{userId,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{nickname,jdbcType=VARCHAR}, #{sex,jdbcType=INTEGER}, #{ctime,jdbcType=BIGINT},
#{content,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.zheng.cms.dao.model.CmsUser">
insert into cms_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="username != null">
username,
</if>
<if test="password != null">
password,
</if>
<if test="nickname != null">
nickname,
</if>
<if test="sex != null">
sex,
</if>
<if test="ctime != null">
ctime,
</if>
<if test="content != null">
content,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="nickname != null">
#{nickname,jdbcType=VARCHAR},
</if>
<if test="sex != null">
#{sex,jdbcType=INTEGER},
</if>
<if test="ctime != null">
#{ctime,jdbcType=BIGINT},
</if>
<if test="content != null">
#{content,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.zheng.cms.dao.model.CmsUserExample" resultType="java.lang.Long">
select count(*) from cms_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_user
<set>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=INTEGER},
</if>
<if test="record.username != null">
username = #{record.username,jdbcType=VARCHAR},
</if>
<if test="record.password != null">
password = #{record.password,jdbcType=VARCHAR},
</if>
<if test="record.nickname != null">
nickname = #{record.nickname,jdbcType=VARCHAR},
</if>
<if test="record.sex != null">
sex = #{record.sex,jdbcType=INTEGER},
</if>
<if test="record.ctime != null">
ctime = #{record.ctime,jdbcType=BIGINT},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update cms_user
set user_id = #{record.userId,jdbcType=INTEGER},
username = #{record.username,jdbcType=VARCHAR},
password = #{record.password,jdbcType=VARCHAR},
nickname = #{record.nickname,jdbcType=VARCHAR},
sex = #{record.sex,jdbcType=INTEGER},
ctime = #{record.ctime,jdbcType=BIGINT},
content = #{record.content,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update cms_user
set user_id = #{record.userId,jdbcType=INTEGER},
username = #{record.username,jdbcType=VARCHAR},
password = #{record.password,jdbcType=VARCHAR},
nickname = #{record.nickname,jdbcType=VARCHAR},
sex = #{record.sex,jdbcType=INTEGER},
ctime = #{record.ctime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.zheng.cms.dao.model.CmsUser">
update cms_user
<set>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="nickname != null">
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if test="sex != null">
sex = #{sex,jdbcType=INTEGER},
</if>
<if test="ctime != null">
ctime = #{ctime,jdbcType=BIGINT},
</if>
<if test="content != null">
content = #{content,jdbcType=LONGVARCHAR},
</if>
</set>
where user_id = #{userId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.zheng.cms.dao.model.CmsUser">
update cms_user
set username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR},
sex = #{sex,jdbcType=INTEGER},
ctime = #{ctime,jdbcType=BIGINT},
content = #{content,jdbcType=LONGVARCHAR}
where user_id = #{userId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.zheng.cms.dao.model.CmsUser">
update cms_user
set username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR},
sex = #{sex,jdbcType=INTEGER},
ctime = #{ctime,jdbcType=BIGINT}
where user_id = #{userId,jdbcType=INTEGER}
</update>
<cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
</mapper>

View File

@ -1,13 +0,0 @@
package com.zheng.cms.rpc.mapper;
import com.zheng.cms.dao.model.UserVO;
/**
* 用户VOMapper
* Created by shuzheng on 2017/01/07.
*/
public interface UserVOMapper {
UserVO selectUserWithBook(int id);
}

View File

@ -1,39 +0,0 @@
<?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.zheng.cms.rpc.mapper.UserVOMapper">
<!-- 结果映射关系 -->
<resultMap id="UserResultMap" type="com.zheng.cms.dao.model.UserVO">
<id column="u_id" property="id"/>
<result column="username" property="username"/>
<result column="password" property="password"/>
<result column="nickname" property="nickname"/>
<result column="sex" property="sex"/>
<result column="ctime" property="ctime"/>
<result column="content" property="content" />
<collection column="userid" property="books" ofType="com.zheng.cms.dao.model.CmsBook">
<id column="b_id" property="id"/>
<result column="userid" property="userid"/>
<result column="name" property="name"/>
</collection>
</resultMap>
<!-- 查询一对多的所有记录 -->
<select id="selectUserWithBook" resultMap="UserResultMap" parameterType="int">
select
u.id u_id,u.username,u.password,u.nickname,u.sex,u.ctime,u.content,
b.id b_id,b.userid,b.name
from
cms_user u
left join
cms_book b
on
u.id=b.userid
where
u.id=#{id,jdbcType=INTEGER}
</select>
<!-- 缓存 -->
<cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
</mapper>

View File

@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
/** /**
* CmsArticleCategoryService实现 * CmsArticleCategoryService实现
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
@Service @Service
@Transactional @Transactional

View File

@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
/** /**
* CmsArticleService实现 * CmsArticleService实现
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
@Service @Service
@Transactional @Transactional

View File

@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
/** /**
* CmsArticleTagService实现 * CmsArticleTagService实现
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
@Service @Service
@Transactional @Transactional

View File

@ -1,29 +0,0 @@
package com.zheng.cms.rpc.service.impl;
import com.zheng.common.annotation.BaseService;
import com.zheng.common.base.BaseServiceImpl;
import com.zheng.cms.dao.mapper.CmsBookMapper;
import com.zheng.cms.dao.model.CmsBook;
import com.zheng.cms.dao.model.CmsBookExample;
import com.zheng.cms.rpc.api.CmsBookService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* CmsBookService实现
* Created by shuzheng on 2017/3/20.
*/
@Service
@Transactional
@BaseService
public class CmsBookServiceImpl extends BaseServiceImpl<CmsBookMapper, CmsBook, CmsBookExample> implements CmsBookService {
private static Logger _log = LoggerFactory.getLogger(CmsBookServiceImpl.class);
@Autowired
CmsBookMapper cmsBookMapper;
}

View File

@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
/** /**
* CmsCategoryService实现 * CmsCategoryService实现
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
@Service @Service
@Transactional @Transactional

View File

@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
/** /**
* CmsCategoryTagService实现 * CmsCategoryTagService实现
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
@Service @Service
@Transactional @Transactional

View File

@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
/** /**
* CmsCommentService实现 * CmsCommentService实现
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
@Service @Service
@Transactional @Transactional

View File

@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
/** /**
* CmsMenuService实现 * CmsMenuService实现
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
@Service @Service
@Transactional @Transactional

View File

@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
/** /**
* CmsPageService实现 * CmsPageService实现
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
@Service @Service
@Transactional @Transactional

View File

@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
/** /**
* CmsSettingService实现 * CmsSettingService实现
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
@Service @Service
@Transactional @Transactional

View File

@ -0,0 +1,29 @@
package com.zheng.cms.rpc.service.impl;
import com.zheng.common.annotation.BaseService;
import com.zheng.common.base.BaseServiceImpl;
import com.zheng.cms.dao.mapper.CmsSystemMapper;
import com.zheng.cms.dao.model.CmsSystem;
import com.zheng.cms.dao.model.CmsSystemExample;
import com.zheng.cms.rpc.api.CmsSystemService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* CmsSystemService实现
* Created by shuzheng on 2017/4/5.
*/
@Service
@Transactional
@BaseService
public class CmsSystemServiceImpl extends BaseServiceImpl<CmsSystemMapper, CmsSystem, CmsSystemExample> implements CmsSystemService {
private static Logger _log = LoggerFactory.getLogger(CmsSystemServiceImpl.class);
@Autowired
CmsSystemMapper cmsSystemMapper;
}

View File

@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
/** /**
* CmsTagService实现 * CmsTagService实现
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
@Service @Service
@Transactional @Transactional

View File

@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
/** /**
* CmsTopicService实现 * CmsTopicService实现
* Created by shuzheng on 2017/3/20. * Created by shuzheng on 2017/4/5.
*/ */
@Service @Service
@Transactional @Transactional

View File

@ -1,29 +0,0 @@
package com.zheng.cms.rpc.service.impl;
import com.zheng.common.annotation.BaseService;
import com.zheng.common.base.BaseServiceImpl;
import com.zheng.cms.dao.mapper.CmsUserMapper;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.dao.model.CmsUserExample;
import com.zheng.cms.rpc.api.CmsUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* CmsUserService实现
* Created by shuzheng on 2017/3/20.
*/
@Service
@Transactional
@BaseService
public class CmsUserServiceImpl extends BaseServiceImpl<CmsUserMapper, CmsUser, CmsUserExample> implements CmsUserService {
private static Logger _log = LoggerFactory.getLogger(CmsUserServiceImpl.class);
@Autowired
CmsUserMapper cmsUserMapper;
}

View File

@ -1,44 +0,0 @@
package com.zheng.cms.rpc.service.impl;
import com.zheng.cms.dao.mapper.CmsUserMapper;
import com.zheng.cms.rpc.mapper.UserVOMapper;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.dao.model.CmsUserExample;
import com.zheng.cms.dao.model.UserVO;
import com.zheng.cms.rpc.api.UserService;
import com.zheng.common.annotation.BaseService;
import com.zheng.common.base.BaseServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* 用户service实现
* @author shuzheng
* @date 2016年7月6日 下午6:07:58
*/
@Service
@Transactional
@BaseService
public class UserServiceImpl extends BaseServiceImpl<CmsUserMapper, CmsUser, CmsUserExample> implements UserService {
private static Logger _log = LoggerFactory.getLogger(UserServiceImpl.class);
@Autowired
private UserVOMapper userVOMapper;
/**
* 获取带book数据的用户
* @param id
* @return
*/
@Override
@Cacheable(value="zheng-cms-ehcache")
public UserVO selectUserWithBook(int id) {
return userVOMapper.selectUserWithBook(id);
}
}

View File

@ -45,8 +45,4 @@
<bean id="cmsSettingImpl" class="com.zheng.cms.rpc.service.impl.CmsSettingServiceImpl"/> <bean id="cmsSettingImpl" class="com.zheng.cms.rpc.service.impl.CmsSettingServiceImpl"/>
<dubbo:service interface="com.zheng.cms.rpc.api.CmsSettingService" ref="cmsSettingImpl" timeout="10000"/> <dubbo:service interface="com.zheng.cms.rpc.api.CmsSettingService" ref="cmsSettingImpl" timeout="10000"/>
<!-- 用户 -->
<bean id="userServiceImpl" class="com.zheng.cms.rpc.service.impl.UserServiceImpl"/>
<dubbo:service interface="com.zheng.cms.rpc.api.UserService" ref="userServiceImpl" timeout="10000"/>
</beans> </beans>

View File

@ -1,64 +0,0 @@
package com.zheng.cms.web.controller.test;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.common.base.BaseController;
import com.zheng.common.util.JmsUtil;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.jms.Destination;
/**
* 消息队列controller
* @author shuzheng
* @date 2016年11月24日
*/
@Controller
@RequestMapping("/activemq")
public class ActiveMQController extends BaseController {
private static Logger _log = LoggerFactory.getLogger(ActiveMQController.class);
@Autowired
JmsTemplate jmsQueueTemplate;
@Autowired
Destination defaultQueueDestination;
@RequestMapping("/send")
@ResponseBody
public Object send() {
long start = System.currentTimeMillis();
CmsUser user = null;
for (int i = 1; i <= 1000; i ++) {
user = new CmsUser();
user.setUsername(i + "");
user.setPassword("123456");
user.setNickname("昵称");
user.setSex(1);
user.setCtime(System.currentTimeMillis());
user.setContent("用户描述");
// jmsQueueTemplate.convertAndSend(defaultQueueDestination, user);
JmsUtil.sendMessage(jmsQueueTemplate, defaultQueueDestination, JSONObject.fromObject(user).toString());
}
_log.info("发送消息消耗时间" + (System.currentTimeMillis() - start));
return "success";
}
public static void main(String[] args) {
CmsUser user = new CmsUser();
user.setUsername("用户");
user.setPassword("123456");
user.setNickname("昵称");
user.setSex(1);
user.setCtime(System.currentTimeMillis());
user.setContent("用户描述");
System.out.println(JSONObject.fromObject(user).toString());
}
}

View File

@ -1,103 +0,0 @@
package com.zheng.cms.web.controller.test;
import com.zheng.cms.rpc.api.UserService;
import com.zheng.common.base.BaseController;
import com.zheng.common.util.EhCacheUtil;
import com.zheng.common.util.PropertiesFileUtil;
import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Element;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
/**
* 缓存controller
* @author shuzheng
* @date 2016年10月15日
*/
@Controller
@RequestMapping("/ehcache")
public class EhCacheController extends BaseController {
private static Logger _log = LoggerFactory.getLogger(EhCacheController.class);
private final static String EHCACHE_NAME = PropertiesFileUtil.getInstance().get("ehcache");
@Autowired
private UserService userService;
@RequestMapping("/test")
@ResponseBody
public Object test(HttpServletRequest request) {
return System.getProperty("java.io.tmpdir");
}
/**
* 新增缓存记录
* @param request
* @return
*/
@RequestMapping("/add")
@ResponseBody
public Object add(HttpServletRequest request) {
String key = request.getParameter("key");
String value = request.getParameter("value");
EhCacheUtil.put(EHCACHE_NAME, key, value);
return "success";
}
/**
* 删除缓存记录
* @param request
* @return
*/
@RequestMapping("/remove")
@ResponseBody
public Object remove(HttpServletRequest request) {
String key = request.getParameter("key");
EhCacheUtil.remove(EHCACHE_NAME, key);
return "success";
}
/**
* 获取缓存记录
* @param request
* @return
*/
@RequestMapping("/get")
@ResponseBody
public Object get(HttpServletRequest request) {
String key = request.getParameter("key");
Object object = EhCacheUtil.get(EHCACHE_NAME, key);
if (null == object) {
_log.debug("【Ehcache】没有找到key={}的记录!", key);
return "";
}
return object;
}
public static void main(String[] args) {
// EhCache调用
// Create a cache manager
final CacheManager cacheManager = CacheManager.getInstance();
// create the cache called "hello-world"
final Cache cache = cacheManager.getCache("ehcache_common");
// create a key to map the data to
final String key = "key";
// Create a data element
final Element element = new Element(key, "value");
// Put the element into the data store
cache.put(element);
// Retrieve the data element
final Element cacheElement = cache.get(key);
// Print the value
System.out.println(cacheElement.getObjectValue());
}
}

View File

@ -1,142 +0,0 @@
package com.zheng.cms.web.controller.test;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.rpc.api.UserService;
import com.zheng.common.base.BaseController;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
/**
* 示例controller
* @author shuzheng
* @date 2016年7月6日 下午6:16:00
*/
@Controller
@RequestMapping("/hello")
public class HelloController extends BaseController {
private static Logger _log = LoggerFactory.getLogger(HelloController.class);
@Autowired
private UserService userService;
@RequestMapping("/index")
public String index() {
// 视图渲染/WEB-INF/jsp/hello/world.jsp
return "/hello/world";
}
// 方法级别的RequestMapping 限制并缩小了URL路径匹配同类级别的标签协同工作最终确定拦截到的URL由那个方法处理
@RequestMapping("/world")
public String world() {
// 视图渲染/WEB-INF/jsp/hello/world.jsp
return "/hello/world";
}
// 本方法将处理 /hello/view?courseId=123 形式的URL
@RequestMapping(value = "/view", method = RequestMethod.GET)
public String viewCourse(@RequestParam("courseId") Integer courseId, ModelMap modelMap) {
CmsUser user = userService.selectByPrimaryKey(courseId);
modelMap.put("user", user);
return "course_overview";
}
// 本方法将处理 /hello/view2/123 形式的URL
@RequestMapping("/view2/{courseId}")
public String viewCourse2(@PathVariable("courseId") Integer courseId, Map<String, Object> map) {
CmsUser user = userService.selectByPrimaryKey(courseId);
map.put("user", user);
return "course_overview";
}
// 本方法将处理 /hello/view3?courseId=123 形式的URL
@RequestMapping("/view3")
public String viewCourse3(HttpServletRequest request) {
Integer courseId = Integer.valueOf(request.getParameter("courseId"));
CmsUser user = userService.selectByPrimaryKey(courseId);
request.setAttribute("user", user);
return "course_overview";
}
@RequestMapping(value = "/admin", method = RequestMethod.GET, params = "add")
public String createCourse() {
return "course_admin/edit";
}
@RequestMapping(value = "/save", method = RequestMethod.POST)
public String doSave(@ModelAttribute CmsUser user) {
_log.debug("Info of Course:");
_log.debug(ReflectionToStringBuilder.toString(user));
// 在此进行业务操作比如数据库持久化
user.setUserId(123);
return "redirect:view2/" + user.getUserId();
}
@RequestMapping(value = "/upload", method = RequestMethod.GET)
public String showUploadPage(@RequestParam(value = "multi", required = false) Boolean multi) {
if (multi != null && multi) {
return "course_admin/multifile";
}
return "course_admin/file";
}
@RequestMapping(value = "/doUpload", method = RequestMethod.POST)
public String doUploadFile(@RequestParam("file") MultipartFile file) throws IOException {
if (!file.isEmpty()) {
FileUtils.copyInputStreamToFile(file.getInputStream(), new File("c:\\temp\\imooc\\", System.currentTimeMillis() + file.getOriginalFilename()));
}
return "success";
}
@RequestMapping(value = "/doUpload2", method = RequestMethod.POST)
public String doUploadFile2(MultipartHttpServletRequest multiRequest) throws IOException {
Iterator<String> filesNames = multiRequest.getFileNames();
while (filesNames.hasNext()) {
String fileName = filesNames.next();
MultipartFile file = multiRequest.getFile(fileName);
if (!file.isEmpty()) {
FileUtils.copyInputStreamToFile(file.getInputStream(), new File("c:\\temp\\imooc\\", System.currentTimeMillis() + file.getOriginalFilename()));
}
}
return "success";
}
@RequestMapping(value = "/{courseId}", method = RequestMethod.GET)
public @ResponseBody
CmsUser getCourseInJson(@PathVariable Integer courseId) {
return userService.selectByPrimaryKey(courseId);
}
@RequestMapping(value = "/jsontype/{courseId}", method = RequestMethod.GET)
public ResponseEntity<CmsUser> getCourseInJson2(@PathVariable Integer courseId) {
CmsUser user = userService.selectByPrimaryKey(courseId);
return new ResponseEntity<CmsUser>(user, HttpStatus.OK);
}
}

View File

@ -1,83 +0,0 @@
package com.zheng.cms.web.controller.test;
import com.zheng.common.base.BaseController;
import com.zheng.common.util.RedisUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
/**
* 缓存controller
*
* @author shuzheng
* @date 2016年11月26日
*/
@Controller
@RequestMapping("/redis")
public class RedisController extends BaseController {
private static Logger _log = LoggerFactory.getLogger(RedisController.class);
@RequestMapping("/test")
@ResponseBody
public Object test(HttpServletRequest request) {
long time = System.currentTimeMillis();
for (int i = 1; i <= 10000; i ++) {
RedisUtil.set("key" + i, "value" + i, i * 5);
}
return System.currentTimeMillis() - time;
}
/**
* 新增缓存记录
*
* @param request
* @return
*/
@RequestMapping("/add")
@ResponseBody
public Object add(HttpServletRequest request) {
String key = request.getParameter("key");
String value = request.getParameter("value");
String time = request.getParameter("time");
RedisUtil.set(key, value, Integer.parseInt(time));
return "success";
}
/**
* 删除缓存记录
*
* @param request
* @return
*/
@RequestMapping("/remove")
@ResponseBody
public Object remove(HttpServletRequest request) {
String key = request.getParameter("key");
RedisUtil.remove(key);
return "success";
}
/**
* 获取缓存记录
*
* @param request
* @return
*/
@RequestMapping("/get")
@ResponseBody
public Object get(HttpServletRequest request) {
String key = request.getParameter("key");
String value = RedisUtil.get(key);
if (null == value) {
_log.debug("【redis】没有找到key={}的记录!", key);
return "";
}
return value;
}
}

View File

@ -1,213 +0,0 @@
package com.zheng.cms.web.controller.test;
import com.zheng.cms.common.constant.CmsResult;
import com.zheng.cms.common.constant.CmsResultConstant;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.dao.model.CmsUserExample;
import com.zheng.cms.rpc.api.UserService;
import com.zheng.common.base.BaseController;
import com.zheng.common.util.Paginator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 用户控制器
* @author shuzheng
* @date 2016年7月6日 下午6:16:25
*/
@Controller
@RequestMapping("/user")
public class UserController extends BaseController {
private static Logger _log = LoggerFactory.getLogger(UserController.class);
@Autowired
private UserService userService;
@ExceptionHandler(Exception.class)
public void exceptionHandler(Exception e) {
e.printStackTrace();
}
/**
* 首页
* @return
*/
@RequestMapping(value = {"", "index"})
public String index() {
return "redirect:/user/list";
}
/**
* 列表
* @param page
* @param rows
* @param request
* @return
*/
@RequestMapping("/list")
public String list(
@RequestParam(required = false, defaultValue = "1", value = "page") int page,
@RequestParam(required = false, defaultValue = "20", value = "rows") int rows,
HttpServletRequest request, ModelMap modelMap) {
CmsUserExample userExample = new CmsUserExample();
userExample.createCriteria()
.andUserIdGreaterThan(0);
userExample.setOffset((page -1) * rows);
userExample.setLimit(rows);
userExample.setDistinct(false);
userExample.setOrderByClause(" user_id asc ");
List<CmsUser> users = userService.selectByExample(userExample);
modelMap.put("users", users);
// 创建分页对象
long total = userService.countByExample(userExample);
Paginator paginator = new Paginator();
paginator.setTotal(total);
paginator.setPage(page);
paginator.setRows(rows);
paginator.setParam("page");
paginator.setUrl(request.getRequestURI());
paginator.setQuery(request.getQueryString());
modelMap.put("paginator", paginator);
return "/user/list";
}
/**
* 新增get
* @return
*/
@RequestMapping(value = "/create", method = RequestMethod.GET)
public String add() {
return "/user/create";
}
/**
* 新增post
* @param user
* @param binding
* @return
*/
@RequestMapping(value = "/create", method = RequestMethod.POST)
public String add(@Valid CmsUser user, BindingResult binding) {
if (binding.hasErrors()) {
for (ObjectError error : binding.getAllErrors()) {
_log.error(error.getDefaultMessage());
}
return "/user/create";
}
user.setCtime(System.currentTimeMillis());
userService.insertSelective(user);
_log.info("新增记录id为{}", user.getUserId());
return "redirect:/user/list";
}
/**
* 删除
* @param id
* @return
*/
@RequestMapping(value = "/delete/{id}",method = RequestMethod.GET)
public String delete(@PathVariable("id") int id) {
userService.deleteByPrimaryKey(id);
return "redirect:/user/list";
}
/**
* 修改get
* @param id
* @param modelMap
* @return
*/
@RequestMapping(value = "/update/{id}", method = RequestMethod.GET)
public String update(@PathVariable("id") int id, ModelMap modelMap) {
modelMap.put("user", userService.selectByPrimaryKey(id));
return "/user/update";
}
/**
* 修改post
* @param id
* @param user
* @param binding
* @param modelMap
* @return
*/
@RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
public String update(@PathVariable("id") int id, @Valid CmsUser user, BindingResult binding, ModelMap modelMap) {
if (binding.hasErrors()) {
modelMap.put("errors", binding.getAllErrors());
return "user/update/" + id;
}
userService.updateByPrimaryKeySelective(user);
return "redirect:/user/list";
}
/**
* 上传文件
* @param file
* @param request
* @return
* @throws IOException
*/
@ResponseBody
@RequestMapping(value = "/upload", method = RequestMethod.POST)
public Object upload(@RequestParam(value = "file", required = false) MultipartFile file, HttpServletRequest request) throws IOException {
// 返回结果
Map<String, Object> map = new HashMap<String, Object>();
// 判断上传文件类型
String contentType = file.getContentType().toLowerCase();
if ((!contentType.equals("image/jpeg")) &&
(!contentType.equals("image/pjpeg")) &&
(!contentType.equals("image/png")) &&
(!contentType.equals("image/x-png")) &&
(!contentType.equals("image/bmp")) &&
(!contentType.equals("image/gif"))) {
return new CmsResult(CmsResultConstant.FILE_TYPE_ERROR, "不支持该类型的文件!");
}
// 创建图片目录
String basePath = request.getSession().getServletContext().getRealPath("/attached");
String fileName = file.getOriginalFilename();
String savePath = basePath + "/images/";
File targetFile = new File(savePath, fileName);
if (!targetFile.exists()) {
targetFile.mkdirs();
}
// 保存图片
file.transferTo(targetFile);
return new CmsResult(CmsResultConstant.SUCCESS, targetFile.getAbsoluteFile());
}
/**
* ajax
* @param id
* @return
*/
@ResponseBody
@RequestMapping(value = "/ajax/{id}", method = RequestMethod.GET)
public Object ajax(@PathVariable int id) {
return userService.selectByPrimaryKey(id);
}
}

View File

@ -1,8 +1,5 @@
package com.zheng.cms.web.jms; package com.zheng.cms.web.jms;
import com.zheng.cms.dao.model.CmsUser;
import com.zheng.cms.rpc.api.UserService;
import net.sf.json.JSONObject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -11,8 +8,6 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import javax.jms.Message; import javax.jms.Message;
import javax.jms.MessageListener; import javax.jms.MessageListener;
import javax.jms.TextMessage; import javax.jms.TextMessage;
import java.text.SimpleDateFormat;
import java.util.Date;
/** /**
* MQ消费者 * MQ消费者
@ -20,35 +15,24 @@ import java.util.Date;
*/ */
public class DefaultMessageQueueListener implements MessageListener { public class DefaultMessageQueueListener implements MessageListener {
private static Logger _log = LoggerFactory.getLogger(DefaultMessageQueueListener.class); private static Logger _log = LoggerFactory.getLogger(DefaultMessageQueueListener.class);
@Autowired
ThreadPoolTaskExecutor threadPoolTaskExecutor;
@Autowired @Autowired
UserService userService; ThreadPoolTaskExecutor threadPoolTaskExecutor;
public void onMessage(final Message message) { public void onMessage(final Message message) {
// 使用线程池多线程处理 // 使用线程池多线程处理
threadPoolTaskExecutor.execute(new Runnable() { threadPoolTaskExecutor.execute(new Runnable() {
public void run() { public void run() {
TextMessage textMessage = (TextMessage) message; TextMessage textMessage = (TextMessage) message;
try { try {
String text = textMessage.getText(); String text = textMessage.getText();
JSONObject json = JSONObject.fromObject(text); _log.info("消费:{}", text);
CmsUser user = (CmsUser) JSONObject.toBean(json, CmsUser.class); } catch (Exception e) {
if (user.getUsername().equals("1")) { e.printStackTrace();
_log.info("消费开始时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(System.currentTimeMillis()))); }
} }
if (user.getUsername().equals("1000")) { });
_log.info("消费结束时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(System.currentTimeMillis()))); }
}
userService.insertSelective(user);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
} }

View File

@ -30,7 +30,5 @@
<dubbo:reference id="cmsPageService" interface="com.zheng.cms.rpc.api.CmsPageService" mock="true"/> <dubbo:reference id="cmsPageService" interface="com.zheng.cms.rpc.api.CmsPageService" mock="true"/>
<!-- 设置 --> <!-- 设置 -->
<dubbo:reference id="cmsSettingService" interface="com.zheng.cms.rpc.api.CmsSettingService" mock="true"/> <dubbo:reference id="cmsSettingService" interface="com.zheng.cms.rpc.api.CmsSettingService" mock="true"/>
<!-- 用户 -->
<dubbo:reference id="userService" interface="com.zheng.cms.rpc.api.UserService" mock="true"/>
</beans> </beans>