Browse Source

poem list

master
nili 3 years ago
parent
commit
f3a070f1c1
  1. 11
      luigi-api/pom.xml
  2. 47
      luigi-api/src/main/java/com/bzgame/server/luigi/api/config/SwaggerConfig.java
  3. 52
      luigi-api/src/main/java/com/bzgame/server/luigi/api/config/SwaggerProperties.java
  4. 39
      luigi-api/src/main/java/com/bzgame/server/luigi/api/rest/AuthorController.java
  5. 35
      luigi-api/src/main/java/com/bzgame/server/luigi/api/rest/PoemController.java
  6. 28
      luigi-api/src/main/java/com/bzgame/server/luigi/api/rest/UserController.java
  7. 20
      luigi-api/src/main/resources/application-default.yml
  8. 17
      luigi-api/src/main/resources/application-prod.yml
  9. 17
      luigi-api/src/main/resources/application-test.yml
  10. 5
      luigi-dao/pom.xml
  11. 26
      luigi-dao/src/main/java/com/bzgame/server/luigi/dao/config/MarioDataSourceConfig.java
  12. 3
      luigi-dao/src/main/java/com/bzgame/server/luigi/dao/config/MybatisGeneralConfig.java
  13. 234
      luigi-dao/src/main/java/com/bzgame/server/luigi/dao/domain/Author.java
  14. 642
      luigi-dao/src/main/java/com/bzgame/server/luigi/dao/domain/AuthorExample.java
  15. 26
      luigi-dao/src/main/java/com/bzgame/server/luigi/dao/domain/DroolRules.java
  16. 302
      luigi-dao/src/main/java/com/bzgame/server/luigi/dao/domain/Poem.java
  17. 642
      luigi-dao/src/main/java/com/bzgame/server/luigi/dao/domain/PoemExample.java
  18. 120
      luigi-dao/src/main/java/com/bzgame/server/luigi/dao/mapper/AuthorMapper.java
  19. 13
      luigi-dao/src/main/java/com/bzgame/server/luigi/dao/mapper/DroolRulesMapper.java
  20. 120
      luigi-dao/src/main/java/com/bzgame/server/luigi/dao/mapper/PoemMapper.java
  21. 366
      luigi-dao/src/main/resources/mapper/AuthorMapper.xml
  22. 398
      luigi-dao/src/main/resources/mapper/PoemMapper.xml
  23. 9
      luigi-service/pom.xml
  24. 42
      luigi-service/src/main/java/com/bzgame/server/luigi/service/bo/AuthorService.java
  25. 83
      luigi-service/src/main/java/com/bzgame/server/luigi/service/bo/PoemService.java
  26. 57
      luigi-service/src/main/java/com/bzgame/server/luigi/service/bo/request/PoemQuery.java
  27. 45
      luigi-service/src/main/java/com/bzgame/server/luigi/service/bo/response/CommonList.java
  28. 26
      luigi-service/src/main/java/com/bzgame/server/luigi/service/bo/response/PoemBo.java
  29. 53
      luigi-service/src/main/java/com/bzgame/server/luigi/service/bo/response/UserBo.java
  30. 7
      pom.xml

11
luigi-api/pom.xml

@ -17,6 +17,11 @@
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>com.bzgame.server</groupId>
<artifactId>luigi-service</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
@ -71,6 +76,12 @@
<groupId>redis.clients</groupId> <groupId>redis.clients</groupId>
<artifactId>jedis</artifactId> <artifactId>jedis</artifactId>
</dependency> </dependency>
<!--swagger-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>

47
luigi-api/src/main/java/com/bzgame/server/luigi/api/config/SwaggerConfig.java

@ -0,0 +1,47 @@
package com.bzgame.server.luigi.api.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
/**
* @author nidaren
*/
@Configuration
public class SwaggerConfig implements WebMvcConfigurer {
private final SwaggerProperties swaggerProperties;
public SwaggerConfig(SwaggerProperties swaggerProperties) {
this.swaggerProperties = swaggerProperties;
}
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.OAS_30)
.enable(swaggerProperties.getEnable())
.useDefaultResponseMessages(false)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("com.bzgame.server.luigi.api.rest"))
.paths(PathSelectors.any())
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title(swaggerProperties.getApplicationName() + " Api Doc")
.description(swaggerProperties.getApplicationDescription())
.contact(new Contact("bzc.app.server", "", ""))
.version(swaggerProperties.getApplicationVersion())
.build();
}
}

52
luigi-api/src/main/java/com/bzgame/server/luigi/api/config/SwaggerProperties.java

@ -0,0 +1,52 @@
package com.bzgame.server.luigi.api.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @author nidaren
*/
@Component
@ConfigurationProperties("swagger")
public class SwaggerProperties {
private Boolean enable;
private String applicationName;
private String applicationVersion;
private String applicationDescription;
public Boolean getEnable() {
return enable;
}
public void setEnable(Boolean enable) {
this.enable = enable;
}
public String getApplicationName() {
return applicationName;
}
public void setApplicationName(String applicationName) {
this.applicationName = applicationName;
}
public String getApplicationVersion() {
return applicationVersion;
}
public void setApplicationVersion(String applicationVersion) {
this.applicationVersion = applicationVersion;
}
public String getApplicationDescription() {
return applicationDescription;
}
public void setApplicationDescription(String applicationDescription) {
this.applicationDescription = applicationDescription;
}
}

39
luigi-api/src/main/java/com/bzgame/server/luigi/api/rest/AuthorController.java

@ -0,0 +1,39 @@
package com.bzgame.server.luigi.api.rest;
import com.bczgame.server.common.vo.Response;
import com.bzgame.server.luigi.api.aop.ApiFlag;
import com.bzgame.server.luigi.dao.domain.Author;
import com.bzgame.server.luigi.service.bo.AuthorService;
import com.bzgame.server.luigi.service.bo.response.CommonList;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author nidaren
*/
@RestController
@RequestMapping("/api/luigi/author")
@Api(tags = "author")
public class AuthorController {
@Resource
private AuthorService authorService;
@GetMapping("/seek")
@ApiFlag
public Response<CommonList<Author>> seek(@RequestParam String name) {
if (StringUtils.isEmpty(name)) {
return new Response<>(new CommonList<>(), "ok", Response.CODE_SUCCESS);
}
return new Response<>(authorService.seek(name), "ok", Response.CODE_SUCCESS);
}
}

