代码生成修改
This commit is contained in:
parent
6ef84a9fe3
commit
bfbd6847d3
|
@ -22,7 +22,7 @@
|
|||
</el-form-item>
|
||||
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
|
||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
||||
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable>
|
||||
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable @change="handleQuery">
|
||||
<el-option
|
||||
v-for="dict in dict.type.${dictType}"
|
||||
:key="dict.value"
|
||||
|
@ -33,7 +33,7 @@
|
|||
</el-form-item>
|
||||
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType)
|
||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
||||
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable>
|
||||
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable @change="handleQuery">
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -125,6 +125,7 @@
|
|||
:sort-orders="orderSorts"
|
||||
:sortable="column.sortable"
|
||||
:show-overflow-tooltip="column.overflow"
|
||||
:width="column.width"
|
||||
>
|
||||
<template slot-scope="d">
|
||||
#foreach($column in $columns)
|
||||
|
@ -382,11 +383,11 @@ export default {
|
|||
columns: [
|
||||
#foreach($column in $columns)
|
||||
#if($column.pk)
|
||||
{key: '${column.javaField}', visible: true, label: '${column.columnComment}', minWidth: null, sortable: true, overflow: false, align: 'center'},
|
||||
{key: '${column.javaField}', visible: true, label: '${column.columnComment}', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
#elseif($column.list && $column.htmlType == "datetime")
|
||||
{key: '${column.javaField}', visible: true, label: '${column.columnComment}', minWidth: "120", sortable: false, overflow: false, align: 'center'},
|
||||
{key: '${column.javaField}', visible: true, label: '${column.columnComment}', minWidth: "120", sortable: false, overflow: false, align: 'center', width: null},
|
||||
#elseif($column.list && "" != $javaField)
|
||||
{key: '${column.javaField}', visible: true, label: '${column.columnComment}', minWidth: null, sortable: true, overflow: false, align: 'center'},
|
||||
{key: '${column.javaField}', visible: true, label: '${column.columnComment}', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
#end
|
||||
#end
|
||||
],
|
||||
|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="${packageName}.mapper.${ClassName}Mapper">
|
||||
|
||||
<resultMap type="${ClassName}VO" id="${ClassName}Result">
|
||||
<resultMap type="${ClassName}VO" id="${ClassName}Result" autoMapping="true">
|
||||
#foreach ($column in $columns)
|
||||
<result property="${column.javaField}" column="${column.columnName}" />
|
||||
#end
|
||||
|
@ -101,15 +101,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<update id="update${ClassName}" parameterType="${ClassName}">
|
||||
update ${tableName}
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $pkColumn.columnName)
|
||||
<if test="data.$column.javaField != null#if($column.javaType == 'String' && $column.required) and data.$column.javaField != ''#end">$column.columnName = #{data.$column.javaField},</if>
|
||||
#end
|
||||
#end
|
||||
<include refid="updateColumns"/>
|
||||
</trim>
|
||||
where ${pkColumn.columnName} = #{data.${pkColumn.javaField}}
|
||||
</update>
|
||||
|
||||
<sql id="updateColumns">
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $pkColumn.columnName)
|
||||
<if test="data.$column.javaField != null#if($column.javaType == 'String' && $column.required) and data.$column.javaField != ''#end">$column.columnName = #{data.$column.javaField},</if>
|
||||
#end
|
||||
#end
|
||||
</sql>
|
||||
|
||||
<delete id="delete${ClassName}By${pkColumn.capJavaField}" parameterType="${pkColumn.javaType}">
|
||||
delete from ${tableName} where ${pkColumn.columnName} = #{${pkColumn.javaField}}
|
||||
</delete>
|
||||
|
|
Loading…
Reference in New Issue
Block a user