mirror of
https://github.com/moshowgame/SpringBootCodeGenerator.git
synced 2026-09-09 18:59:42 +08:00
v3.0 beta version
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
<#if isAutoImport?exists && isAutoImport==true>
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -5,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
</#if>
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
* @author ${authorName}
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
<#if isAutoImport?exists && isAutoImport==true>
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
</#if>
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
* @author ${authorName}
|
||||
* @date ${.now?string('yyyy-MM-dd')}
|
||||
*/
|
||||
@Data<#if swagger?exists && swagger==true>
|
||||
@Data<#if isSwagger?exists && isSwagger==true>
|
||||
@ApiModel("${classInfo.classComment}")</#if>
|
||||
public class ${classInfo.className} implements Serializable {
|
||||
|
||||
@@ -16,9 +17,9 @@ public class ${classInfo.className} implements Serializable {
|
||||
|
||||
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
||||
<#list classInfo.fieldList as fieldItem >
|
||||
/**
|
||||
<#if isComment?exists && isComment==true>/**
|
||||
* ${fieldItem.fieldComment}
|
||||
*/<#if swagger?exists && swagger==true>
|
||||
*/</#if><#if isSwagger?exists && isSwagger==true>
|
||||
@ApiModelProperty("${fieldItem.fieldComment}")</#if>
|
||||
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
<#if isAutoImport?exists && isAutoImport==true>
|
||||
import java.util.List;
|
||||
|
||||
</#if>
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
* @author ${authorName}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<#if isAutoImport?exists && isAutoImport==true>
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
</#if>
|
||||
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package ${packageName}.entity;
|
||||
<#if isWithPackage?exists && isWithPackage==true>package ${packageName}.entity;</#if>
|
||||
|
||||
import lombok.Data;
|
||||
<#if isAutoImport?exists && isAutoImport==true>
|
||||
<#if isLombok?exists && isLombok==true>import lombok.Data;</#if>
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.io.Serializable;
|
||||
@@ -11,15 +12,15 @@ import javax.persistence.Table;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
</#if>
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
* @author ${authorName}
|
||||
* @date ${.now?string('yyyy-MM-dd')}
|
||||
*/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="${classInfo.tableName}")<#if swagger?exists && swagger==true>
|
||||
<#if isLombok?exists && isLombok==true>@Data</#if>
|
||||
<#if isComment?exists && isComment==true>@Table(name="${classInfo.tableName}")</#if><#if isSwagger?exists && isSwagger==true>
|
||||
@ApiModel("${classInfo.classComment}")</#if>
|
||||
public class ${classInfo.className} implements Serializable {
|
||||
|
||||
@@ -29,11 +30,11 @@ public class ${classInfo.className} implements Serializable {
|
||||
@GeneratedValue
|
||||
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
||||
<#list classInfo.fieldList as fieldItem >
|
||||
/**
|
||||
<#if isComment?exists && isComment==true>/**
|
||||
* ${fieldItem.fieldComment}
|
||||
*/<#if swagger?exists && swagger==true>
|
||||
*/</#if><#if isSwagger?exists && isSwagger==true>
|
||||
@ApiModelProperty("${fieldItem.fieldComment}")</#if>
|
||||
@Column(name="${fieldItem.columnName}")
|
||||
<#if isComment?exists && isComment==true>@Column(name="${fieldItem.columnName}")</#if>
|
||||
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
|
||||
|
||||
</#list>
|
||||
@@ -41,4 +42,13 @@ public class ${classInfo.className} implements Serializable {
|
||||
}
|
||||
</#if>
|
||||
|
||||
<#if isLombok?exists && isLombok==false>
|
||||
public ${fieldItem.fieldClass} get${fieldItem.fieldName?cap_first}() {
|
||||
return ${fieldItem.fieldName};
|
||||
}
|
||||
|
||||
public void set${fieldItem.fieldName?cap_first}(${fieldItem.fieldClass} ${fieldItem.fieldName}) {
|
||||
this.${fieldItem.fieldName} = ${fieldItem.fieldName};
|
||||
}
|
||||
</#if>
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package ${packageName}.controller;
|
||||
|
||||
<#if isWithPackage?exists && isWithPackage==true>package ${packageName}.controller;</#if>
|
||||
<#if isAutoImport?exists && isAutoImport==true>
|
||||
import ${packageName}.entity.${classInfo.className};
|
||||
import ${packageName}.repository.${classInfo.className}Repository;
|
||||
import org.springframework.data.domain.Example;
|
||||
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
</#if>
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
* @author ${authorName}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package ${packageName}.mapper;
|
||||
import ${packageName}.entity.${classInfo.className};
|
||||
<#if isWithPackage?exists && isWithPackage==true>package ${packageName}.mapper;</#if>
|
||||
<#if isAutoImport?exists && isAutoImport==true>import ${packageName}.entity.${classInfo.className};
|
||||
|
||||
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
||||
<#list classInfo.fieldList as fieldItem >
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
</#if>
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
* @author ${authorName}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package ${packageName}.controller;
|
||||
|
||||
<#if isWithPackage?exists && isWithPackage==true>package ${packageName}.controller;</#if>
|
||||
<#if isAutoImport?exists && isAutoImport==true>
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import ${packageName}.entity.${classInfo.className};
|
||||
import ${packageName}.mapper.${classInfo.className}Mapper;
|
||||
@@ -16,7 +16,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
</#if>
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
* @author ${authorName}
|
||||
@@ -120,13 +120,13 @@ public class ${classInfo.className}Controller {
|
||||
}
|
||||
@GetMapping("/list")
|
||||
public ModelAndView listPage(){
|
||||
return new ModelAndView("cms/${classInfo.className?uncap_first}-list");
|
||||
return new ModelAndView("${classInfo.className?uncap_first}-list");
|
||||
}
|
||||
|
||||
@GetMapping("/edit")
|
||||
public ModelAndView editPage(int id){
|
||||
${classInfo.className} ${classInfo.className?uncap_first} = ${classInfo.className?uncap_first}Mapper.selectOne(new QueryWrapper<${classInfo.className}>().eq("${classInfo.className?uncap_first}_id",id));
|
||||
return new ModelAndView("cms/${classInfo.className?uncap_first}-edit","${classInfo.className?uncap_first}",${classInfo.className?uncap_first});
|
||||
return new ModelAndView("${classInfo.className?uncap_first}-edit","${classInfo.className?uncap_first}",${classInfo.className?uncap_first});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -147,6 +147,14 @@ public class ${classInfo.className}Controller {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行(如不需要请屏蔽)
|
||||
*/
|
||||
@PostMapping("/execute")
|
||||
public Object execute(){
|
||||
return ReturnT.SUCCESS();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
package ${packageName}.entity;
|
||||
<#if isWithPackage?exists && isWithPackage==true>package ${packageName}.entity;</#if>
|
||||
|
||||
import lombok.Data;
|
||||
<#if isAutoImport?exists && isAutoImport==true>
|
||||
<#if isLombok?exists && isLombok==true>import lombok.Data;</#if>
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.io.Serializable;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
</#if>
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
* @author ${authorName}
|
||||
* @date ${.now?string('yyyy-MM-dd')}
|
||||
*/
|
||||
@Data<#if swagger?exists && swagger==true>
|
||||
<#if isLombok?exists && isLombok==true>@Data</#if><#if isSwagger?exists && isSwagger==true>
|
||||
@ApiModel("${classInfo.classComment}")</#if>
|
||||
public class ${classInfo.className} implements Serializable {
|
||||
|
||||
@@ -21,15 +22,22 @@ public class ${classInfo.className} implements Serializable {
|
||||
@TableId(type = IdType.AUTO)
|
||||
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
||||
<#list classInfo.fieldList as fieldItem >
|
||||
/**
|
||||
<#if isComment?exists && isComment==true>/**
|
||||
* ${fieldItem.fieldComment}
|
||||
*/<#if swagger?exists && swagger==true>
|
||||
*/</#if><#if isSwagger?exists && isSwagger==true>
|
||||
@ApiModelProperty("${fieldItem.fieldComment}")</#if>
|
||||
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
|
||||
|
||||
</#list>
|
||||
public ${classInfo.className}() {
|
||||
<#if isLombok?exists && isLombok==false>
|
||||
public ${fieldItem.fieldClass} get${fieldItem.fieldName?cap_first}() {
|
||||
return ${fieldItem.fieldName};
|
||||
}
|
||||
|
||||
public void set${fieldItem.fieldName?cap_first}(${fieldItem.fieldClass} ${fieldItem.fieldName}) {
|
||||
this.${fieldItem.fieldName} = ${fieldItem.fieldName};
|
||||
}
|
||||
</#if>
|
||||
|
||||
</#list>
|
||||
</#if>
|
||||
public ${classInfo.className}() {}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package ${packageName}.mapper;
|
||||
|
||||
<#if isWithPackage?exists && isWithPackage==true>package ${packageName}.mapper;</#if>
|
||||
<#if isAutoImport?exists && isAutoImport==true>
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import ${packageName}.entity.${classInfo.className};
|
||||
import java.util.List;
|
||||
|
||||
</#if>
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
* @author ${authorName}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<#if isAutoImport?exists && isAutoImport==true>
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -7,6 +8,7 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
</#if>
|
||||
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<#if isAutoImport?exists && isAutoImport==true>
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import java.util.List;
|
||||
</#if>
|
||||
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package ${packageName}.mapper;
|
||||
|
||||
<#if isWithPackage?exists && isWithPackage==true>package ${packageName}.mapper;</#if>
|
||||
<#if isAutoImport?exists && isAutoImport==true>
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import java.util.List;
|
||||
|
||||
</#if>
|
||||
/**
|
||||
* @description ${classInfo.classComment}Mapper
|
||||
* @author ${authorName}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<#if isAutoImport?exists && isAutoImport==true>
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
</#if>
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
* @author ${authorName}
|
||||
@@ -13,9 +14,9 @@ public class ${classInfo.className} implements Serializable {
|
||||
|
||||
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
||||
<#list classInfo.fieldList as fieldItem >
|
||||
/**
|
||||
<#if isComment?exists && isComment==true>/**
|
||||
* ${fieldItem.fieldComment}
|
||||
*/
|
||||
*/</#if>
|
||||
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
|
||||
|
||||
</#list>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<#if isAutoImport?exists && isAutoImport==true>
|
||||
import java.util.Map;
|
||||
|
||||
</#if>
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
* @author ${authorName}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<#if isAutoImport?exists && isAutoImport==true>
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
</#if>
|
||||
/**
|
||||
* @description ${classInfo.classComment}
|
||||
* @author ${authorName}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
<el-form :inline="true" :model="submitData" class="demo-form-inline" :rules="rules" ref="ruleForm">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="header clearfix">
|
||||
@@ -10,7 +8,7 @@
|
||||
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
||||
<#list classInfo.fieldList as fieldItem >
|
||||
<el-form-item label="${fieldItem.fieldComment}" prop="${fieldItem.fieldName}">
|
||||
<el-input placeholder="${fieldItem.fieldComment}" v-model="submitData.${fieldItem.fieldName}"></el-input>
|
||||
<el-input placeholder="请输入${fieldItem.fieldComment}" v-model="formData.${fieldItem.fieldName}"></el-input>
|
||||
</el-form-item>
|
||||
</#list>
|
||||
</#if>
|
||||
|
||||
@@ -1,19 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>layuimini</title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" href="¥{request.contextPath}/static/lib/layui-v2.5.5/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="¥{request.contextPath}/static/css/public.css" media="all">
|
||||
<style>
|
||||
body {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-form layuimini-form">
|
||||
<input type="hidden" name="${classInfo.className?uncap_first}Id" value="" class="layui-input">
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>layuimini</title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" href="¥{request.contextPath}/static/lib/layui-v2.5.5/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="¥{request.contextPath}/static/css/public.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layuimini-container">
|
||||
<div class="layuimini-main">
|
||||
|
||||
@@ -21,7 +21,7 @@ ${classInfo.className?uncap_first}.set${fieldItem.fieldName?cap_first}(${classIn
|
||||
|
||||
<#list classInfo.fieldList as fieldItem>
|
||||
// ${fieldItem.fieldComment}
|
||||
map.put("${fieldItem.fieldName?cap_first}",${classInfo.className?uncap_first}.get${fieldItem.fieldName?cap_first}());
|
||||
map.put("${fieldItem.fieldName?uncap_first}",${classInfo.className?uncap_first}.get${fieldItem.fieldName?cap_first}());
|
||||
</#list>
|
||||
|
||||
<#list classInfo.fieldList as fieldItem>
|
||||
@@ -35,7 +35,7 @@ map.put("${fieldItem.fieldComment}",${classInfo.className?uncap_first}.get${fiel
|
||||
|
||||
<#list classInfo.fieldList as fieldItem>
|
||||
// ${fieldItem.fieldComment}
|
||||
map.put("${fieldItem.fieldName?cap_first}",${classInfo.className?uncap_first}.get${fieldItem.fieldName?cap_first}());
|
||||
map.put("${fieldItem.fieldName?uncap_first}",${classInfo.className?uncap_first}.get${fieldItem.fieldName?cap_first}());
|
||||
</#list>
|
||||
|
||||
</#if>
|
||||
|
||||
@@ -4,4 +4,10 @@
|
||||
"${fieldItem.fieldName}":"${fieldItem.fieldComment}"<#if fieldItem_has_next>,</#if>
|
||||
</#list>
|
||||
}
|
||||
|
||||
{
|
||||
<#list classInfo.fieldList as fieldItem>
|
||||
"${fieldItem.fieldName}":""<#if fieldItem_has_next>,</#if>
|
||||
</#list>
|
||||
}
|
||||
</#if>
|
||||
|
||||
@@ -1,39 +1,47 @@
|
||||
|
||||
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
||||
SELECT
|
||||
<#list classInfo.fieldList as fieldItem >
|
||||
${fieldItem.columnName}<#if fieldItem_has_next>,</#if>
|
||||
</#list>
|
||||
FROM
|
||||
${classInfo.tableName}
|
||||
WHERE
|
||||
<#list classInfo.fieldList as fieldItem >
|
||||
<#if fieldItem_index != 0>AND </#if>${fieldItem.columnName} = ''
|
||||
</#list>;
|
||||
#SQL横向select
|
||||
SELECT <#list classInfo.fieldList as fieldItem >t.${fieldItem.columnName}<#if fieldItem_has_next>,</#if></#list>
|
||||
FROM ${classInfo.tableName} t;
|
||||
|
||||
#CSV横向字段名
|
||||
<#list classInfo.fieldList as fieldItem >${fieldItem.columnName}<#if fieldItem_has_next>,</#if></#list>
|
||||
</#if>
|
||||
|
||||
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
||||
#LEFT JOIN
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
${classInfo.tableName} t1
|
||||
LEFT JOIN xxx t2
|
||||
ON t1.${classInfo.tableName}_id=t2.${classInfo.tableName}_id
|
||||
${classInfo.tableName} a
|
||||
LEFT JOIN ${classInfo.tableName} b
|
||||
ON a.${classInfo.tableName}_id=b.${classInfo.tableName}_id
|
||||
WHERE 1=1;
|
||||
</#if>
|
||||
|
||||
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
||||
#INSERT INTO
|
||||
INSERT INTO ${classInfo.tableName} ( <#list classInfo.fieldList as fieldItem >${fieldItem.columnName}<#if fieldItem_has_next>,</#if></#list> )
|
||||
VALUES
|
||||
(
|
||||
<#list classInfo.fieldList as fieldItem >
|
||||
''<#if fieldItem_has_next>,</#if>
|
||||
</#list>
|
||||
<#list classInfo.fieldList as fieldItem >''<#if fieldItem_has_next>,</#if></#list>
|
||||
);
|
||||
</#if>
|
||||
|
||||
|
||||
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
||||
#关联更新
|
||||
UPDATE ${classInfo.tableName} a
|
||||
JOIN ${classInfo.tableName}_join b ON a.${classInfo.tableName}_id = b.${classInfo.tableName}_id
|
||||
SET <#list classInfo.fieldList as fieldItem > a.${fieldItem.columnName} = b.${fieldItem.columnName}<#if fieldItem_has_next>,</#if> </#list>
|
||||
WHERE
|
||||
b.${classInfo.tableName}_id IS NOT NULL;
|
||||
|
||||
UPDATE ${classInfo.tableName} a,${classInfo.tableName}_join b
|
||||
SET <#list classInfo.fieldList as fieldItem > a.${fieldItem.columnName} = b.${fieldItem.columnName}<#if fieldItem_has_next>,</#if> </#list>
|
||||
WHERE a.${classInfo.tableName}_id = b.${classInfo.tableName}_id;
|
||||
|
||||
#普通update
|
||||
UPDATE ${classInfo.tableName}
|
||||
SET
|
||||
<#list classInfo.fieldList as fieldItem >
|
||||
@@ -48,6 +56,11 @@
|
||||
|
||||
|
||||
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
||||
#关联删除
|
||||
delete a from ${classInfo.tableName}_del as a inner join ${classInfo.tableName} as b
|
||||
where a.${classInfo.tableName}_id=b.${classInfo.tableName}_id;
|
||||
|
||||
#普通删除
|
||||
DELETE
|
||||
FROM
|
||||
${classInfo.tableName}
|
||||
@@ -55,4 +68,7 @@
|
||||
<#list classInfo.fieldList as fieldItem >
|
||||
${fieldItem.columnName} = ''<#if fieldItem_has_next>,</#if>
|
||||
</#list>;
|
||||
|
||||
</#if>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user