Commit b851728c authored by xiemouren's avatar xiemouren

集成平台开发组-优化

parent 684abdaa
......@@ -10,63 +10,59 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
<relativePath/>
</parent>
<!-- 配置java版本(必配)和变量区 -->
<properties>
<java.version>1.8</java.version>
</properties>
<!-- maven项目的依赖配置集(springBoot项目也属于maven管理的项目) -->
<dependencies>
<!--这是勾选springWeb后,项目初始化默认的start-->
<!-- springboot的启动依赖(集成tomcat): 这里是spring-boot-starter-web 而不是 spring-boot-starter -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- springboot的测试依赖-->
<!--swagger2-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<!--lombok-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!--这是勾选springWeb后,项目初始化默认的end-->
<!--这是逆向工程所所需依赖,一共3个包start-->
<!--模板引擎支持依赖包:不配置这个mybatis-plus(逆向)会报错-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
<!--java与mysql链接驱动:
1.当在idea中使用springboot的快捷创建方式时,选中了mysql 和jdbc 那么pom文件中会直接有
2.在application.yml和逆向工程时 会用到
-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!--mybatis-plus-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
<!--这是逆向工程所所需依赖,一共3个包end-->
<!-- 添加oracle驱动依赖 -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4</version>
<version>11.2.0.3</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/ojdbc6-11.2.0.3.jar</systemPath>
</dependency>
<dependency>
<groupId>cn.smallbun.screw</groupId>
<artifactId>screw-core</artifactId>
......@@ -78,12 +74,8 @@
<version>3.4.5</version>
</dependency>
</dependencies>
<!-- maven项目的插件配置集(这是勾选springWeb后,项目初始化默认的) -->
<build>
<plugins>
<plugin>
......@@ -91,74 +83,7 @@
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>cn.smallbun.screw</groupId>
<artifactId>screw-maven-plugin</artifactId>
<version>1.0.3</version>
<dependencies>
<!-- HikariCP -->
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>3.4.5</version>
</dependency>
<!--mysql driver-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.20</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc8</artifactId>
<version>12.2.0.1</version>
</dependency>
</dependencies>
<configuration>
<!--username-->
<username>lowcode</username>
<!--password-->
<password>DSOA</password>
<!--driver-->
<!-- <driverClassName>oracle.jdbc.OracleDriver</driverClassName>-->
<driverClassName>oracle.jdbc.driver.OracleDriver</driverClassName>
<!--
<driverClassName>com.mysql.cj.jdbc.Driver</driverClassName>
-->
<!--jdbc url-->
<jdbcUrl>jdbc:oracle:thin:@10.10.10.112:1521:orcl11g</jdbcUrl>
<!--
<jdbcUrl>jdbc:mysql://41.92.6.5:3306/fire</jdbcUrl>
-->
<!--生成文件类型-->
<fileType>WORD</fileType>
<!--打开文件输出目录-->
<openOutputDir>true</openOutputDir>
<!--生成模板-->
<produceType>freemarker</produceType>
<!--文档名称 为空时:将采用[数据库名称-描述-版本号]作为文档名称-->
<!--<docName>测试文档名称</docName>-->
<!--描述-->
<description>数据库文档生成</description>
<!--版本-->
<version>${project.version}</version>
<!--标题-->
<title>fire数据库文档</title>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
</project>
......@@ -5,29 +5,24 @@ import com.baomidou.mybatisplus.generator.config.*;
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
/**
* @author:yx
* @describe:
* @date:2020-08-17 15:18
*/
class CodeGenerator {
public static void main(String[] args) {
// 代码生成器
AutoGenerator mpg = new AutoGenerator();
AutoGenerator generator = new AutoGenerator();
// 全局配置
GlobalConfig gc = new GlobalConfig();
String projectPath = System.getProperty("user.dir");
//输出文件路径
gc.setOutputDir(projectPath + "/src/main/java");
gc.setAuthor("yuanxing");
//TODO 改动
gc.setAuthor("XGL");
gc.setOpen(false);
gc.setFileOverride(true);
gc.setActiveRecord(true);
gc.setActiveRecord(false);
// XML 二级缓存
gc.setEnableCache(false);
// XML ResultMap
......@@ -35,65 +30,63 @@ class CodeGenerator {
// XML columList
gc.setBaseColumnList(true);
//生成的service接口名字首字母是否为I,这样设置就没有I
gc.setServiceName("%sService");
gc.setServiceName("I%sService");
//实体属性 Swagger2 注解
gc.setSwagger2(true);
mpg.setGlobalConfig(gc);
generator.setGlobalConfig(gc);
// 数据源配置
DataSourceConfig dsc = new DataSourceConfig();
// dsc.setUrl("jdbc:mysql://172.16.13.93:3306/ljdy_device?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone = GMT");
// dsc.setDriverName("com.mysql.cj.jdbc.Driver");
// dsc.setUsername("root");
// dsc.setPassword("root");
// dsc.setUrl("jdbc:oracle:thin:@10.10.10.112:1521:orcl11g");
// dsc.setDriverName("oracle.jdbc.driver.OracleDriver");
// dsc.setUsername("orcldbtest");
// dsc.setPassword("123456");
dsc.setUrl("jdbc:oracle:thin:@10.10.10.139:1521:orcl");
dsc.setDriverName("oracle.jdbc.driver.OracleDriver");
dsc.setUsername("MEDINS");
dsc.setPassword("123456");
mpg.setDataSource(dsc);
// 数据源配置 TODO 改动
DataSourceConfig dataSourceConfig = new DataSourceConfig();
dataSourceConfig.setUrl("jdbc:oracle:thin:@10.10.31.139:1521:orcl");
dataSourceConfig.setDriverName("oracle.jdbc.driver.OracleDriver");
dataSourceConfig.setUsername("HIIP");
dataSourceConfig.setPassword("123456");
generator.setDataSource(dataSourceConfig);
// 包配置
PackageConfig pc = new PackageConfig();
pc.setModuleName("");
pc.setParent("com.cloud.insurance");
//TODO 改动
//pc.setModuleName("base");
//TODO 改动
pc.setParent("com.fxkc.hiip");
pc.setController("controller");
pc.setService("service");
pc.setServiceImpl("service.impl");
pc.setMapper("dao");
pc.setEntity("domain");
mpg.setPackageInfo(pc);
// 自定义配置
InjectionConfig cfg = new InjectionConfig() {
pc.setEntity("entity");
generator.setPackageInfo(pc);
//生成mapper.xml
InjectionConfig injectionConfig = new InjectionConfig() {
@Override
public void initMap() {
// to do nothing
}
};
// 如果模板引擎是 freemarker
String templatePath = "/templates/mapper.xml.ftl";
String mapperTemplatePath = "/templates/mapper.xml.ftl";
// 自定义输出配置
List<FileOutConfig> focList = new ArrayList<>();
List<FileOutConfig> fileOutConfigList = new ArrayList<>();
// 自定义配置会被优先输出
focList.add(new FileOutConfig(templatePath) {
fileOutConfigList.add(new FileOutConfig(mapperTemplatePath) {
@Override
public String outputFile(TableInfo tableInfo) {
// 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
return projectPath + "/src/main/resources/mapper/" + pc.getModuleName()
+ "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
//TODO 改动
// return projectPath + "/src/main/resources/mapper/" + pc.getModuleName() + "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
return projectPath + "/src/main/resources/mapper/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
}
});
cfg.setFileOutConfigList(focList);
mpg.setCfg(cfg);
injectionConfig.setFileOutConfigList(fileOutConfigList);
generator.setCfg(injectionConfig);
// 配置模板
// 配置自定义本地模板
TemplateConfig templateConfig = new TemplateConfig();
templateConfig.setController("templates/my.controller.java");
templateConfig.setService("templates/my.service.java");
templateConfig.setServiceImpl("templates/my.serviceImpl.java");
templateConfig.setMapper("templates/my.mapper.java");
templateConfig.setEntity("templates/my.entity.java");
templateConfig.setXml(null);
mpg.setTemplate(templateConfig);
generator.setTemplate(templateConfig);
// 策略配置
StrategyConfig strategy = new StrategyConfig();
......@@ -103,14 +96,17 @@ class CodeGenerator {
strategy.setColumnNaming(NamingStrategy.underline_to_camel);
//是否使用lombok
strategy.setEntityLombokModel(true);
//是否使用RestController
strategy.setRestControllerStyle(true);
//生成哪些表
strategy.setInclude(new String[] { "TAKE_INVENTORY"});
strategy.setControllerMappingHyphenStyle(true);
strategy.setTablePrefix(pc.getModuleName() + "_");
mpg.setStrategy(strategy);
mpg.setTemplateEngine(new FreemarkerTemplateEngine());
mpg.execute();
//TODO 指定目标表
strategy.setInclude(new String[]{"USER_INFO"});
//true:@RequestMapping使用controllerMappingHyphen,例如:USER_INFO表为user-info
//false:@RequestMapping使用entityPath,例如:USER_INFO表为userInfo
strategy.setControllerMappingHyphenStyle(false);
//strategy.setTablePrefix(pc.getModuleName() + "_");
generator.setStrategy(strategy);
generator.setTemplateEngine(new FreemarkerTemplateEngine());
generator.execute();
}
}
\ No newline at end of file
}
package com.cloud.insurance.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 盘存表 前端控制器
* </p>
*
* @author yuanxing
* @since 2021-11-23
*/
@RestController
@RequestMapping("//take-inventory")
public class TakeInventoryController {
}
package com.cloud.insurance.dao;
import com.cloud.insurance.domain.TakeInventory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 盘存表 Mapper 接口
* </p>
*
* @author yuanxing
* @since 2021-11-23
*/
public interface TakeInventoryMapper extends BaseMapper<TakeInventory> {
}
package com.cloud.insurance.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 盘存表
* </p>
*
* @author yuanxing
* @since 2021-11-23
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("TAKE_INVENTORY")
@ApiModel(value="TakeInventory对象", description="盘存表")
public class TakeInventory extends Model<TakeInventory> {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId("ID")
private String id;
@ApiModelProperty(value = "盘存日期")
@TableField("CREATE_TIME")
private LocalDateTime createTime;
@ApiModelProperty(value = "盘存人")
@TableField("CREATE_USER")
private String createUser;
@ApiModelProperty(value = "盘存前库存量")
@TableField("BEFORE_NUM")
private Long beforeNum;
@ApiModelProperty(value = "盘存后库存量")
@TableField("AFTER_NUM")
private Long afterNum;
@ApiModelProperty(value = "所属定点机构编码")
@TableField("TENANT_ID")
private String tenantId;
@ApiModelProperty(value = "关联库存id")
@TableField("STORE_ID")
private String storeId;
@Override
protected Serializable pkVal() {
return this.id;
}
}
package com.cloud.insurance.service;
import com.cloud.insurance.domain.TakeInventory;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 盘存表 服务类
* </p>
*
* @author yuanxing
* @since 2021-11-23
*/
public interface TakeInventoryService extends IService<TakeInventory> {
}
package com.cloud.insurance.service.impl;
import com.cloud.insurance.domain.TakeInventory;
import com.cloud.insurance.dao.TakeInventoryMapper;
import com.cloud.insurance.service.TakeInventoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 盘存表 服务实现类
* </p>
*
* @author yuanxing
* @since 2021-11-23
*/
@Service
public class TakeInventoryServiceImpl extends ServiceImpl<TakeInventoryMapper, TakeInventory> implements TakeInventoryService {
}
#spring.datasource.url=jdbc:mysql://45.93.1.5:3306/fire?useUnicode=true&characterEncoding=UTF-8&useSSL=false
#spring.datasource.username=root
#spring.datasource.password=123456
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.datasource.xa.properties.useInformationSchema=true
#spring.datasource.url=jdbc:oracle:thin:@10.10.10.112:1521:orcl11g
#spring.datasource.username=lowcode
#spring.datasource.password=DSOA
#spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
#spring.datasource.xa.properties.useInformationSchema=true
spring.datasource.url=jdbc:oracle:thin:@10.10.10.139:1521:orcl
spring.datasource.username=MEDINS
spring.datasource.password=123456
spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.xa.properties.useInformationSchema=true
\ No newline at end of file
<?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.cloud.insurance.dao.PhDoctorMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.cloud.insurance.domain.PhDoctor">
<id column="ID" property="id" />
<result column="DUTY_DOCTOR" property="dutyDoctor" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
ID, DUTY_DOCTOR
</sql>
</mapper>
<?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.cloud.insurance.dao.PhaComAdjustpriceinfoMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.cloud.insurance.domain.PhaComAdjustpriceinfo">
<id column="ID" property="id" />
<result column="SERIAL_CODE" property="serialCode" />
<result column="DRUG_DEPT_CODE" property="drugDeptCode" />
<result column="DRUG_CODE" property="drugCode" />
<result column="DRUG_TYPE" property="drugType" />
<result column="DRUG_QUALITY" property="drugQuality" />
<result column="PRE_RETAIL_PRICE" property="preRetailPrice" />
<result column="PRE_WHOLESALE_PRICE" property="preWholesalePrice" />
<result column="RETAIL_PRICE" property="retailPrice" />
<result column="WHOLESALE_PRICE" property="wholesalePrice" />
<result column="STORE_SUM" property="storeSum" />
<result column="PROFIT_FLAG" property="profitFlag" />
<result column="INURE_TIME" property="inureTime" />
<result column="DD_ADJUST_MARK" property="ddAdjustMark" />
<result column="DS_ADJUST_MARK" property="dsAdjustMark" />
<result column="TRADE_NAME" property="tradeName" />
<result column="SPECS" property="specs" />
<result column="PRODUCER" property="producer" />
<result column="PACK_UNIT" property="packUnit" />
<result column="PACK_QTY" property="packQty" />
<result column="MIN_UNIT" property="minUnit" />
<result column="CURRENT_STATE" property="currentState" />
<result column="ABOLISH_OPER" property="abolishOper" />
<result column="ABOLISH_NAME" property="abolishName" />
<result column="ABOLISH_DATE" property="abolishDate" />
<result column="FILE_NO" property="fileNo" />
<result column="LAST_COMPANYCODE" property="lastCompanycode" />
<result column="LAST_COMPANYNAME" property="lastCompanyname" />
<result column="LAST_INSUM" property="lastInsum" />
<result column="LAST_PURCHASE" property="lastPurchase" />
<result column="LAST_WHOLESALE" property="lastWholesale" />
<result column="LAST_RETAIL" property="lastRetail" />
<result column="LAST_INBILLCODE" property="lastInbillcode" />
<result column="MARK" property="mark" />
<result column="OPER_CODE" property="operCode" />
<result column="OPER_NAME" property="operName" />
<result column="OPER_DATE" property="operDate" />
<result column="ADJUST_BILL_CODE" property="adjustBillCode" />
<result column="GROUP_CODE" property="groupCode" />
<result column="PUR_PROFIT_FLAG" property="purProfitFlag" />
<result column="OPER_FLAG" property="operFlag" />
<result column="BASE_PURCHASE" property="basePurchase" />
<result column="BASE_RETAIL" property="baseRetail" />
<result column="TENANT_ID" property="tenantId" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
ID, SERIAL_CODE, DRUG_DEPT_CODE, DRUG_CODE, DRUG_TYPE, DRUG_QUALITY, PRE_RETAIL_PRICE, PRE_WHOLESALE_PRICE, RETAIL_PRICE, WHOLESALE_PRICE, STORE_SUM, PROFIT_FLAG, INURE_TIME, DD_ADJUST_MARK, DS_ADJUST_MARK, TRADE_NAME, SPECS, PRODUCER, PACK_UNIT, PACK_QTY, MIN_UNIT, CURRENT_STATE, ABOLISH_OPER, ABOLISH_NAME, ABOLISH_DATE, FILE_NO, LAST_COMPANYCODE, LAST_COMPANYNAME, LAST_INSUM, LAST_PURCHASE, LAST_WHOLESALE, LAST_RETAIL, LAST_INBILLCODE, MARK, OPER_CODE, OPER_NAME, OPER_DATE, ADJUST_BILL_CODE, GROUP_CODE, PUR_PROFIT_FLAG, OPER_FLAG, BASE_PURCHASE, BASE_RETAIL, TENANT_ID
</sql>
</mapper>
<?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.cloud.insurance.dao.RefundInfoMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.cloud.insurance.domain.RefundInfo">
<id column="SETL_ID" property="setlId" />
<result column="MDTRT_ID" property="mdtrtId" />
<result column="CLR_OPTINS" property="clrOptins" />
<result column="MEDFEE_SUMAMT" property="medfeeSumamt" />
<result column="SETL_TIME" property="setlTime" />
<result column="FULAMT_OWNPAY_AMT" property="fulamtOwnpayAmt" />
<result column="OVERLMT_SELFPAY" property="overlmtSelfpay" />
<result column="PRESELFPAY_AMT" property="preselfpayAmt" />
<result column="INSCP_SCP_AMT" property="inscpScpAmt" />
<result column="ACT_PAY_DEDC" property="actPayDedc" />
<result column="HIFP_PAY" property="hifpPay" />
<result column="POOL_PROP_SELFPAY" property="poolPropSelfpay" />
<result column="CVLSERV_PAY" property="cvlservPay" />
<result column="HIFES_PAY" property="hifesPay" />
<result column="HIFMI_PAY" property="hifmiPay" />
<result column="HIFOB_PAY" property="hifobPay" />
<result column="MAF_PAY" property="mafPay" />
<result column="OTH_PAY" property="othPay" />
<result column="FUND_PAY_SUMAMT" property="fundPaySumamt" />
<result column="PSN_PAY" property="psnPay" />
<result column="ACCT_PAY" property="acctPay" />
<result column="CASH_PAYAMT" property="cashPayamt" />
<result column="BALC" property="balc" />
<result column="ACCT_MULAID_PAY" property="acctMulaidPay" />
<result column="MEDINS_SETL_ID" property="medinsSetlId" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
SETL_ID, MDTRT_ID, CLR_OPTINS, MEDFEE_SUMAMT, SETL_TIME, FULAMT_OWNPAY_AMT, OVERLMT_SELFPAY, PRESELFPAY_AMT, INSCP_SCP_AMT, ACT_PAY_DEDC, HIFP_PAY, POOL_PROP_SELFPAY, CVLSERV_PAY, HIFES_PAY, HIFMI_PAY, HIFOB_PAY, MAF_PAY, OTH_PAY, FUND_PAY_SUMAMT, PSN_PAY, ACCT_PAY, CASH_PAYAMT, BALC, ACCT_MULAID_PAY, MEDINS_SETL_ID
</sql>
</mapper>
<?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.cloud.insurance.dao.SingInOutMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.cloud.insurance.domain.SingInOut">
<id column="ID" property="id" />
<result column="USER_ID" property="userId" />
<result column="SIGN_TIME" property="signTime" />
<result column="SIGN_TPYE" property="signTpye" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
ID, USER_ID, SIGN_TIME, SIGN_TPYE
</sql>
</mapper>
<?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.cloud.insurance.dao.TakeInventoryMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.cloud.insurance.domain.TakeInventory">
<id column="ID" property="id" />
<result column="CREATE_TIME" property="createTime" />
<result column="CREATE_USER" property="createUser" />
<result column="BEFORE_NUM" property="beforeNum" />
<result column="AFTER_NUM" property="afterNum" />
<result column="TENANT_ID" property="tenantId" />
<result column="STORE_ID" property="storeId" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
ID, CREATE_TIME, CREATE_USER, BEFORE_NUM, AFTER_NUM, TENANT_ID, STORE_ID
</sql>
</mapper>
package ${package.Controller};
import org.springframework.web.bind.annotation.RequestMapping;
<#if restControllerStyle>
import org.springframework.web.bind.annotation.RestController;
<#else>
import org.springframework.stereotype.Controller;
</#if>
<#if superControllerClassPackage??>
import ${superControllerClassPackage};
</#if>
/**
* ${table.comment!} 控制层
*
* @author ${author}
* @since ${date}
*/
<#if restControllerStyle>
@RestController
<#else>
@Controller
</#if>
@RequestMapping("<#if package.ModuleName??>/${package.ModuleName}</#if>/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}</#if>")
<#if kotlin>
class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}()</#if>
<#else>
<#if superControllerClass??>
public class ${table.controllerName} extends ${superControllerClass} {
<#else>
public class ${table.controllerName} {
</#if>
}
</#if>
package ${package.Entity};
<#list table.importPackages as pkg>
import ${pkg};
</#list>
<#if swagger2>
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
</#if>
<#if entityLombokModel>
import lombok.Data;
</#if>
/**
* ${table.comment!}
*
* @author ${author}
* @since ${date}
*/
<#if entityLombokModel>
@Data
</#if>
<#if table.convert>
@TableName("${table.name}")
</#if>
<#if swagger2>
@ApiModel(value="${entity}对象", description="${table.comment!}")
</#if>
<#if superEntityClass??>
public class ${entity} extends ${superEntityClass}<#if activeRecord><${entity}></#if> {
<#elseif activeRecord>
public class ${entity} extends Model<${entity}> {
<#else>
public class ${entity} implements Serializable {
</#if>
private static final long serialVersionUID = 1L;
<#-- ---------- BEGIN 字段循环遍历 ---------->
<#list table.fields as field>
<#if field.keyFlag>
<#assign keyPropertyName="${field.propertyName}"/>
</#if>
<#if field.comment!?length gt 0>
<#if swagger2>
@ApiModelProperty(value = "${field.comment}")
<#else>
/**
* ${field.comment}
*/
</#if>
</#if>
<#if field.keyFlag>
<#-- 主键 -->
<#if field.keyIdentityFlag>
@TableId(value = "${field.name}", type = IdType.AUTO)
<#elseif idType??>
@TableId(value = "${field.name}", type = IdType.${idType})
<#elseif field.convert>
@TableId("${field.name}")
</#if>
<#-- 普通字段 -->
<#elseif field.fill??>
<#-- ----- 存在字段填充设置 ----->
<#if field.convert>
@TableField(value = "${field.name}", fill = FieldFill.${field.fill})
<#else>
@TableField(fill = FieldFill.${field.fill})
</#if>
<#elseif field.convert>
@TableField("${field.name}")
</#if>
<#-- 乐观锁注解 -->
<#if (versionFieldName!"") == field.name>
@Version
</#if>
<#-- 逻辑删除注解 -->
<#if (logicDeleteFieldName!"") == field.name>
@TableLogic
</#if>
private ${field.propertyType} ${field.propertyName};
</#list>
<#------------ END 字段循环遍历 ---------->
<#if !entityLombokModel>
<#list table.fields as field>
<#if field.propertyType == "boolean">
<#assign getprefix="is"/>
<#else>
<#assign getprefix="get"/>
</#if>
public ${field.propertyType} ${getprefix}${field.capitalName}() {
return ${field.propertyName};
}
<#if entityBuilderModel>
public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
<#else>
public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
</#if>
this.${field.propertyName} = ${field.propertyName};
<#if entityBuilderModel>
return this;
</#if>
}
</#list>
</#if>
<#if entityColumnConstant>
<#list table.fields as field>
public static final String ${field.name?upper_case} = "${field.name}";
</#list>
</#if>
<#if activeRecord>
@Override
protected Serializable pkVal() {
<#if keyPropertyName??>
return this.${keyPropertyName};
<#else>
return null;
</#if>
}
</#if>
<#if !entityLombokModel>
@Override
public String toString() {
return "${entity}{" +
<#list table.fields as field>
<#if field_index==0>
"${field.propertyName}=" + ${field.propertyName} +
<#else>
", ${field.propertyName}=" + ${field.propertyName} +
</#if>
</#list>
"}";
}
</#if>
}
package ${package.Mapper};
import ${package.Entity}.${entity};
import ${superMapperClassPackage};
import org.springframework.stereotype.Repository;
/**
* ${table.comment!} 持久层接口
*
* @author ${author}
* @since ${date}
*/
<#if kotlin>
interface ${table.mapperName} : ${superMapperClass}<${entity}>
<#else>
@Repository
public interface ${table.mapperName} extends ${superMapperClass}<${entity}> {
}
</#if>
package ${package.Service};
import ${package.Entity}.${entity};
import ${superServiceClassPackage};
/**
* ${table.comment!} 服务层接口
*
* @author ${author}
* @since ${date}
*/
<#if kotlin>
interface ${table.serviceName} : ${superServiceClass}<${entity}>
<#else>
public interface ${table.serviceName} extends ${superServiceClass}<${entity}> {
}
</#if>
package ${package.ServiceImpl};
import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${package.Service}.${table.serviceName};
import ${superServiceImplClassPackage};
import org.springframework.stereotype.Service;
/**
* ${table.comment!} 服务层实现类
*
* @author ${author}
* @since ${date}
*/
@Service
<#if kotlin>
open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} {
}
<#else>
public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} {
}
</#if>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment