ソースを参照

代码生成器修改

weifanli 3 年 前
コミット
0c73220f03

+ 9 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/TeacherDao.java

@@ -0,0 +1,9 @@
+package com.yonge.cooleshow.biz.dal.dao;
+
+import com.yonge.cooleshow.biz.dal.entity.Teacher;
+import com.yonge.cooleshow.common.dal.BaseDAO;
+
+public interface TeacherDao extends BaseDAO<Integer, Teacher> {
+
+	
+}

+ 9 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/VipCardDao.java

@@ -0,0 +1,9 @@
+package com.yonge.cooleshow.biz.dal.dao;
+
+import com.yonge.cooleshow.biz.dal.entity.VipCard;
+import com.yonge.cooleshow.common.dal.BaseDAO;
+
+public interface VipCardDao extends BaseDAO<Long, VipCard> {
+
+	
+}

+ 148 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/Teacher.java

@@ -0,0 +1,148 @@
+package com.yonge.cooleshow.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 对应数据库表(teacher):
+ */
+public class Teacher {
+
+	@ApiModelProperty(value = "对应user表用户编号",required = false)
+	private Integer userId;
+	
+	@ApiModelProperty(value = "昵称",required = false)
+	private String nickName;
+	
+	@ApiModelProperty(value = "学历",required = false)
+	private String educationBackground;
+	
+	@ApiModelProperty(value = "毕业学校",required = false)
+	private String graduateSchool;
+	
+	@ApiModelProperty(value = "技术职称",required = false)
+	private String technicalTitles;
+	
+	@ApiModelProperty(value = "工作单位",required = false)
+	private String workUnit;
+	
+	@ApiModelProperty(value = "专业技能(支持多个,用逗号分隔),对应科目表编号",required = false)
+	private String subjectId;
+	
+	@ApiModelProperty(value = "入职时间",required = false)
+	private java.util.Date entryDate;
+	
+	@ApiModelProperty(value = "个人介绍",required = false)
+	private String introduction;
+	
+	@ApiModelProperty(value = "备注",required = false)
+	private String memo;
+	
+	@ApiModelProperty(value = "",required = false)
+	private java.util.Date updateTime;
+	
+	@ApiModelProperty(value = "",required = false)
+	private java.util.Date createTime;
+	
+	public void setUserId(Integer userId){
+		this.userId = userId;
+	}
+	
+	public Integer getUserId(){
+		return this.userId;
+	}
+			
+	public void setNickName(String nickName){
+		this.nickName = nickName;
+	}
+	
+	public String getNickName(){
+		return this.nickName;
+	}
+			
+	public void setEducationBackground(String educationBackground){
+		this.educationBackground = educationBackground;
+	}
+	
+	public String getEducationBackground(){
+		return this.educationBackground;
+	}
+			
+	public void setGraduateSchool(String graduateSchool){
+		this.graduateSchool = graduateSchool;
+	}
+	
+	public String getGraduateSchool(){
+		return this.graduateSchool;
+	}
+			
+	public void setTechnicalTitles(String technicalTitles){
+		this.technicalTitles = technicalTitles;
+	}
+	
+	public String getTechnicalTitles(){
+		return this.technicalTitles;
+	}
+			
+	public void setWorkUnit(String workUnit){
+		this.workUnit = workUnit;
+	}
+	
+	public String getWorkUnit(){
+		return this.workUnit;
+	}
+			
+	public void setSubjectId(String subjectId){
+		this.subjectId = subjectId;
+	}
+	
+	public String getSubjectId(){
+		return this.subjectId;
+	}
+			
+	public void setEntryDate(java.util.Date entryDate){
+		this.entryDate = entryDate;
+	}
+	
+	public java.util.Date getEntryDate(){
+		return this.entryDate;
+	}
+			
+	public void setIntroduction(String introduction){
+		this.introduction = introduction;
+	}
+	
+	public String getIntroduction(){
+		return this.introduction;
+	}
+			
+	public void setMemo(String memo){
+		this.memo = memo;
+	}
+	
+	public String getMemo(){
+		return this.memo;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 104 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/VipCard.java

@@ -0,0 +1,104 @@
+package com.yonge.cooleshow.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 对应数据库表(vip_card):
+ */
+public class VipCard {
+
+	@ApiModelProperty(value = "会员卡id",required = false)
+	private Long id;
+	
+	@ApiModelProperty(value = "用户id",required = false)
+	private Long userId;
+	
+	@ApiModelProperty(value = "订单id",required = false)
+	private Long orderId;
+	
+	@ApiModelProperty(value = "时长类型:1、月卡 2、季卡 3、年卡",required = false)
+	private Integer timeType;
+	
+	@ApiModelProperty(value = "会员卡开始时间",required = false)
+	private java.util.Date startTime;
+	
+	@ApiModelProperty(value = "创建时间",required = false)
+	private java.util.Date createTime;
+	
+	@ApiModelProperty(value = "更新时间",required = false)
+	private java.util.Date updateTime;
+	
+	@ApiModelProperty(value = "会员卡结束时间",required = false)
+	private java.util.Date endTime;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setUserId(Long userId){
+		this.userId = userId;
+	}
+	
+	public Long getUserId(){
+		return this.userId;
+	}
+			
+	public void setOrderId(Long orderId){
+		this.orderId = orderId;
+	}
+	
+	public Long getOrderId(){
+		return this.orderId;
+	}
+			
+	public void setTimeType(Integer timeType){
+		this.timeType = timeType;
+	}
+	
+	public Integer getTimeType(){
+		return this.timeType;
+	}
+			
+	public void setStartTime(java.util.Date startTime){
+		this.startTime = startTime;
+	}
+	
+	public java.util.Date getStartTime(){
+		return this.startTime;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	public void setEndTime(java.util.Date endTime){
+		this.endTime = endTime;
+	}
+	
+	public java.util.Date getEndTime(){
+		return this.endTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 8 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/TeacherService.java

@@ -0,0 +1,8 @@
+package com.yonge.cooleshow.biz.dal.service;
+
+import com.yonge.cooleshow.biz.dal.entity.Teacher;
+import com.yonge.cooleshow.common.service.BaseService;
+
+public interface TeacherService extends BaseService<Integer, Teacher> {
+
+}

+ 8 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/VipCardService.java

@@ -0,0 +1,8 @@
+package com.yonge.cooleshow.biz.dal.service;
+
+import com.yonge.cooleshow.biz.dal.entity.VipCard;
+import com.yonge.cooleshow.common.service.BaseService;
+
+public interface VipCardService extends BaseService<Long, VipCard> {
+
+}

+ 23 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TeacherServiceImpl.java

@@ -0,0 +1,23 @@
+package com.yonge.cooleshow.biz.dal.service.impl;
+
+import com.yonge.cooleshow.common.dal.BaseDAO;
+import org.springframework.beans.factory.annotation.Autowired;
+import com.yonge.cooleshow.common.service.impl.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+
+import com.yonge.cooleshow.biz.dal.entity.Teacher;
+import com.yonge.cooleshow.biz.dal.service.TeacherService;
+import com.yonge.cooleshow.biz.dal.dao.TeacherDao;
+
+@Service
+public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher>  implements TeacherService {
+	
+	@Autowired
+	private TeacherDao teacherDao;
+
+	@Override
+	public BaseDAO<Integer, Teacher> getDAO() {
+		return teacherDao;
+	}
+	
+}

+ 23 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/VipCardServiceImpl.java

@@ -0,0 +1,23 @@
+package com.yonge.cooleshow.biz.dal.service.impl;
+
+import com.yonge.cooleshow.common.dal.BaseDAO;
+import org.springframework.beans.factory.annotation.Autowired;
+import com.yonge.cooleshow.common.service.impl.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+
+import com.yonge.cooleshow.biz.dal.entity.VipCard;
+import com.yonge.cooleshow.biz.dal.service.VipCardService;
+import com.yonge.cooleshow.biz.dal.dao.VipCardDao;
+
+@Service
+public class VipCardServiceImpl extends BaseServiceImpl<Long, VipCard>  implements VipCardService {
+	
+	@Autowired
+	private VipCardDao vipCardDao;
+
+	@Override
+	public BaseDAO<Long, VipCard> getDAO() {
+		return vipCardDao;
+	}
+	
+}

+ 44 - 41
toolset/codegen/src/main/java/com/yonge/toolset/crud/CodegenApplication.java

@@ -19,45 +19,48 @@ import com.yonge.toolset.crud.core.db.model.Table;
 @SpringBootApplication
 public class CodegenApplication {
 
-	public static void main(String[] args) throws JAXBException {
-		//SpringApplication.run(CodegenApplication.class, args);
-
-		/*
-		 * Configuration config = new Configuration("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@192.168.10.134:1521:orcl", "margin_gy",
-		 * "margin_gy", null, "margin_gy");
-		 */
-
-		// "src/generateConfigration.xml"
-		GenerateConfiguration genConfig = toObject("src/main/resources/generateConfigration.xml", GenerateConfiguration.class);
-
-		Configuration config = genConfig.getDbConfiguration();
-
-		CrudSessionFactory sessionFactory = config.buildCrudSessionFactory();
-		CrudSession session = sessionFactory.openSession();
-		List<Table> tables = session.getTables();
-		String srcBase = genConfig.getSrcBase();
-		String pojoPackageName = genConfig.getPojoPackageName();
-		String daoPackageName = genConfig.getDaoPackageName();
-		String servicePackageName = genConfig.getServicePackageName();
-		String sqlmapPackageName = genConfig.getSqlmapPackageName();
-		String sqlmapConfigPackageName = genConfig.getSqlmapConfigPackageName();
-		for (Table table : tables) {
-			try {
-				session.reverse(table, srcBase, pojoPackageName, sqlmapPackageName, daoPackageName, servicePackageName);
-			} catch (Exception e) {
-				e.printStackTrace();
-			}
-		}
-		// 生成sqlmapConfig
-		session.generateSqlmapConfig(tables, srcBase, sqlmapConfigPackageName, sqlmapPackageName);
-		session.closeSession();
-	}
-
-	public static <T> T toObject(String systemId, Class<T> clazz) throws JAXBException {
-		JAXBContext jc = JAXBContext.newInstance(clazz);
-		Unmarshaller unmarshaller = jc.createUnmarshaller();
-		StreamSource xml = new StreamSource(systemId);
-		JAXBElement<T> je = unmarshaller.unmarshal(xml, clazz);
-		return je.getValue();
-	}
+    public static void main(String[] args) throws JAXBException {
+        String path = Thread.currentThread().getContextClassLoader().getResource("").getPath();
+
+        //SpringApplication.run(CodegenApplication.class, args);
+
+        /*
+         * Configuration config = new Configuration("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@192.168.10.134:1521:orcl", "margin_gy",
+         * "margin_gy", null, "margin_gy");
+         */
+
+        // "src/generateConfigration.xml"
+        //GenerateConfiguration genConfig = toObject("src/main/resources/generateConfigration.xml", GenerateConfiguration.class);
+        GenerateConfiguration genConfig = toObject(path + "/generateConfigration.xml", GenerateConfiguration.class);
+
+        Configuration config = genConfig.getDbConfiguration();
+
+        CrudSessionFactory sessionFactory = config.buildCrudSessionFactory();
+        CrudSession session = sessionFactory.openSession();
+        List<Table> tables = session.getTables();
+        String srcBase = genConfig.getSrcBase();
+        String pojoPackageName = genConfig.getPojoPackageName();
+        String daoPackageName = genConfig.getDaoPackageName();
+        String servicePackageName = genConfig.getServicePackageName();
+        String sqlmapPackageName = genConfig.getSqlmapPackageName();
+        String sqlmapConfigPackageName = genConfig.getSqlmapConfigPackageName();
+        for (Table table : tables) {
+            try {
+                session.reverse(table, srcBase, pojoPackageName, sqlmapPackageName, daoPackageName, servicePackageName);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        // 生成sqlmapConfig
+        session.generateSqlmapConfig(tables, srcBase, sqlmapConfigPackageName, sqlmapPackageName);
+        session.closeSession();
+    }
+
+    public static <T> T toObject(String systemId, Class<T> clazz) throws JAXBException {
+        JAXBContext jc = JAXBContext.newInstance(clazz);
+        Unmarshaller unmarshaller = jc.createUnmarshaller();
+        StreamSource xml = new StreamSource(systemId);
+        JAXBElement<T> je = unmarshaller.unmarshal(xml, clazz);
+        return je.getValue();
+    }
 }

+ 2 - 2
toolset/codegen/src/main/resources/generateConfigration.xml

@@ -8,10 +8,10 @@
 		<catalog>cooleshow_dev</catalog>
 		<schema>cooleshow_dev</schema>
 	</dbConfiguration>
-	<srcBase>E:\\javabean</srcBase>
+	<srcBase>D:\\java\\javabean</srcBase>
 	<pojoPackageName>com.yonge.cooleshow.biz.dal.entity</pojoPackageName>
 	<daoPackageName>com.yonge.cooleshow.biz.dal.dao</daoPackageName>
-	<servicePackageName>com.yonge.cooleshow.biz.service</servicePackageName>
+	<servicePackageName>com.yonge.cooleshow.biz.dal.service</servicePackageName>
 	<sqlmapPackageName>resources</sqlmapPackageName>
 	<sqlmapConfigPackageName>resources/config</sqlmapConfigPackageName>
 </GenerateConfiguration>

+ 1 - 1
toolset/codegen/src/main/resources/template/dao.ftl

@@ -1,7 +1,7 @@
 [#ftl]
 package ${daoPackageName};
 
-import com.ym.mec.common.dal.BaseDAO;
+import com.yonge.cooleshow.common.dal.BaseDAO
 import ${pojoFullClassName};
 
 public interface ${className}Dao [#if paramType??]extends BaseDAO<${paramType}, ${className}>[/#if] {

+ 1 - 1
toolset/codegen/src/main/resources/template/service.ftl

@@ -2,7 +2,7 @@
 package ${servicePackageName};
 
 import ${pojoFullClassName};
-import com.ym.mec.common.service.BaseService;
+import com.yonge.cooleshow.common.service.BaseService;
 
 public interface ${className}Service extends BaseService<${paramType}, ${className}> {
 

+ 4 - 1
toolset/codegen/src/main/resources/template/service_impl.ftl

@@ -1,8 +1,11 @@
 [#ftl]
 package ${servicePackageName}.impl;
 
+import com.yonge.cooleshow.common.dal.BaseDAO;
 import org.springframework.beans.factory.annotation.Autowired;
-import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.yonge.cooleshow.common.service.impl.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+
 import ${pojoFullClassName};
 import ${servicePackageName}.${className}Service;
 import ${daoPackageName}.${className}Dao;