35
luigi-api/src/main/java/com/bzgame/server/luigi/api/rest/PoemController.java

@ -0,0 +1,35 @@
package com.bzgame.server.luigi.api.rest;
import com.bczgame.server.common.vo.Response;
import com.bzgame.server.luigi.api.aop.ApiFlag;
import com.bzgame.server.luigi.service.bo.PoemService;
import com.bzgame.server.luigi.service.bo.request.PoemQuery;
import com.bzgame.server.luigi.service.bo.response.CommonList;
import com.bzgame.server.luigi.service.bo.response.PoemBo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* poem
*/
@RestController
@RequestMapping("/api/luigi/poem")
@Api(tags = "poem")
public class PoemController {
@Resource
private PoemService poemService;
@PostMapping("/list")
@ApiFlag
public Response<CommonList<PoemBo>> poemList(@RequestBody PoemQuery query) {
return new Response<>(poemService.query(query), "ok", Response.CODE_SUCCESS);
}
@GetMapping("/detail")
public Response<PoemBo> poemDetail(@RequestParam Integer id) {
return new Response<>(poemService.detail(id), "ok", Response.CODE_SUCCESS);
}
}

28
luigi-api/src/main/java/com/bzgame/server/luigi/api/rest/UserController.java

@ -0,0 +1,28 @@
package com.bzgame.server.luigi.api.rest;
import com.bczgame.server.common.exception.BizException;
import com.bczgame.server.common.exception.ExceptionCode;
import com.bczgame.server.common.vo.Response;
import com.bzgame.server.luigi.api.aop.ApiFlag;
import com.bzgame.server.luigi.service.bo.response.UserBo;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* @author nidaren
*/
@RestController
@RequestMapping("/api/luigi/user")
@Api(tags = "user")
public class UserController {
@GetMapping("/current")
@ApiFlag
public Response<UserBo> getCurrent() {
UserBo u = new UserBo(1, "test", "", "admin");
return new Response<>(u, "ok", Response.CODE_SUCCESS);
}
}

20
luigi-api/src/main/resources/application-default.yml

@ -21,10 +21,30 @@ spring:
maxTotal: 128 maxTotal: 128
poolMaxWaitMs: 50 poolMaxWaitMs: 50
timeOutMs: 100 timeOutMs: 100
mvc:
pathmatch:
matching-strategy: ant_path_matcher
logging: logging:
config: classpath:logback-spring.xml config: classpath:logback-spring.xml
springfox:
documentation:
swaggerUi:
baseUrl: /api/luigi
openApi:
v3:
path: /api/luigi/swagger/v3/api-docs
swagger:
v2:
path: /api/luigi/swagger/v2/api-docs
swagger:
enable: true
applicationName: luigi
applicationDescription: support system for mario
applicationVersion: 1.0
server: server:
port: 8001 port: 8001
connection-timeout: 60000 #Time in milliseconds that connectors will wait for another HTTP request before closing the connection. connection-timeout: 60000 #Time in milliseconds that connectors will wait for another HTTP request before closing the connection.

17
luigi-api/src/main/resources/application-prod.yml

@ -14,6 +14,23 @@ spring:
logging: logging:
config: classpath:logback-spring.xml config: classpath:logback-spring.xml
springfox:
documentation:
swaggerUi:
baseUrl: /api/luigi
openApi:
v3:
path: /api/luigi/swagger/v3/api-docs
swagger:
v2:
path: /api/luigi/swagger/v2/api-docs
swagger:
enable: false
applicationName: luigi
applicationDescription: support system for mario
applicationVersion: 1.0
server: server:
port: 8001 port: 8001
connection-timeout: 60000 #Time in milliseconds that connectors will wait for another HTTP request before closing the connection. connection-timeout: 60000 #Time in milliseconds that connectors will wait for another HTTP request before closing the connection.

17
luigi-api/src/main/resources/application-test.yml

@ -25,6 +25,23 @@ spring:
logging: logging:
config: classpath:logback-spring.xml config: classpath:logback-spring.xml
springfox:
documentation:
swaggerUi:
baseUrl: /api/luigi
openApi:
v3:
path: /api/luigi/swagger/v3/api-docs
swagger:
v2:
path: /api/luigi/swagger/v2/api-docs
swagger:
enable: false
applicationName: luigi
applicationDescription: support system for mario
applicationVersion: 1.0
server: server:
port: 8001 port: 8001
connection-timeout: 60000 #Time in milliseconds that connectors will wait for another HTTP request before closing the connection. connection-timeout: 60000 #Time in milliseconds that connectors will wait for another HTTP request before closing the connection.

5
luigi-dao/pom.xml

@ -36,11 +36,6 @@
<groupId>org.mybatis.spring.boot</groupId> <groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId> <artifactId>mybatis-spring-boot-starter</artifactId>
</dependency> </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

26
luigi-dao/src/main/java/com/bzgame/server/luigi/dao/config/TopicDataSourceConfig.java → luigi-dao/src/main/java/com/bzgame/server/luigi/dao/config/MarioDataSourceConfig.java

