master
周文涛 2 years ago
parent ace0c13502
commit 665300c2b0

@ -39,6 +39,8 @@ public class Main {
private static String bussi_entity_vo_template = "XXXEntityVO.javai";
private static String bussi_entity_add_vo_template = "XXXEntityAddPVO.javai";
private static String bussi_entity_edit_vo_template = "XXXEntityEditPVO.javai";
private static String bussi_entity_query_vo_template = "XXXEntityQueryVO.javai";
//mapper模板
private static String bussi_mapper_template = "XXXMapper.javai";
@ -109,10 +111,12 @@ public class Main {
MarkerGenerate.generate(templatepath, bussi_entity_dto_template, dtoParsePath, entityName + "DTO.java", dataMap);
String voParsePath = parsePath + "vo" + File.separator;
MarkerGenerate.generate(templatepath, bussi_entity_vo_template, voParsePath, entityName + "VO.java", dataMap);
//add_pvo
MarkerGenerate.generate(templatepath, bussi_entity_add_vo_template, voParsePath, "Add"+entityName + "PVO.java", dataMap);
//edit_pvo
MarkerGenerate.generate(templatepath, bussi_entity_edit_vo_template, voParsePath, "Edit"+entityName + "PVO.java", dataMap);
//query_pvo
MarkerGenerate.generate(templatepath, bussi_entity_query_vo_template, voParsePath, "Query"+entityName + "VO.java", dataMap);
//生成Mapper
String mapperParsePath = parsePath + "mapper" + File.separator;

@ -10,6 +10,7 @@ import ${bussiPackage}.dto.${entityName}DTO;
import ${bussiPackage}.vo.${entityName}VO;
import ${bussiPackage}.vo.Add${entityName}PVO;
import ${bussiPackage}.vo.Edit${entityName}PVO;
import ${bussiPackage}.vo.Query${entityName}VO;
import ${bussiPackage}.service.I${entityName}Service;
@ -46,7 +47,7 @@ public class ${entityName}Controller extends BaseController {
/**
* 分页
*
* @param ${entityName?uncap_first}
* @param query${entityName}VO
* @param pageNo
* @param pageSize
* @param req
@ -58,7 +59,7 @@ public class ${entityName}Controller extends BaseController {
@ApiImplicitParam(name = "pageSize", value = "分页参数:每页数量", dataType = "String", paramType = "query")
})
@GetMapping(value = "/list")
public TableDataInfo queryPageList(${entityName} ${entityName?uncap_first},
public TableDataInfo queryPageList(Query${entityName}VO query${entityName}VO,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {

@ -0,0 +1,48 @@
package ${bussiPackage}.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @Description: 查询${entityName}对象
* @Author: ${author}
* @Date: ${.now?string["yyyy-MM-dd"]}
* @Version: V1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="查询${entityName}对象", description="${tableVo.ftlDescription}")
public class Query${entityName}VO implements Serializable{
<#list originalColumns as po>
/**${po.filedComment}*/
<#if po.fieldName == primaryKeyField>
<#else>
<#if po.fieldType =='Date'>
<#if po.fieldDbType =='date'>
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
<#elseif po.fieldDbType =='datetime'>
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
<#elseif po.fieldDbType =='timestamp'>
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
</#if>
<#else>
</#if>
</#if>
@ApiModelProperty(value = "${po.filedComment}")
<#if po.fieldName == 'delFlag'>
</#if>
private <#if po.fieldType=='java.sql.Blob'>byte[]<#else>${po.fieldType}</#if> ${po.fieldName};
</#list>
}
Loading…
Cancel
Save