Commit cd440901 by Mark

更新模板到renren-fast3.0

parent e60b6e65
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar
*.iml
.idea
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
......@@ -32,4 +32,31 @@ longtext=String
date=Date
datetime=Date
timestamp=Date
\ No newline at end of file
timestamp=Date
NUMBER=Integer
INT=Integer
INTEGER=Integer
BINARY_INTEGER=Integer
LONG=String
FLOAT=Float
BINARY_FLOAT=Float
DOUBLE=Double
BINARY_DOUBLE=Double
DECIMAL=BigDecimal
CHAR=String
VARCHAR=String
VARCHAR2=String
NVARCHAR=String
NVARCHAR2=String
CLOB=String
BLOB=String
DATE=Date
DATETIME=Date
TIMESTAMP=Date
TIMESTAMP(6)=Date
int8=Long
int4=Integer
int2=Integer
numeric=BigDecimal
\ No newline at end of file
......@@ -49,7 +49,7 @@ public class ${className}Controller {
@RequestMapping("/info/{${pk.attrname}}")
@RequiresPermissions("${moduleName}:${pathName}:info")
public R info(@PathVariable("${pk.attrname}") ${pk.attrType} ${pk.attrname}){
${className}Entity ${classname} = ${classname}Service.selectById(${pk.attrname});
${className}Entity ${classname} = ${classname}Service.getById(${pk.attrname});
return R.ok().put("${classname}", ${classname});
}
......@@ -60,7 +60,7 @@ public class ${className}Controller {
@RequestMapping("/save")
@RequiresPermissions("${moduleName}:${pathName}:save")
public R save(@RequestBody ${className}Entity ${classname}){
${classname}Service.insert(${classname});
${classname}Service.save(${classname});
return R.ok();
}
......@@ -71,7 +71,7 @@ public class ${className}Controller {
@RequestMapping("/update")
@RequiresPermissions("${moduleName}:${pathName}:update")
public R update(@RequestBody ${className}Entity ${classname}){
${classname}Service.updateById(${classname});
${classname}Service.updateById(${classname});
return R.ok();
}
......@@ -82,7 +82,7 @@ public class ${className}Controller {
@RequestMapping("/delete")
@RequiresPermissions("${moduleName}:${pathName}:delete")
public R delete(@RequestBody ${pk.attrType}[] ${pk.attrname}s){
${classname}Service.deleteBatchIds(Arrays.asList(${pk.attrname}s));
${classname}Service.removeByIds(Arrays.asList(${pk.attrname}s));
return R.ok();
}
......
package ${package}.${moduleName}.dao;
import ${package}.${moduleName}.entity.${className}Entity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
......
package ${package}.${moduleName}.entity;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
#if(${hasBigDecimal})
import java.math.BigDecimal;
#end
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ${comments}
......@@ -16,6 +17,7 @@ import java.util.Date;
* @email ${email}
* @date ${datetime}
*/
@Data
@TableName("${tableName}")
public class ${className}Entity implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -30,18 +32,4 @@ public class ${className}Entity implements Serializable {
private $column.attrType $column.attrname;
#end
#foreach ($column in $columns)
/**
* 设置:${column.comments}
*/
public void set${column.attrName}($column.attrType $column.attrname) {
this.$column.attrname = $column.attrname;
}
/**
* 获取:${column.comments}
*/
public $column.attrType get${column.attrName}() {
return $column.attrname;
}
#end
}
package ${package}.${moduleName}.service;
import com.baomidou.mybatisplus.service.IService;
import com.baomidou.mybatisplus.extension.service.IService;
import ${mainPath}.common.utils.PageUtils;
import ${package}.${moduleName}.entity.${className}Entity;
......
......@@ -2,9 +2,9 @@ package ${package}.${moduleName}.service.impl;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import ${mainPath}.common.utils.PageUtils;
import ${mainPath}.common.utils.Query;
......@@ -18,12 +18,12 @@ public class ${className}ServiceImpl extends ServiceImpl<${className}Dao, ${clas
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<${className}Entity> page = this.selectPage(
new Query<${className}Entity>(params).getPage(),
new EntityWrapper<${className}Entity>()
IPage<${className}Entity> page = this.page(
new Query<${className}Entity>().getPage(params),
new QueryWrapper<${className}Entity>()
);
return new PageUtils(page);
}
}
}
\ No newline at end of file
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