@ -10,31 +10,26 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import javax.sql.DataSource; import javax.sql.DataSource;
/**
* Created by cba/kit-backend on 2022-03-18 15:25:35
*/
@Configuration @Configuration
@MapperScan(basePackages = TopicDataSourceConfig.BASE_PACKAGE,sqlSessionFactoryRef = TopicDataSourceConfig.SSF_NAME,sqlSessionTemplateRef = TopicDataSourceConfig.SST_NAME) @MapperScan(basePackages = MarioDataSourceConfig.BASE_PACKAGE,sqlSessionFactoryRef = MarioDataSourceConfig.SSF_NAME,sqlSessionTemplateRef = MarioDataSourceConfig.SST_NAME)
public class TopicDataSourceConfig { public class MarioDataSourceConfig {
public static final String DS_NAME = "marioDataSource";
//TODO 修改配置常量名 public static final String TM_NAME = "marioTransactionManager";
public static final String DS_NAME = "topicDataSource"; public static final String SSF_NAME = "marioSqlSessionFactory";
public static final String TM_NAME = "topicTransactionManager"; public static final String SST_NAME = "marioSqlSessionTemplate";
public static final String SSF_NAME = "topicSqlSessionFactory"; public static final String DS_CFG_PREFIX = "datasource.mario";
public static final String SST_NAME = "topicSqlSessionTemplate"; public static final String BASE_PACKAGE = "com.bzgame.server.luigi.dao.mapper";
public static final String DS_CFG_PREFIX = "datasource.topic";
public static final String BASE_PACKAGE = "bcz.app.server.luigi.dao.mapper";
@Bean(name = DS_NAME) @Bean(name = DS_NAME)
@ConfigurationProperties(DS_CFG_PREFIX) @ConfigurationProperties(DS_CFG_PREFIX)
@ -47,10 +42,11 @@ public class TopicDataSourceConfig {
return new DataSourceTransactionManager(dataSource); return new DataSourceTransactionManager(dataSource);
} }
@Bean(name = SSF_NAME) @Bean(name = SSF_NAME)
public SqlSessionFactory sqlSessionFactory(@Qualifier(DS_NAME) DataSource dataSource, @Qualifier(MybatisGeneralConfig.MBTS_CFG_NAME) org.apache.ibatis.session.Configuration configuration) throws Exception { public SqlSessionFactory sqlSessionFactory(@Qualifier(DS_NAME) DataSource dataSource, @Qualifier(MybatisGeneralConfig.MBTS_CFG_NAME) org.apache.ibatis.session.Configuration configuration) throws Exception {
SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean(); SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
factoryBean.setMapperLocations(resolver.getResources("classpath*:/mapper/*.xml"));
factoryBean.setConfiguration(configuration); factoryBean.setConfiguration(configuration);
factoryBean.setDataSource(dataSource); factoryBean.setDataSource(dataSource);
return factoryBean.getObject(); return factoryBean.getObject();

3
luigi-dao/src/main/java/com/bzgame/server/luigi/dao/config/MybatisGeneralConfig.java

@ -6,9 +6,6 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.Scope;
/**
* Created by cba/kit-backend on 2022-03-18 15:25:35
*/
@Configuration @Configuration
public class MybatisGeneralConfig { public class MybatisGeneralConfig {

234
luigi-dao/src/main/java/com/bzgame/server/luigi/dao/domain/Author.java

@ -0,0 +1,234 @@
package com.bzgame.server.luigi.dao.domain;
import java.io.Serializable;
public class Author implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column author.id
*
* @mbg.generated
*/
private Integer id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column author.name
*
* @mbg.generated
*/
private String name;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column author.dynasty
*
* @mbg.generated
*/
private String dynasty;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column author.poem_cnt
*
* @mbg.generated
*/
private Integer poemCnt;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column author.status
*
* @mbg.generated
*/
private Integer status;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column author.introduction
*
* @mbg.generated
*/
private String introduction;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table author
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column author.id
*
* @return the value of author.id
*
* @mbg.generated
*/
public Integer getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column author.id
*
* @param id the value for author.id
*
* @mbg.generated
*/
public void setId(Integer id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column author.name
*
* @return the value of author.name
*
* @mbg.generated
*/
public String getName() {
return name;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column author.name
*
* @param name the value for author.name
*
* @mbg.generated
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column author.dynasty
*
* @return the value of author.dynasty
*
* @mbg.generated
*/
public String getDynasty() {
return dynasty;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column author.dynasty
*
* @param dynasty the value for author.dynasty
*
* @mbg.generated
*/
public void setDynasty(String dynasty) {
this.dynasty = dynasty == null ? null : dynasty.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column author.poem_cnt
*
* @return the value of author.poem_cnt
*
* @mbg.generated
*/
public Integer getPoemCnt() {
return poemCnt;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column author.poem_cnt
*
* @param poemCnt the value for author.poem_cnt
*
* @mbg.generated
*/
public void setPoemCnt(Integer poemCnt) {
this.poemCnt = poemCnt;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column author.status
*
* @return the value of author.status
*
* @mbg.generated
*/
public Integer getStatus() {
return status;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column author.status
*
* @param status the value for author.status
*
* @mbg.generated
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column author.introduction
*
* @return the value of author.introduction
*
* @mbg.generated
*/
public String getIntroduction() {
return introduction;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column author.introduction
*
* @param introduction the value for author.introduction
*
* @mbg.generated
*/
public void setIntroduction(String introduction) {
this.introduction = introduction == null ? null : introduction.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", name=").append(name);
sb.append(", dynasty=").append(dynasty);
sb.append(", poemCnt=").append(poemCnt);
sb.append(", status=").append(status);
sb.append(", introduction=").append(introduction);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

642
luigi-dao/src/main/java/com/bzgame/server/luigi/dao/domain/AuthorExample.java

@ -0,0 +1,642 @@
package com.bzgame.server.luigi.dao.domain;
import java.util.ArrayList;
import java.util.List;
public class AuthorExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table author
*
* @mbg.generated
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table author
*
* @mbg.generated
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table author
*
* @mbg.generated
*/
protected List<Criteria> oredCriteria;
private Integer limit;
private Integer offset;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
public AuthorExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
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;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table author
*
* @mbg.generated
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andDynastyIsNull() {
addCriterion("dynasty is null");
return (Criteria) this;
}
public Criteria andDynastyIsNotNull() {
addCriterion("dynasty is not null");
return (Criteria) this;
}
public Criteria andDynastyEqualTo(String value) {
addCriterion("dynasty =", value, "dynasty");
return (Criteria) this;
}
public Criteria andDynastyNotEqualTo(String value) {
addCriterion("dynasty <>", value, "dynasty");
return (Criteria) this;
}
public Criteria andDynastyGreaterThan(String value) {
addCriterion("dynasty >", value, "dynasty");
return (Criteria) this;
}
public Criteria andDynastyGreaterThanOrEqualTo(String value) {
addCriterion("dynasty >=", value, "dynasty");
return (Criteria) this;
}
public Criteria andDynastyLessThan(String value) {
addCriterion("dynasty <", value, "dynasty");
return (Criteria) this;
}
public Criteria andDynastyLessThanOrEqualTo(String value) {
addCriterion("dynasty <=", value, "dynasty");
return (Criteria) this;
}
public Criteria andDynastyLike(String value) {
addCriterion("dynasty like", value, "dynasty");
return (Criteria) this;
}
public Criteria andDynastyNotLike(String value) {
addCriterion("dynasty not like", value, "dynasty");
return (Criteria) this;
}
public Criteria andDynastyIn(List<String> values) {
addCriterion("dynasty in", values, "dynasty");
return (Criteria) this;
}
public Criteria andDynastyNotIn(List<String> values) {
addCriterion("dynasty not in", values, "dynasty");
return (Criteria) this;
}
public Criteria andDynastyBetween(String value1, String value2) {
addCriterion("dynasty between", value1, value2, "dynasty");
return (Criteria) this;
}
public Criteria andDynastyNotBetween(String value1, String value2) {
addCriterion("dynasty not between", value1, value2, "dynasty");
return (Criteria) this;
}
public Criteria andPoemCntIsNull() {
addCriterion("poem_cnt is null");
return (Criteria) this;
}
public Criteria andPoemCntIsNotNull() {
addCriterion("poem_cnt is not null");
return (Criteria) this;
}
public Criteria andPoemCntEqualTo(Integer value) {
addCriterion("poem_cnt =", value, "poemCnt");
return (Criteria) this;
}
public Criteria andPoemCntNotEqualTo(Integer value) {
addCriterion("poem_cnt <>", value, "poemCnt");
return (Criteria) this;
}
public Criteria andPoemCntGreaterThan(Integer value) {
addCriterion("poem_cnt >", value, "poemCnt");
return (Criteria) this;
}
public Criteria andPoemCntGreaterThanOrEqualTo(Integer value) {
addCriterion("poem_cnt >=", value, "poemCnt");
return (Criteria) this;
}
public Criteria andPoemCntLessThan(Integer value) {
addCriterion("poem_cnt <", value, "poemCnt");
return (Criteria) this;
}
public Criteria andPoemCntLessThanOrEqualTo(Integer value) {
addCriterion("poem_cnt <=", value, "poemCnt");
return (Criteria) this;
}
public Criteria andPoemCntIn(List<Integer> values) {
addCriterion("poem_cnt in", values, "poemCnt");
return (Criteria) this;
}
public Criteria andPoemCntNotIn(List<Integer> values) {
addCriterion("poem_cnt not in", values, "poemCnt");
return (Criteria) this;
}
public Criteria andPoemCntBetween(Integer value1, Integer value2) {
addCriterion("poem_cnt between", value1, value2, "poemCnt");
return (Criteria) this;
}
public Criteria andPoemCntNotBetween(Integer value1, Integer value2) {
addCriterion("poem_cnt not between", value1, value2, "poemCnt");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Integer value) {
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Integer value) {
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Integer value) {
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Integer> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table author
*
* @mbg.generated do_not_delete_during_merge
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table author
*
* @mbg.generated
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

26
luigi-dao/src/main/java/com/bzgame/server/luigi/dao/domain/DroolRules.java

@ -1,26 +0,0 @@
package com.bzgame.server.luigi.dao.domain;
/**
* @author chenyang@baicizhan.com
* @date 2020/3/9 6:31 PM
*/
public class DroolRules {
private long id;
private String rules;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getRules() {
return rules;
}
public void setRules(String rules) {
this.rules = rules;
}
}

302
luigi-dao/src/main/java/com/bzgame/server/luigi/dao/domain/Poem.java

@ -0,0 +1,302 @@
package com.bzgame.server.luigi.dao.domain;
import java.io.Serializable;
public class Poem implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column poem.id
*
* @mbg.generated
*/
private Integer id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column poem.author_id
*
* @mbg.generated
*/
private Integer authorId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column poem.title
*
* @mbg.generated
*/
private String title;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column poem.line
*
* @mbg.generated
*/
private String line;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column poem.status
*
* @mbg.generated
*/
private Integer status;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column poem.content
*
* @mbg.generated
*/
private String content;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column poem.note
*
* @mbg.generated
*/
private String note;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column poem.translation
*
* @mbg.generated
*/
private String translation;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table poem
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column poem.id
*
* @return the value of poem.id
*
* @mbg.generated
*/
public Integer getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column poem.id
*
* @param id the value for poem.id
*
* @mbg.generated
*/
public void setId(Integer id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column poem.author_id
*
* @return the value of poem.author_id
*
* @mbg.generated
*/
public Integer getAuthorId() {
return authorId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column poem.author_id
*
* @param authorId the value for poem.author_id
*
* @mbg.generated
*/
public void setAuthorId(Integer authorId) {
this.authorId = authorId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column poem.title
*
* @return the value of poem.title
*
* @mbg.generated
*/
public String getTitle() {
return title;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column poem.title
*
* @param title the value for poem.title
*
* @mbg.generated
*/
public void setTitle(String title) {
this.title = title == null ? null : title.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column poem.line
*
* @return the value of poem.line
*
* @mbg.generated
*/
public String getLine() {
return line;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column poem.line
*
* @param line the value for poem.line
*
* @mbg.generated
*/
public void setLine(String line) {
this.line = line == null ? null : line.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column poem.status
*
* @return the value of poem.status
*
* @mbg.generated
*/
public Integer getStatus() {
return status;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column poem.status
*
* @param status the value for poem.status
*
* @mbg.generated
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column poem.content
*
* @return the value of poem.content
*
* @mbg.generated
*/
public String getContent() {
return content;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column poem.content
*
* @param content the value for poem.content
*
* @mbg.generated
*/
public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column poem.note
*
* @return the value of poem.note
*
* @mbg.generated
*/
public String getNote() {
return note;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column poem.note
*
* @param note the value for poem.note
*
* @mbg.generated
*/
public void setNote(String note) {
this.note = note == null ? null : note.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column poem.translation
*
* @return the value of poem.translation
*
* @mbg.generated
*/
public String getTranslation() {
return translation;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column poem.translation
*
* @param translation the value for poem.translation
*
* @mbg.generated
*/
public void setTranslation(String translation) {
this.translation = translation == null ? null : translation.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", authorId=").append(authorId);
sb.append(", title=").append(title);
sb.append(", line=").append(line);
sb.append(", status=").append(status);
sb.append(", content=").append(content);
sb.append(", note=").append(note);
sb.append(", translation=").append(translation);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

642
luigi-dao/src/main/java/com/bzgame/server/luigi/dao/domain/PoemExample.java

@ -0,0 +1,642 @@
package com.bzgame.server.luigi.dao.domain;
import java.util.ArrayList;
import java.util.List;
public class PoemExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table poem
*
* @mbg.generated
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table poem
*
* @mbg.generated
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table poem
*
* @mbg.generated
*/
protected List<Criteria> oredCriteria;
private Integer limit;
private Integer offset;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
public PoemExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
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;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table poem
*
* @mbg.generated
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andAuthorIdIsNull() {
addCriterion("author_id is null");
return (Criteria) this;
}
public Criteria andAuthorIdIsNotNull() {
addCriterion("author_id is not null");
return (Criteria) this;
}
public Criteria andAuthorIdEqualTo(Integer value) {
addCriterion("author_id =", value, "authorId");
return (Criteria) this;
}
public Criteria andAuthorIdNotEqualTo(Integer value) {
addCriterion("author_id <>", value, "authorId");
return (Criteria) this;
}
public Criteria andAuthorIdGreaterThan(Integer value) {
addCriterion("author_id >", value, "authorId");
return (Criteria) this;
}
public Criteria andAuthorIdGreaterThanOrEqualTo(Integer value) {
addCriterion("author_id >=", value, "authorId");
return (Criteria) this;
}
public Criteria andAuthorIdLessThan(Integer value) {
addCriterion("author_id <", value, "authorId");
return (Criteria) this;
}
public Criteria andAuthorIdLessThanOrEqualTo(Integer value) {
addCriterion("author_id <=", value, "authorId");
return (Criteria) this;
}
public Criteria andAuthorIdIn(List<Integer> values) {
addCriterion("author_id in", values, "authorId");
return (Criteria) this;
}
public Criteria andAuthorIdNotIn(List<Integer> values) {
addCriterion("author_id not in", values, "authorId");
return (Criteria) this;
}
public Criteria andAuthorIdBetween(Integer value1, Integer value2) {
addCriterion("author_id between", value1, value2, "authorId");
return (Criteria) this;
}
public Criteria andAuthorIdNotBetween(Integer value1, Integer value2) {
addCriterion("author_id not between", value1, value2, "authorId");
return (Criteria) this;
}
public Criteria andTitleIsNull() {
addCriterion("title is null");
return (Criteria) this;
}
public Criteria andTitleIsNotNull() {
addCriterion("title is not null");
return (Criteria) this;
}
public Criteria andTitleEqualTo(String value) {
addCriterion("title =", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotEqualTo(String value) {
addCriterion("title <>", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThan(String value) {
addCriterion("title >", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThanOrEqualTo(String value) {
addCriterion("title >=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThan(String value) {
addCriterion("title <", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThanOrEqualTo(String value) {
addCriterion("title <=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLike(String value) {
addCriterion("title like", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotLike(String value) {
addCriterion("title not like", value, "title");
return (Criteria) this;
}
public Criteria andTitleIn(List<String> values) {
addCriterion("title in", values, "title");
return (Criteria) this;
}
public Criteria andTitleNotIn(List<String> values) {
addCriterion("title not in", values, "title");
return (Criteria) this;
}
public Criteria andTitleBetween(String value1, String value2) {
addCriterion("title between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andTitleNotBetween(String value1, String value2) {
addCriterion("title not between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andLineIsNull() {
addCriterion("line is null");
return (Criteria) this;
}
public Criteria andLineIsNotNull() {
addCriterion("line is not null");
return (Criteria) this;
}
public Criteria andLineEqualTo(String value) {
addCriterion("line =", value, "line");
return (Criteria) this;
}
public Criteria andLineNotEqualTo(String value) {
addCriterion("line <>", value, "line");
return (Criteria) this;
}
public Criteria andLineGreaterThan(String value) {
addCriterion("line >", value, "line");
return (Criteria) this;
}
public Criteria andLineGreaterThanOrEqualTo(String value) {
addCriterion("line >=", value, "line");
return (Criteria) this;
}
public Criteria andLineLessThan(String value) {
addCriterion("line <", value, "line");
return (Criteria) this;
}
public Criteria andLineLessThanOrEqualTo(String value) {
addCriterion("line <=", value, "line");
return (Criteria) this;
}
public Criteria andLineLike(String value) {
addCriterion("line like", value, "line");
return (Criteria) this;
}
public Criteria andLineNotLike(String value) {
addCriterion("line not like", value, "line");
return (Criteria) this;
}
public Criteria andLineIn(List<String> values) {
addCriterion("line in", values, "line");
return (Criteria) this;
}
public Criteria andLineNotIn(List<String> values) {
addCriterion("line not in", values, "line");
return (Criteria) this;
}
public Criteria andLineBetween(String value1, String value2) {
addCriterion("line between", value1, value2, "line");
return (Criteria) this;
}
public Criteria andLineNotBetween(String value1, String value2) {
addCriterion("line not between", value1, value2, "line");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Integer value) {
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Integer value) {
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Integer value) {
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Integer> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table poem
*
* @mbg.generated do_not_delete_during_merge
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table poem
*
* @mbg.generated
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

120
luigi-dao/src/main/java/com/bzgame/server/luigi/dao/mapper/AuthorMapper.java

@ -0,0 +1,120 @@
package com.bzgame.server.luigi.dao.mapper;
import com.bzgame.server.luigi.dao.domain.Author;
import com.bzgame.server.luigi.dao.domain.AuthorExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface AuthorMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
long countByExample(AuthorExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
int deleteByExample(AuthorExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
int insert(Author record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
int insertSelective(Author record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
List<Author> selectByExampleWithBLOBs(AuthorExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
List<Author> selectByExample(AuthorExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
Author selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") Author record, @Param("example") AuthorExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
int updateByExampleWithBLOBs(@Param("record") Author record, @Param("example") AuthorExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
int updateByExample(@Param("record") Author record, @Param("example") AuthorExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(Author record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
int updateByPrimaryKeyWithBLOBs(Author record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table author
*
* @mbg.generated
*/
int updateByPrimaryKey(Author record);
}

13
luigi-dao/src/main/java/com/bzgame/server/luigi/dao/mapper/DroolRulesMapper.java

@ -1,13 +0,0 @@
package com.bzgame.server.luigi.dao.mapper;
import com.bzgame.server.luigi.dao.domain.DroolRules;
import org.apache.ibatis.annotations.Select;
/**
* @author chenyang@baicizhan.com
* @date 2020/3/9 6:32 PM
*/
public interface DroolRulesMapper {
@Select("SELECT *FROM drool_rules WHERE id=1")
DroolRules query();
}

120
luigi-dao/src/main/java/com/bzgame/server/luigi/dao/mapper/PoemMapper.java

@ -0,0 +1,120 @@
package com.bzgame.server.luigi.dao.mapper;
import com.bzgame.server.luigi.dao.domain.Poem;
import com.bzgame.server.luigi.dao.domain.PoemExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface PoemMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
long countByExample(PoemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
int deleteByExample(PoemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
int insert(Poem record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
int insertSelective(Poem record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
List<Poem> selectByExampleWithBLOBs(PoemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
List<Poem> selectByExample(PoemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
Poem selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") Poem record, @Param("example") PoemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
int updateByExampleWithBLOBs(@Param("record") Poem record, @Param("example") PoemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
int updateByExample(@Param("record") Poem record, @Param("example") PoemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(Poem record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
int updateByPrimaryKeyWithBLOBs(Poem record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table poem
*
* @mbg.generated
*/
int updateByPrimaryKey(Poem record);
}

366
luigi-dao/src/main/resources/mapper/AuthorMapper.xml

@ -0,0 +1,366 @@
<?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.bzgame.server.luigi.dao.mapper.AuthorMapper">
<resultMap id="BaseResultMap" type="com.bzgame.server.luigi.dao.domain.Author">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="dynasty" jdbcType="VARCHAR" property="dynasty" />
<result column="poem_cnt" jdbcType="INTEGER" property="poemCnt" />
<result column="status" jdbcType="INTEGER" property="status" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.bzgame.server.luigi.dao.domain.Author">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<result column="introduction" jdbcType="LONGVARCHAR" property="introduction" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, `name`, dynasty, poem_cnt, `status`
</sql>
<sql id="Blob_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
introduction
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.bzgame.server.luigi.dao.domain.AuthorExample" resultMap="ResultMapWithBLOBs">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from author
<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="selectByExample" parameterType="com.bzgame.server.luigi.dao.domain.AuthorExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from author
<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">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from author
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from author
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.bzgame.server.luigi.dao.domain.AuthorExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from author
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.bzgame.server.luigi.dao.domain.Author">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into author (`name`, dynasty, poem_cnt,
`status`, introduction)
values (#{name,jdbcType=VARCHAR}, #{dynasty,jdbcType=VARCHAR}, #{poemCnt,jdbcType=INTEGER},
#{status,jdbcType=INTEGER}, #{introduction,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.bzgame.server.luigi.dao.domain.Author">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into author
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">
`name`,
</if>
<if test="dynasty != null">
dynasty,
</if>
<if test="poemCnt != null">
poem_cnt,
</if>
<if test="status != null">
`status`,
</if>
<if test="introduction != null">
introduction,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="dynasty != null">
#{dynasty,jdbcType=VARCHAR},
</if>
<if test="poemCnt != null">
#{poemCnt,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="introduction != null">
#{introduction,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.bzgame.server.luigi.dao.domain.AuthorExample" resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from author
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update author
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.dynasty != null">
dynasty = #{record.dynasty,jdbcType=VARCHAR},
</if>
<if test="record.poemCnt != null">
poem_cnt = #{record.poemCnt,jdbcType=INTEGER},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.introduction != null">
introduction = #{record.introduction,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update author
set id = #{record.id,jdbcType=INTEGER},
`name` = #{record.name,jdbcType=VARCHAR},
dynasty = #{record.dynasty,jdbcType=VARCHAR},
poem_cnt = #{record.poemCnt,jdbcType=INTEGER},
`status` = #{record.status,jdbcType=INTEGER},
introduction = #{record.introduction,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update author
set id = #{record.id,jdbcType=INTEGER},
`name` = #{record.name,jdbcType=VARCHAR},
dynasty = #{record.dynasty,jdbcType=VARCHAR},
poem_cnt = #{record.poemCnt,jdbcType=INTEGER},
`status` = #{record.status,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.bzgame.server.luigi.dao.domain.Author">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update author
<set>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="dynasty != null">
dynasty = #{dynasty,jdbcType=VARCHAR},
</if>
<if test="poemCnt != null">
poem_cnt = #{poemCnt,jdbcType=INTEGER},
</if>
<if test="status != null">
`status` = #{status,jdbcType=INTEGER},
</if>
<if test="introduction != null">
introduction = #{introduction,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.bzgame.server.luigi.dao.domain.Author">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update author
set `name` = #{name,jdbcType=VARCHAR},
dynasty = #{dynasty,jdbcType=VARCHAR},
poem_cnt = #{poemCnt,jdbcType=INTEGER},
`status` = #{status,jdbcType=INTEGER},
introduction = #{introduction,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.bzgame.server.luigi.dao.domain.Author">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update author
set `name` = #{name,jdbcType=VARCHAR},
dynasty = #{dynasty,jdbcType=VARCHAR},
poem_cnt = #{poemCnt,jdbcType=INTEGER},
`status` = #{status,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

398
luigi-dao/src/main/resources/mapper/PoemMapper.xml

@ -0,0 +1,398 @@
<?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.bzgame.server.luigi.dao.mapper.PoemMapper">
<resultMap id="BaseResultMap" type="com.bzgame.server.luigi.dao.domain.Poem">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="author_id" jdbcType="INTEGER" property="authorId" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="line" jdbcType="VARCHAR" property="line" />
<result column="status" jdbcType="INTEGER" property="status" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.bzgame.server.luigi.dao.domain.Poem">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<result column="content" jdbcType="LONGVARCHAR" property="content" />
<result column="note" jdbcType="LONGVARCHAR" property="note" />
<result column="translation" jdbcType="LONGVARCHAR" property="translation" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, author_id, title, line, `status`
</sql>
<sql id="Blob_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
content, note, `translation`
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.bzgame.server.luigi.dao.domain.PoemExample" resultMap="ResultMapWithBLOBs">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from poem
<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="selectByExample" parameterType="com.bzgame.server.luigi.dao.domain.PoemExample" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from poem
<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">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from poem
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from poem
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.bzgame.server.luigi.dao.domain.PoemExample">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from poem
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.bzgame.server.luigi.dao.domain.Poem">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into poem (author_id, title, line,
`status`, content, note,
`translation`)
values (#{authorId,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{line,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, #{content,jdbcType=LONGVARCHAR}, #{note,jdbcType=LONGVARCHAR},
#{translation,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.bzgame.server.luigi.dao.domain.Poem">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into poem
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="authorId != null">
author_id,
</if>
<if test="title != null">
title,
</if>
<if test="line != null">
line,
</if>
<if test="status != null">
`status`,
</if>
<if test="content != null">
content,
</if>
<if test="note != null">
note,
</if>
<if test="translation != null">
`translation`,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="authorId != null">
#{authorId,jdbcType=INTEGER},
</if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="line != null">
#{line,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="content != null">
#{content,jdbcType=LONGVARCHAR},
</if>
<if test="note != null">
#{note,jdbcType=LONGVARCHAR},
</if>
<if test="translation != null">
#{translation,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.bzgame.server.luigi.dao.domain.PoemExample" resultType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from poem
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update poem
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.authorId != null">
author_id = #{record.authorId,jdbcType=INTEGER},
</if>
<if test="record.title != null">
title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.line != null">
line = #{record.line,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=LONGVARCHAR},
</if>
<if test="record.note != null">
note = #{record.note,jdbcType=LONGVARCHAR},
</if>
<if test="record.translation != null">
`translation` = #{record.translation,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update poem
set id = #{record.id,jdbcType=INTEGER},
author_id = #{record.authorId,jdbcType=INTEGER},
title = #{record.title,jdbcType=VARCHAR},
line = #{record.line,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=INTEGER},
content = #{record.content,jdbcType=LONGVARCHAR},
note = #{record.note,jdbcType=LONGVARCHAR},
`translation` = #{record.translation,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update poem
set id = #{record.id,jdbcType=INTEGER},
author_id = #{record.authorId,jdbcType=INTEGER},
title = #{record.title,jdbcType=VARCHAR},
line = #{record.line,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.bzgame.server.luigi.dao.domain.Poem">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update poem
<set>
<if test="authorId != null">
author_id = #{authorId,jdbcType=INTEGER},
</if>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="line != null">
line = #{line,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=INTEGER},
</if>
<if test="content != null">
content = #{content,jdbcType=LONGVARCHAR},
</if>
<if test="note != null">
note = #{note,jdbcType=LONGVARCHAR},
</if>
<if test="translation != null">
`translation` = #{translation,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.bzgame.server.luigi.dao.domain.Poem">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update poem
set author_id = #{authorId,jdbcType=INTEGER},
title = #{title,jdbcType=VARCHAR},
line = #{line,jdbcType=VARCHAR},
`status` = #{status,jdbcType=INTEGER},
content = #{content,jdbcType=LONGVARCHAR},
note = #{note,jdbcType=LONGVARCHAR},
`translation` = #{translation,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.bzgame.server.luigi.dao.domain.Poem">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update poem
set author_id = #{authorId,jdbcType=INTEGER},
title = #{title,jdbcType=VARCHAR},
line = #{line,jdbcType=VARCHAR},
`status` = #{status,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

9
luigi-service/pom.xml

@ -11,6 +11,15 @@
<artifactId>luigi-service</artifactId> <artifactId>luigi-service</artifactId>
<dependencies> <dependencies>
<dependency>
<groupId>com.bzgame.server</groupId>
<artifactId>luigi-dao</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.bzgame.server</groupId>
<artifactId>common</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>

42
luigi-service/src/main/java/com/bzgame/server/luigi/service/bo/AuthorService.java

@ -0,0 +1,42 @@
package com.bzgame.server.luigi.service.bo;
import com.bzgame.server.luigi.dao.domain.Author;
import com.bzgame.server.luigi.dao.domain.AuthorExample;
import com.bzgame.server.luigi.dao.mapper.AuthorMapper;
import com.bzgame.server.luigi.service.bo.response.CommonList;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author nidaren
*/
@Service
public class AuthorService {
@Resource
private AuthorMapper authorMapper;
public Map<Integer, Author> getByIds(List<Integer> ids) {
AuthorExample example = new AuthorExample();
example.createCriteria().andIdIn(ids);
List<Author> list = authorMapper.selectByExample(example);
return list.stream().collect(Collectors.toMap(Author::getId, x -> x));
}
public Author getById(Integer id) {
return authorMapper.selectByPrimaryKey(id);
}
public CommonList<Author> seek(String authorName) {
AuthorExample example = new AuthorExample();
example.createCriteria().andNameLike(authorName + "%");
List<Author> authors = authorMapper.selectByExample(example);
CommonList<Author> res = new CommonList<>();
res.setTotal(authors.size());
res.setList(authors);
return res;
}
}

83
luigi-service/src/main/java/com/bzgame/server/luigi/service/bo/PoemService.java

@ -0,0 +1,83 @@
package com.bzgame.server.luigi.service.bo;
import com.bczgame.server.common.exception.BizException;
import com.bczgame.server.common.exception.ExceptionCode;
import com.bzgame.server.luigi.dao.domain.Author;
import com.bzgame.server.luigi.dao.domain.Poem;
import com.bzgame.server.luigi.dao.domain.PoemExample;
import com.bzgame.server.luigi.dao.mapper.PoemMapper;
import com.bzgame.server.luigi.service.bo.request.PoemQuery;
import com.bzgame.server.luigi.service.bo.response.CommonList;
import com.bzgame.server.luigi.service.bo.response.PoemBo;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author nidaren
*/
@Service
public class PoemService {
@Resource
private PoemMapper poemMapper;
@Resource
private AuthorService authorService;
public CommonList<PoemBo> query(PoemQuery query) {
PoemExample example = new PoemExample();
PoemExample.Criteria criteria = example.createCriteria();
setQuery(query, criteria);
example.setOffset((query.getCurrent() - 1) * query.getPageSize());
example.setLimit(query.getPageSize());
List<Poem> poems = poemMapper.selectByExampleWithBLOBs(example);
long total = poemMapper.countByExample(example);
CommonList<PoemBo> res = new CommonList<>();
res.setTotal((int) total);
res.setList(convert(poems));
return res;
}
public PoemBo detail(Integer id) {
Poem p = poemMapper.selectByPrimaryKey(id);
Author a = authorService.getById(p.getAuthorId());
PoemBo bo = new PoemBo(p);
bo.setAuthorName(a.getName());
return bo;
}
private List<PoemBo> convert(List<Poem> poems) {
List<Integer> authorIds = poems.stream().map(Poem::getAuthorId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(authorIds)) {
return poems.stream().map(PoemBo::new).collect(Collectors.toList());
}
Map<Integer, Author> aMap = authorService.getByIds(authorIds);
return poems.stream().map(x -> {
PoemBo bo = new PoemBo(x);
bo.setAuthorName(aMap.get(x.getAuthorId()).getName());
return bo;
}).collect(Collectors.toList());
}
private void setQuery(PoemQuery query, PoemExample.Criteria criteria) {
if (CollectionUtils.isEmpty(query.getQuery())) {
return;
}
query.getQuery().forEach(x -> {
switch (x.getKey()) {
case "authorId":
criteria.andAuthorIdEqualTo(Integer.valueOf(x.getVal()));
break;
case "status":
criteria.andStatusEqualTo(Integer.valueOf(x.getVal()));
break;
default:
throw new BizException(ExceptionCode.PARAM_ILLEGAL_WARN, "参数非法");
}
});
}
}

57
luigi-service/src/main/java/com/bzgame/server/luigi/service/bo/request/PoemQuery.java

@ -0,0 +1,57 @@
package com.bzgame.server.luigi.service.bo.request;
import java.util.List;
/**
* @author nidaren
*/
public class PoemQuery {
private List<QueryParam> query;
private int pageSize;
private int current;
public static class QueryParam {
private String key;
private String val;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getVal() {
return val;
}
public void setVal(String val) {
this.val = val;
}
}
public List<QueryParam> getQuery() {
return query;
}
public void setQuery(List<QueryParam> query) {
this.query = query;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getCurrent() {
return current;
}
public void setCurrent(int current) {
this.current = current;
}
}

45
luigi-service/src/main/java/com/bzgame/server/luigi/service/bo/response/CommonList.java

@ -0,0 +1,45 @@
package com.bzgame.server.luigi.service.bo.response;
import java.util.List;
/**
* @author nidaren
*/
public class CommonList<T> {
private List<T> list;
private Integer total;
private Integer pageSize;
private Integer current;
public List<T> getList() {
return list;
}
public void setList(List<T> list) {
this.list = list;
}
public Integer getTotal() {
return total;
}
public void setTotal(Integer total) {
this.total = total;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public Integer getCurrent() {
return current;
}
public void setCurrent(Integer current) {
this.current = current;
}
}

26
luigi-service/src/main/java/com/bzgame/server/luigi/service/bo/response/PoemBo.java

@ -0,0 +1,26 @@
package com.bzgame.server.luigi.service.bo.response;
import com.bzgame.server.luigi.dao.domain.Poem;
import org.springframework.beans.BeanUtils;
/**
* @author nidaren
*/
public class PoemBo extends Poem {
private String authorName;
public PoemBo() {
}
public PoemBo(Poem p) {
BeanUtils.copyProperties(p, this);
}
public String getAuthorName() {
return authorName;
}
public void setAuthorName(String authorName) {
this.authorName = authorName;
}
}

53
luigi-service/src/main/java/com/bzgame/server/luigi/service/bo/response/UserBo.java

@ -0,0 +1,53 @@
package com.bzgame.server.luigi.service.bo.response;
/**
* @author nidaren
*/
public class UserBo {
private Integer id;
private String name;
private String avatar;
private String role;
public UserBo() {
}
public UserBo(Integer id, String name, String avatar, String role) {
this.id = id;
this.name = name;
this.avatar = avatar;
this.role = role;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
}

7
pom.xml

@ -84,6 +84,13 @@
<artifactId>jedis</artifactId> <artifactId>jedis</artifactId>
<version>2.9.0</version> <version>2.9.0</version>
</dependency> </dependency>
<!-- swagger -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<build> <build>

Loading…
Cancel
Save