处理问题

This commit is contained in:
wanggeng888 2021-03-15 19:02:07 +08:00
parent 9db10a9a58
commit 69bdcf451a
12 changed files with 103 additions and 91 deletions

View File

@ -3,6 +3,7 @@ package ink.wgink.code.factory.factory;
import com.sun.deploy.uitoolkit.impl.fx.ui.FXUIFactory;
import ink.wgink.code.factory.vos.FieldVO;
import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
@ -34,6 +35,7 @@ public class CheckBoxTableCellFactory implements Callback<TableColumn.CellDataFe
@Override
public ObservableValue<CheckBox> call(TableColumn.CellDataFeatures<FieldVO, String> param) {
FieldVO fieldVO = param.getValue();
CheckBox checkBox = new CheckBox();
if (StringUtils.equals(IS_FORM_SHOW, property)) {
Boolean isFormShow = param.getValue().getFormShow();
@ -47,6 +49,17 @@ public class CheckBoxTableCellFactory implements Callback<TableColumn.CellDataFe
Boolean isNotNull = param.getValue().getNotNull();
checkBox.setSelected(isNotNull == null || !isNotNull ? false : true);
}
checkBox.selectedProperty().addListener((observable, oldValue, newValue) -> {
if (StringUtils.equals(IS_FORM_SHOW, property)) {
fieldVO.setFormShow(newValue);
}
if (StringUtils.equals(IS_LIST_SHOW, property)) {
fieldVO.setListShow(newValue);
}
if (StringUtils.equals(IS_NOT_NULL, property)) {
fieldVO.setNotNull(newValue);
}
});
return new ReadOnlyObjectWrapper<>(checkBox);
}
}

View File

@ -110,10 +110,10 @@ public class GenerateService {
mySqlMapperCode("/normal/mapper/mysql-mapper.ftl", String.format("%s/mapper/%s", outFolder, tableName), tableName, dataModel);
}
if (generateVO.getHasHtml()) {
htmlCode("/normal/page", String.format("%s/route/%s", outFolder, tableName), tableName, dataModel);
htmlCode("/normal/page", String.format("%s/static/route/%s", outFolder, tableName), tableName, dataModel);
}
if (generateVO.getHasThymeleaf()) {
thymeleafCode("/normal/page", String.format("%s/route/%s", outFolder, tableName), tableName, dataModel);
thymeleafCode("/normal/page", String.format("%s/templates/%s", outFolder, tableName), tableName, dataModel);
}
if (generateVO.getHasRoute()) {
routeCode("/normal/controller/route-controller.ftl", String.format("%s/controller/route/%s", outFolder, lowerTableName), firstUpperTableName, dataModel);

View File

@ -2,16 +2,14 @@ package ${codePackage}.controller.api.${lowerTableName};
import ink.wgink.annotation.CheckRequestBodyAnnotation;
import ink.wgink.common.base.DefaultBaseController;
import com.cm.common.constants.ISystemConstant;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.ErrorResult;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.ErrorResult;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultData;
import ink.wgink.pojo.result.SuccessResultList;
import ${codePackage}.pojo.dtos.${lowerTableName}.${firstUpperTableName}DTO;
import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}VO;
import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}BO;
import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}PO;
import ${codePackage}.service.${lowerTableName}.I${firstUpperTableName}Service;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
@ -52,7 +50,7 @@ public class ${firstUpperTableName}Controller extends DefaultBaseController {
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@DeleteMapping("remove/{ids}")
public SuccessResult remove(@PathVariable("ids") String ids) {
${firstLowerTableName}Service.remove(ids);
${firstLowerTableName}Service.remove(Arrays.asList(ids.split("\\_")));
return new SuccessResult();
}

View File

@ -2,12 +2,12 @@ package ${codePackage}.controller.app.api.${lowerTableName};
import ink.wgink.annotation.CheckRequestBodyAnnotation;
import ink.wgink.common.base.DefaultBaseController;
import com.cm.common.constants.ISystemConstant;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.ErrorResult;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.ErrorResult;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultData;
import ink.wgink.pojo.result.SuccessResultList;
import ${codePackage}.pojo.dtos.${lowerTableName}.${firstUpperTableName}DTO;
import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}VO;
import ${codePackage}.service.${lowerTableName}.I${firstUpperTableName}Service;
@ -54,7 +54,7 @@ public class ${firstUpperTableName}AppController extends DefaultBaseController {
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@DeleteMapping("remove/{ids}")
public SuccessResult remove(@RequestHeader("token") String token, @PathVariable("ids") String ids) {
${firstLowerTableName}Service.remove(token, ids);
${firstLowerTableName}Service.remove(token, Arrays.asList(ids.split("\\_")));
return new SuccessResult();
}
@ -104,7 +104,7 @@ public class ${firstUpperTableName}AppController extends DefaultBaseController {
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listpage${lowerTableName}")
public SuccessResultList<List<${firstUpperTableName}DTO>> listPage(@RequestHeader("token") String token, ListPage page) throws SearchException {
public SuccessResultList<List<${firstUpperTableName}DTO>> listPage(@RequestHeader("token") String token, ListPage page) {
Map<String, Object> params = requestParams();
page.setParams(params);
return ${firstLowerTableName}Service.listPage(page);
@ -113,9 +113,9 @@ public class ${firstUpperTableName}AppController extends DefaultBaseController {
@ApiOperation(value = "${tableExplain}统计", notes = "${tableExplain}统计接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("count")
SuccessResultData<Integer> count() throws SearchException {
SuccessResultData<Integer> count() {
Map<String, Object> params = requestParams();
return return new SuccessResultData<>(${firstLowerTableName}Service.count(params));
return new SuccessResultData<>(${firstLowerTableName}Service.count(params));
}
}

View File

@ -2,12 +2,12 @@ package ${codePackage}.controller.resource.${lowerTableName};
import ink.wgink.annotation.CheckRequestBodyAnnotation;
import ink.wgink.common.base.DefaultBaseController;
import com.cm.common.constants.ISystemConstant;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.ErrorResult;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList;
import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.ErrorResult;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultData;
import ink.wgink.pojo.result.SuccessResultList;
import ${codePackage}.pojo.dtos.${lowerTableName}.${firstUpperTableName}DTO;
import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}VO;
import ${codePackage}.service.${lowerTableName}.I${firstUpperTableName}Service;
@ -54,7 +54,7 @@ public class ${firstUpperTableName}ResourceController extends DefaultBaseControl
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@DeleteMapping("remove/{ids}")
public SuccessResult remove(@PathVariable("ids") String ids) {
${firstLowerTableName}Service.remove(ids);
${firstLowerTableName}Service.remove(Arrays.asList(ids.split("\\_")));
return new SuccessResult();
}
@ -104,7 +104,7 @@ public class ${firstUpperTableName}ResourceController extends DefaultBaseControl
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listpage")
public SuccessResultList<List<${firstUpperTableName}DTO>> listPage(ListPage page) throws SearchException {
public SuccessResultList<List<${firstUpperTableName}DTO>> listPage(ListPage page) {
Map<String, Object> params = requestParams();
page.setParams(params);
return ${firstLowerTableName}Service.listPage(page);
@ -113,9 +113,9 @@ public class ${firstUpperTableName}ResourceController extends DefaultBaseControl
@ApiOperation(value = "${tableExplain}统计", notes = "${tableExplain}统计接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("count")
SuccessResultData<Integer> count() throws SearchException {
SuccessResultData<Integer> count() {
Map<String, Object> params = requestParams();
return return new SuccessResultData<>(${firstLowerTableName}Service.count(params));
return new SuccessResultData<>(${firstLowerTableName}Service.count(params));
}
}

View File

@ -1,14 +1,12 @@
package ${codePackage}.controller.api.${lowerTableName};
package ${codePackage}.controller.route.${lowerTableName};
import ink.wgink.common.base.DefaultBaseController;
import ${codePackage}.pojo.dtos.${lowerTableName}.${firstUpperTableName}DTO;
import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}VO;
import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}BO;
import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}PO;
import ink.wgink.interfaces.consts.ISystemConstant;
import ${codePackage}.service.${lowerTableName}.I${firstUpperTableName}Service;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import java.util.Arrays;
import java.util.List;
@ -24,7 +22,7 @@ import java.util.Map;
@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "${tableExplain}路由")
@RestController
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/${lowerTableName}")
public class ${firstUpperTableName}Controller extends DefaultBaseController {
public class ${firstUpperTableName}RouteController extends DefaultBaseController {
@GetMapping("save")
public ModelAndView save() {

View File

@ -4,8 +4,8 @@ import ink.wgink.exceptions.RemoveException;
import ink.wgink.exceptions.SaveException;
import ink.wgink.exceptions.SearchException;
import ink.wgink.exceptions.UpdateException;
import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}BO;
import ${codePackage}.pojo.vos.${lowerTableName}.${firstUpperTableName}PO;
import ${codePackage}.pojo.bos.${lowerTableName}.${firstUpperTableName}BO;
import ${codePackage}.pojo.pos.${lowerTableName}.${firstUpperTableName}PO;
import ${codePackage}.pojo.dtos.${lowerTableName}.${firstUpperTableName}DTO;
import org.springframework.stereotype.Repository;

View File

@ -15,24 +15,26 @@ import io.swagger.annotations.ApiModelProperty;
public class ${firstUpperTableName}DTO {
<#list fieldList! as field>
<#if field.formFieldValue == "number">
<#if field.listShow>
<#if field.formFieldValue == "number">
@ApiModelProperty(name = "${field.propertyName}", value = "${field.columnComment}")
private Integer ${field.propertyName};
<#elseif field.formFieldValue == "double">
<#elseif field.formFieldValue == "double">
@ApiModelProperty(name = "${field.propertyName}", value = "${field.columnComment}")
private Double ${field.propertyName};
<#elseif field.formFieldValue == "radio" || field.formFieldValue == "checkbox" || field.formFieldValue == "select">
<#elseif field.formFieldValue == "radio" || field.formFieldValue == "checkbox" || field.formFieldValue == "select">
@ApiModelProperty(name = "${field.propertyName}", value = "${field.columnComment}")
private String ${field.propertyName};
<#else>
<#else>
@ApiModelProperty(name = "${field.propertyName}", value = "${field.columnComment}")
private String ${field.propertyName};
</#if>
</#if>
</#list>
<#list fieldList! as field>
<#if field.formFieldValue == "number">
<#if field.listShow>
<#if field.formFieldValue == "number">
public Integer get${field.firstUpperPropertyName}() {
return ${field.propertyName} == null ? 0 : ${field.propertyName};
}
@ -41,7 +43,7 @@ public class ${firstUpperTableName}DTO {
this.${field.propertyName} = ${field.propertyName};
}
<#elseif field.formFieldValue == "double">
<#elseif field.formFieldValue == "double">
public Double get${field.firstUpperPropertyName}() {
return ${field.propertyName} == null ? 0D : ${field.propertyName};
}
@ -50,7 +52,7 @@ public class ${firstUpperTableName}DTO {
this.${field.propertyName} = ${field.propertyName};
}
<#elseif field.formFieldValue == "radio" || field.formFieldValue == "checkbox" || field.formFieldValue == "select">
<#elseif field.formFieldValue == "radio" || field.formFieldValue == "checkbox" || field.formFieldValue == "select">
public String get${field.firstUpperPropertyName}() {
return ${field.propertyName} == null ? "" : ${field.propertyName}.trim();
}
@ -59,7 +61,7 @@ public class ${firstUpperTableName}DTO {
this.${field.propertyName} = ${field.propertyName};
}
<#else>
<#else>
public String get${field.firstUpperPropertyName}() {
return ${field.propertyName} == null ? "" : ${field.propertyName}.trim();
}
@ -68,6 +70,7 @@ public class ${firstUpperTableName}DTO {
this.${field.propertyName} = ${field.propertyName};
}
</#if>
</#if>
</#list>

View File

@ -8,7 +8,6 @@ package ${codePackage}.pojo.pos.${lowerTableName};
* @Date: ${date}
* @Version: ${version}
**/
@ApiModel
public class ${firstUpperTableName}PO {
<#list fieldList! as field>

View File

@ -17,47 +17,50 @@ import io.swagger.annotations.ApiModelProperty;
public class ${firstUpperTableName}VO {
<#list fieldList! as field>
<#if field.formShow>
@ApiModelProperty(name = "${field.propertyName}", value = "${field.columnComment}")
<#if field.formFieldValue == "number">
<#if field.formFieldValue == "number">
@CheckNumberAnnotation(name = "${field.columnComment}")
private Integer ${field.propertyName};
<#elseif field.formFieldValue == "double">
<#elseif field.formFieldValue == "double">
@CheckNumberAnnotation(name = "${field.columnComment}")
private Double ${field.propertyName};
<#elseif field.formFieldValue == "date">
<#elseif field.formFieldValue == "date">
@CheckEmptyAnnotation(name = "${field.columnComment}", verifyType = "date")
private String ${field.propertyName};
<#elseif field.formFieldValue == "datetime">
<#elseif field.formFieldValue == "datetime">
@CheckEmptyAnnotation(name = "${field.columnComment}", verifyType = "datetime")
private String ${field.propertyName};
<#else>
<#if field.formFieldValue == "string">
<#if field.verifyType?? && field.verifyType != "none">
<#if field.verifyType == "phone">
<#else>
<#if field.formFieldValue == "string">
<#if field.verifyType?? && field.verifyType != "none">
<#if field.verifyType == "phone">
@CheckEmptyAnnotation(name = "${field.columnComment}", verifyType = "phone")
<#elseif field.verifyType == "email">
<#elseif field.verifyType == "email">
@CheckEmptyAnnotation(name = "${field.columnComment}", verifyType = "email")
<#elseif field.verifyType == "url">
<#elseif field.verifyType == "url">
@CheckEmptyAnnotation(name = "${field.columnComment}", verifyType = "url")
<#elseif field.verifyType == "number">
<#elseif field.verifyType == "number">
@CheckEmptyAnnotation(name = "${field.columnComment}", verifyType = "number")
<#elseif field.verifyType == "date">
<#elseif field.verifyType == "date">
@CheckEmptyAnnotation(name = "${field.columnComment}", verifyType = "date")
<#elseif field.verifyType == "identity">
<#elseif field.verifyType == "identity">
@CheckEmptyAnnotation(name = "${field.columnComment}", verifyType = "identity")
<#elseif field.verifyType == "custom">
<#elseif field.verifyType == "custom">
@CheckEmptyAnnotation(name = "${field.columnComment}", verifyType = "custom", regex = "${field.verifyType}")
<#elseif field.verifyType == "required">
<#elseif field.verifyType == "required">
@CheckEmptyAnnotation(name = "${field.columnComment}")
</#if>
</#if>
</#if>
</#if>
private String ${field.propertyName};
</#if>
</#if>
</#list>
<#list fieldList! as field>
<#if field.formFieldValue == "number">
<#if field.formShow>
<#if field.formFieldValue == "number">
public Integer get${field.firstUpperPropertyName}() {
return ${field.propertyName} == null ? 0 : ${field.propertyName};
}
@ -66,7 +69,7 @@ public class ${firstUpperTableName}VO {
this.${field.propertyName} = ${field.propertyName};
}
<#elseif field.formFieldValue == "double">
<#elseif field.formFieldValue == "double">
public Double get${field.firstUpperPropertyName}() {
return ${field.propertyName} == null ? 0D : ${field.propertyName};
}
@ -75,7 +78,7 @@ public class ${firstUpperTableName}VO {
this.${field.propertyName} = ${field.propertyName};
}
<#elseif field.formFieldValue == "date" || field.formFieldValue == "datetime">
<#elseif field.formFieldValue == "date" || field.formFieldValue == "datetime">
public String get${field.firstUpperPropertyName}() {
return ${field.propertyName} == null ? "" : ${field.propertyName}.trim();
}
@ -84,7 +87,7 @@ public class ${firstUpperTableName}VO {
this.${field.propertyName} = ${field.propertyName};
}
<#else>
<#else>
public String get${field.firstUpperPropertyName}() {
return ${field.propertyName} == null ? "" : ${field.propertyName}.trim();
}
@ -93,6 +96,7 @@ public class ${firstUpperTableName}VO {
this.${field.propertyName} = ${field.propertyName};
}
</#if>
</#if>
</#list>

View File

@ -75,7 +75,6 @@ public interface I${firstUpperTableName}Service {
* 删除${tableExplain}(物理删除)
*
* @param ids id列表
* @throws RemoveException
*/
void delete(List<String> ids);
@ -175,7 +174,6 @@ public interface I${firstUpperTableName}Service {
*
* @param page
* @return
* @throws SearchException
*/
SuccessResultList<List<${firstUpperTableName}DTO>> listPage(ListPage page);
@ -184,7 +182,6 @@ public interface I${firstUpperTableName}Service {
*
* @param params
* @return
* @throws SearchException
*/
Integer count(Map<String, Object> params);

View File

@ -4,7 +4,7 @@ import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.pojo.utils.HashMapUtil;
import ink.wgink.util.map.HashMapUtil;
import ink.wgink.util.UUIDUtil;
import ${codePackage}.dao.${lowerTableName}.I${firstUpperTableName}Dao;
import ${codePackage}.pojo.dtos.${lowerTableName}.${firstUpperTableName}DTO;
@ -34,12 +34,12 @@ public class ${firstUpperTableName}ServiceImpl extends DefaultBaseService implem
private I${firstUpperTableName}Dao ${firstLowerTableName}Dao;
@Override
public SuccessResult save(${firstUpperTableName}VO ${firstLowerTableName}VO) {
public void save(${firstUpperTableName}VO ${firstLowerTableName}VO) {
saveReturnId(${firstLowerTableName}VO);
}
@Override
public SuccessResult save(String token, ${firstUpperTableName}VO ${firstLowerTableName}VO) {
public void save(String token, ${firstUpperTableName}VO ${firstLowerTableName}VO) {
saveReturnId(token, ${firstLowerTableName}VO);
}
@ -63,20 +63,20 @@ public class ${firstUpperTableName}ServiceImpl extends DefaultBaseService implem
}
@Override
public void remove(String ids) {
public void remove(List<String> ids) {
remove(null, ids);
}
@Override
public void remove(String token, String ids) {
public void remove(String token, List<String> ids) {
Map<String, Object> params = getHashMap(2);
params.put("${firstLowerTableName}Ids", ids);
if (StringUtils.isBlank(token)) {
setUpdateInfo(params);
} else {
setAppUpdateInfo(params, token);
setAppUpdateInfo(token, params);
}
userDao.remove(params);
${firstLowerTableName}Dao.remove(params);
}
@Override
@ -104,58 +104,58 @@ public class ${firstUpperTableName}ServiceImpl extends DefaultBaseService implem
}
@Override
public ${firstUpperTableName}DTO get(Map<String, Object> params) throws SearchException {
public ${firstUpperTableName}DTO get(Map<String, Object> params) {
return ${firstLowerTableName}Dao.get(params);
}
@Override
public ${firstUpperTableName}DTO get(String ${firstLowerTableName}Id) throws SearchException {
public ${firstUpperTableName}DTO get(String ${firstLowerTableName}Id) {
Map<String, Object> params = super.getHashMap(2);
params.put("${firstLowerTableName}Id", ${firstLowerTableName}Id);
return get(params);
}
@Override
public ${firstUpperTableName}BO getBO(Map<String, Object> params) throws SearchException {
public ${firstUpperTableName}BO getBO(Map<String, Object> params) {
return ${firstLowerTableName}Dao.getBO(params);
}
@Override
public ${firstUpperTableName}BO getBO(String ${firstLowerTableName}Id) throws SearchException {
public ${firstUpperTableName}BO getBO(String ${firstLowerTableName}Id) {
Map<String, Object> params = super.getHashMap(2);
params.put("${firstLowerTableName}Id", ${firstLowerTableName}Id);
return getBO(params);
}
@Override
public ${firstUpperTableName}PO getPO(Map<String, Object> params) throws SearchException {
public ${firstUpperTableName}PO getPO(Map<String, Object> params) {
return ${firstLowerTableName}Dao.getPO(params);
}
@Override
public ${firstUpperTableName}PO getPO(String ${firstLowerTableName}Id) throws SearchException {
public ${firstUpperTableName}PO getPO(String ${firstLowerTableName}Id) {
Map<String, Object> params = super.getHashMap(2);
params.put("${firstLowerTableName}Id", ${firstLowerTableName}Id);
return getPO(params);
}
@Override
public List<${firstUpperTableName}DTO> list(Map<String, Object> params) throws SearchException {
public List<${firstUpperTableName}DTO> list(Map<String, Object> params) {
return ${firstLowerTableName}Dao.list(params);
}
@Override
public List<${firstUpperTableName}BO> listBO(Map<String, Object> params) throws SearchException {
public List<${firstUpperTableName}BO> listBO(Map<String, Object> params) {
return ${firstLowerTableName}Dao.listBO(params);
}
@Override
public List<${firstUpperTableName}PO> listPO(Map<String, Object> params) throws SearchException {
public List<${firstUpperTableName}PO> listPO(Map<String, Object> params) {
return ${firstLowerTableName}Dao.listPO(params);
}
@Override
public SuccessResultList<List<${firstUpperTableName}DTO>> listPage(ListPage page) throws SearchException {
public SuccessResultList<List<${firstUpperTableName}DTO>> listPage(ListPage page) {
PageHelper.startPage(page.getPage(), page.getRows());
List<${firstUpperTableName}DTO> ${firstLowerTableName}DTOs = list(page.getParams());
PageInfo<${firstUpperTableName}DTO> pageInfo = new PageInfo<>(${firstLowerTableName}DTOs);
@ -163,8 +163,8 @@ public class ${firstUpperTableName}ServiceImpl extends DefaultBaseService implem
}
@Override
public Integer count(Map<String, Object> params) throws SearchException {
Integer count = ${firstLowerTableName}Dao.count${firstUpperTableName}(params);
public Integer count(Map<String, Object> params) {
Integer count = ${firstLowerTableName}Dao.count(params);
return count == null ? 0 : count;
}