Commit 49e984ce authored by 赵啸非's avatar 赵啸非

编写系统代码生成模块导入导出

parent 9f6ddcb2
...@@ -78,11 +78,21 @@ public class GentableColumnEntity extends GentableColumnEntityExt { ...@@ -78,11 +78,21 @@ public class GentableColumnEntity extends GentableColumnEntityExt {
*/ */
private Integer isQuery; private Integer isQuery;
/**
* 是否导入导出字段(0否,1 是)
*/
private Integer isExport;
/** /**
* 显示类型(1.文本框、2.文本域、3.下拉框、4.复选框、5.单选框、6.日期控件) * 显示类型(1.文本框、2.文本域、3.下拉框、4.复选框、5.单选框、6.日期控件)
*/ */
private Integer htmlType; private Integer htmlType;
/**
* 查询方式(等于、不等于、大于、小于、范围)
*/
private String queryType;
/** /**
* 默认值 * 默认值
*/ */
...@@ -351,6 +361,20 @@ public class GentableColumnEntity extends GentableColumnEntityExt { ...@@ -351,6 +361,20 @@ public class GentableColumnEntity extends GentableColumnEntityExt {
this.isQuery = isQuery; this.isQuery = isQuery;
} }
/**
* 获取 是否导入导出字段(0否,1 是)
* @return isExport
*/
public Integer getIsExport() {
return this.isExport;
}
/**
* 设置 是否导入导出字段(0否,1 是)
* @param isExport
*/
public void setIsExport(Integer isExport) {
this.isExport = isExport;
}
/** /**
* 获取 显示类型(1.文本框、2.文本域、3.下拉框、4.复选框、5.单选框、6.日期控件) * 获取 显示类型(1.文本框、2.文本域、3.下拉框、4.复选框、5.单选框、6.日期控件)
* *
...@@ -369,6 +393,20 @@ public class GentableColumnEntity extends GentableColumnEntityExt { ...@@ -369,6 +393,20 @@ public class GentableColumnEntity extends GentableColumnEntityExt {
this.htmlType = htmlType; this.htmlType = htmlType;
} }
/**
* 获取 查询方式(等于、不等于、大于、小于、范围)
* @return queryType
*/
public String getQueryType() {
return this.queryType;
}
/**
* 设置 查询方式(等于、不等于、大于、小于、范围)
* @param queryType
*/
public void setQueryType(String queryType) {
this.queryType = queryType;
}
/** /**
* 获取 默认值 * 获取 默认值
* *
......
...@@ -83,6 +83,21 @@ public class GentableEntity extends GentableEntityExt{ ...@@ -83,6 +83,21 @@ public class GentableEntity extends GentableEntityExt{
*/ */
private Integer dividedTableType; private Integer dividedTableType;
/**
* 是否生成feign结构(0.否,1.是)
*/
private Integer genFeign;
/**
* 生成feign接口,消费应用工程名称如(workflow-platform)
*/
private String feignAppName;
/**
* 是否生成对外api结构(0,否,1.是)
*/
private Integer genApi;
/** /**
* 生成路径(不填默认项目路径) * 生成路径(不填默认项目路径)
*/ */
...@@ -318,6 +333,48 @@ public class GentableEntity extends GentableEntityExt{ ...@@ -318,6 +333,48 @@ public class GentableEntity extends GentableEntityExt{
public void setDividedTableType(Integer dividedTableType) { public void setDividedTableType(Integer dividedTableType) {
this.dividedTableType = dividedTableType; this.dividedTableType = dividedTableType;
} }
/**
* 获取 是否生成feign结构(0.否,1.是)
* @return genFeign
*/
public Integer getGenFeign() {
return this.genFeign;
}
/**
* 设置 是否生成feign结构(0.否,1.是)
* @param genFeign
*/
public void setGenFeign(Integer genFeign) {
this.genFeign = genFeign;
}
/**
* 获取 生成feign接口,消费应用工程名称如(workflow-platform)
* @return feignAppName
*/
public String getFeignAppName() {
return this.feignAppName;
}
/**
* 设置 生成feign接口,消费应用工程名称如(workflow-platform)
* @param feignAppName
*/
public void setFeignAppName(String feignAppName) {
this.feignAppName = feignAppName;
}
/**
* 获取 是否生成对外api结构(0,否,1.是)
* @return genApi
*/
public Integer getGenApi() {
return this.genApi;
}
/**
* 设置 是否生成对外api结构(0,否,1.是)
* @param genApi
*/
public void setGenApi(Integer genApi) {
this.genApi = genApi;
}
/** /**
* 获取 生成路径(不填默认项目路径) * 获取 生成路径(不填默认项目路径)
* @return genPath * @return genPath
......
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
<result property="cacheServiceType" column="cacheServiceType" /> <result property="cacheServiceType" column="cacheServiceType" />
<result property="genType" column="genType" /> <result property="genType" column="genType" />
<result property="dividedTableType" column="dividedTableType" /> <result property="dividedTableType" column="dividedTableType" />
<result property="genFeign" column="genFeign" />
<result property="feignAppName" column="feignAppName" />
<result property="genApi" column="genApi" />
<result property="genPath" column="genPath" /> <result property="genPath" column="genPath" />
<result property="options" column="options" /> <result property="options" column="options" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
...@@ -45,7 +48,10 @@ ...@@ -45,7 +48,10 @@
<result property="isEdit" column="isEdit" /> <result property="isEdit" column="isEdit" />
<result property="isList" column="isList" /> <result property="isList" column="isList" />
<result property="isQuery" column="isQuery" /> <result property="isQuery" column="isQuery" />
<result property="isExport" column="isExport" />
<result property="htmlType" column="htmlType" /> <result property="htmlType" column="htmlType" />
<result property="queryType" column="queryType" />
<result property="defaultValue" column="defaultValue" />
<result property="sort" column="sort" /> <result property="sort" column="sort" />
<result property="updateTime" column="updateTime" /> <result property="updateTime" column="updateTime" />
<result property="updateUser" column="updateUser" /> <result property="updateUser" column="updateUser" />
...@@ -101,6 +107,15 @@ ...@@ -101,6 +107,15 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('dividedTableType') or colPickMode == 1 and data.containsKey('dividedTableType')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('dividedTableType') or colPickMode == 1 and data.containsKey('dividedTableType')))">
a.dividedTableType as dividedTableType, a.dividedTableType as dividedTableType,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('genFeign') or colPickMode == 1 and data.containsKey('genFeign')))">
a.genFeign as genFeign,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('feignAppName') or colPickMode == 1 and data.containsKey('feignAppName')))">
a.feignAppName as feignAppName,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('genApi') or colPickMode == 1 and data.containsKey('genApi')))">
a.genApi as genApi,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('genPath') or colPickMode == 1 and data.containsKey('genPath')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('genPath') or colPickMode == 1 and data.containsKey('genPath')))">
a.genPath as genPath, a.genPath as genPath,
</if> </if>
...@@ -127,18 +142,18 @@ ...@@ -127,18 +142,18 @@
<!-- 新增 --> <!-- 新增 -->
<insert id="insert" parameterType="GentableEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="GentableEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_gentable insert into mortals_xhx_gentable
(tableName,tableComment,subTableName,subTableFkName,className,tplCategory,packageName,moduleName,businessName,functionName,functionAuthor,cacheServiceType,genType,dividedTableType,genPath,options,remark,updateTime,updateUser,createTime,createUser) (tableName,tableComment,subTableName,subTableFkName,className,tplCategory,packageName,moduleName,businessName,functionName,functionAuthor,cacheServiceType,genType,dividedTableType,genFeign,feignAppName,genApi,genPath,options,remark,updateTime,updateUser,createTime,createUser)
VALUES VALUES
(#{tableName},#{tableComment},#{subTableName},#{subTableFkName},#{className},#{tplCategory},#{packageName},#{moduleName},#{businessName},#{functionName},#{functionAuthor},#{cacheServiceType},#{genType},#{dividedTableType},#{genPath},#{options},#{remark},#{updateTime},#{updateUser},#{createTime},#{createUser}) (#{tableName},#{tableComment},#{subTableName},#{subTableFkName},#{className},#{tplCategory},#{packageName},#{moduleName},#{businessName},#{functionName},#{functionAuthor},#{cacheServiceType},#{genType},#{dividedTableType},#{genFeign},#{feignAppName},#{genApi},#{genPath},#{options},#{remark},#{updateTime},#{updateUser},#{createTime},#{createUser})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_gentable insert into mortals_xhx_gentable
(tableName,tableComment,subTableName,subTableFkName,className,tplCategory,packageName,moduleName,businessName,functionName,functionAuthor,cacheServiceType,genType,dividedTableType,genPath,options,remark,updateTime,updateUser,createTime,createUser) (tableName,tableComment,subTableName,subTableFkName,className,tplCategory,packageName,moduleName,businessName,functionName,functionAuthor,cacheServiceType,genType,dividedTableType,genFeign,feignAppName,genApi,genPath,options,remark,updateTime,updateUser,createTime,createUser)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.tableName},#{item.tableComment},#{item.subTableName},#{item.subTableFkName},#{item.className},#{item.tplCategory},#{item.packageName},#{item.moduleName},#{item.businessName},#{item.functionName},#{item.functionAuthor},#{item.cacheServiceType},#{item.genType},#{item.dividedTableType},#{item.genPath},#{item.options},#{item.remark},#{item.updateTime},#{item.updateUser},#{item.createTime},#{item.createUser}) (#{item.tableName},#{item.tableComment},#{item.subTableName},#{item.subTableFkName},#{item.className},#{item.tplCategory},#{item.packageName},#{item.moduleName},#{item.businessName},#{item.functionName},#{item.functionAuthor},#{item.cacheServiceType},#{item.genType},#{item.dividedTableType},#{item.genFeign},#{item.feignAppName},#{item.genApi},#{item.genPath},#{item.options},#{item.remark},#{item.updateTime},#{item.updateUser},#{item.createTime},#{item.createUser})
</foreach> </foreach>
</insert> </insert>
<!-- 根据ParamDto更新 --> <!-- 根据ParamDto更新 -->
...@@ -197,6 +212,21 @@ ...@@ -197,6 +212,21 @@
<if test="(colPickMode==0 and data.containsKey('dividedTableTypeIncrement')) or (colPickMode==1 and !data.containsKey('dividedTableTypeIncrement'))"> <if test="(colPickMode==0 and data.containsKey('dividedTableTypeIncrement')) or (colPickMode==1 and !data.containsKey('dividedTableTypeIncrement'))">
a.dividedTableType=ifnull(a.dividedTableType,0) + #{data.dividedTableTypeIncrement}, a.dividedTableType=ifnull(a.dividedTableType,0) + #{data.dividedTableTypeIncrement},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('genFeign')) or (colPickMode==1 and !data.containsKey('genFeign'))">
a.genFeign=#{data.genFeign},
</if>
<if test="(colPickMode==0 and data.containsKey('genFeignIncrement')) or (colPickMode==1 and !data.containsKey('genFeignIncrement'))">
a.genFeign=ifnull(a.genFeign,0) + #{data.genFeignIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('feignAppName')) or (colPickMode==1 and !data.containsKey('feignAppName'))">
a.feignAppName=#{data.feignAppName},
</if>
<if test="(colPickMode==0 and data.containsKey('genApi')) or (colPickMode==1 and !data.containsKey('genApi'))">
a.genApi=#{data.genApi},
</if>
<if test="(colPickMode==0 and data.containsKey('genApiIncrement')) or (colPickMode==1 and !data.containsKey('genApiIncrement'))">
a.genApi=ifnull(a.genApi,0) + #{data.genApiIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('genPath')) or (colPickMode==1 and !data.containsKey('genPath'))"> <if test="(colPickMode==0 and data.containsKey('genPath')) or (colPickMode==1 and !data.containsKey('genPath'))">
a.genPath=#{data.genPath}, a.genPath=#{data.genPath},
</if> </if>
...@@ -359,6 +389,40 @@ ...@@ -359,6 +389,40 @@
</foreach> </foreach>
</trim> </trim>
<trim prefix="genFeign=(case" suffix="ELSE genFeign end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('genFeign')) or (colPickMode==1 and !item.containsKey('genFeign'))">
when a.id=#{item.id} then #{item.genFeign}
</when>
<when test="(colPickMode==0 and item.containsKey('genFeignIncrement')) or (colPickMode==1 and !item.containsKey('genFeignIncrement'))">
when a.id=#{item.id} then ifnull(a.genFeign,0) + #{item.genFeignIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="feignAppName=(case" suffix="ELSE feignAppName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('feignAppName')) or (colPickMode==1 and !item.containsKey('feignAppName'))">
when a.id=#{item.id} then #{item.feignAppName}
</if>
</foreach>
</trim>
<trim prefix="genApi=(case" suffix="ELSE genApi end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('genApi')) or (colPickMode==1 and !item.containsKey('genApi'))">
when a.id=#{item.id} then #{item.genApi}
</when>
<when test="(colPickMode==0 and item.containsKey('genApiIncrement')) or (colPickMode==1 and !item.containsKey('genApiIncrement'))">
when a.id=#{item.id} then ifnull(a.genApi,0) + #{item.genApiIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="genPath=(case" suffix="ELSE genPath end),"> <trim prefix="genPath=(case" suffix="ELSE genPath end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('genPath')) or (colPickMode==1 and !item.containsKey('genPath'))"> <if test="(colPickMode==0 and item.containsKey('genPath')) or (colPickMode==1 and !item.containsKey('genPath'))">
...@@ -762,6 +826,63 @@ ...@@ -762,6 +826,63 @@
${_conditionType_} a.dividedTableType <![CDATA[ <= ]]> #{${_conditionParam_}.dividedTableTypeEnd} ${_conditionType_} a.dividedTableType <![CDATA[ <= ]]> #{${_conditionParam_}.dividedTableTypeEnd}
</if> </if>
<if test="conditionParamRef.containsKey('genFeign')">
<if test="conditionParamRef.genFeign != null ">
${_conditionType_} a.genFeign = #{${_conditionParam_}.genFeign}
</if>
<if test="conditionParamRef.genFeign == null">
${_conditionType_} a.genFeign is null
</if>
</if>
<if test="conditionParamRef.containsKey('genFeignList')">
${_conditionType_} a.genFeign in
<foreach collection="conditionParamRef.genFeignList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('genFeignStart') and conditionParamRef.genFeignStart != null">
${_conditionType_} a.genFeign <![CDATA[ >= ]]> #{${_conditionParam_}.genFeignStart}
</if>
<if test="conditionParamRef.containsKey('genFeignEnd') and conditionParamRef.genFeignEnd != null">
${_conditionType_} a.genFeign <![CDATA[ <= ]]> #{${_conditionParam_}.genFeignEnd}
</if>
<if test="conditionParamRef.containsKey('feignAppName')">
<if test="conditionParamRef.feignAppName != null and conditionParamRef.feignAppName != ''">
${_conditionType_} a.feignAppName like #{${_conditionParam_}.feignAppName}
</if>
<if test="conditionParamRef.feignAppName == null">
${_conditionType_} a.feignAppName is null
</if>
</if>
<if test="conditionParamRef.containsKey('feignAppNameList')">
${_conditionType_} a.feignAppName in
<foreach collection="conditionParamRef.feignAppNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('genApi')">
<if test="conditionParamRef.genApi != null ">
${_conditionType_} a.genApi = #{${_conditionParam_}.genApi}
</if>
<if test="conditionParamRef.genApi == null">
${_conditionType_} a.genApi is null
</if>
</if>
<if test="conditionParamRef.containsKey('genApiList')">
${_conditionType_} a.genApi in
<foreach collection="conditionParamRef.genApiList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('genApiStart') and conditionParamRef.genApiStart != null">
${_conditionType_} a.genApi <![CDATA[ >= ]]> #{${_conditionParam_}.genApiStart}
</if>
<if test="conditionParamRef.containsKey('genApiEnd') and conditionParamRef.genApiEnd != null">
${_conditionType_} a.genApi <![CDATA[ <= ]]> #{${_conditionParam_}.genApiEnd}
</if>
<if test="conditionParamRef.containsKey('genPath')"> <if test="conditionParamRef.containsKey('genPath')">
<if test="conditionParamRef.genPath != null and conditionParamRef.genPath != ''"> <if test="conditionParamRef.genPath != null and conditionParamRef.genPath != ''">
...@@ -955,6 +1076,21 @@ ...@@ -955,6 +1076,21 @@
<if test='orderCol.dividedTableType != null and "DESC".equalsIgnoreCase(orderCol.dividedTableType)'>DESC</if> <if test='orderCol.dividedTableType != null and "DESC".equalsIgnoreCase(orderCol.dividedTableType)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('genFeign')">
a.genFeign
<if test='orderCol.genFeign != null and "DESC".equalsIgnoreCase(orderCol.genFeign)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('feignAppName')">
a.feignAppName
<if test='orderCol.feignAppName != null and "DESC".equalsIgnoreCase(orderCol.feignAppName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('genApi')">
a.genApi
<if test='orderCol.genApi != null and "DESC".equalsIgnoreCase(orderCol.genApi)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('genPath')"> <if test="orderCol.containsKey('genPath')">
a.genPath a.genPath
<if test='orderCol.genPath != null and "DESC".equalsIgnoreCase(orderCol.genPath)'>DESC</if> <if test='orderCol.genPath != null and "DESC".equalsIgnoreCase(orderCol.genPath)'>DESC</if>
......
...@@ -19,7 +19,9 @@ ...@@ -19,7 +19,9 @@
<result property="isEdit" column="isEdit" /> <result property="isEdit" column="isEdit" />
<result property="isList" column="isList" /> <result property="isList" column="isList" />
<result property="isQuery" column="isQuery" /> <result property="isQuery" column="isQuery" />
<result property="isExport" column="isExport" />
<result property="htmlType" column="htmlType" /> <result property="htmlType" column="htmlType" />
<result property="queryType" column="queryType" />
<result property="defaultValue" column="defaultValue" /> <result property="defaultValue" column="defaultValue" />
<result property="sort" column="sort" /> <result property="sort" column="sort" />
<result property="updateTime" column="updateTime" /> <result property="updateTime" column="updateTime" />
...@@ -73,9 +75,15 @@ ...@@ -73,9 +75,15 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('isQuery') or colPickMode == 1 and data.containsKey('isQuery')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('isQuery') or colPickMode == 1 and data.containsKey('isQuery')))">
a.isQuery as isQuery, a.isQuery as isQuery,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('isExport') or colPickMode == 1 and data.containsKey('isExport')))">
a.isExport as isExport,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('htmlType') or colPickMode == 1 and data.containsKey('htmlType')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('htmlType') or colPickMode == 1 and data.containsKey('htmlType')))">
a.htmlType as htmlType, a.htmlType as htmlType,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('queryType') or colPickMode == 1 and data.containsKey('queryType')))">
a.queryType as queryType,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('defaultValue') or colPickMode == 1 and data.containsKey('defaultValue')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('defaultValue') or colPickMode == 1 and data.containsKey('defaultValue')))">
a.defaultValue as defaultValue, a.defaultValue as defaultValue,
</if> </if>
...@@ -99,18 +107,18 @@ ...@@ -99,18 +107,18 @@
<!-- 新增 --> <!-- 新增 -->
<insert id="insert" parameterType="GentableColumnEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="GentableColumnEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_gentable_column insert into mortals_xhx_gentable_column
(tableId,columnName,columnComment,columnType,javaType,javaField,isPrimaryKey,isIncrement,isRequired,isInsert,isEdit,isList,isQuery,htmlType,defaultValue,sort,updateTime,updateUser,createTime,createUser) (tableId,columnName,columnComment,columnType,javaType,javaField,isPrimaryKey,isIncrement,isRequired,isInsert,isEdit,isList,isQuery,isExport,htmlType,queryType,defaultValue,sort,updateTime,updateUser,createTime,createUser)
VALUES VALUES
(#{tableId},#{columnName},#{columnComment},#{columnType},#{javaType},#{javaField},#{isPrimaryKey},#{isIncrement},#{isRequired},#{isInsert},#{isEdit},#{isList},#{isQuery},#{htmlType},#{defaultValue},#{sort},#{updateTime},#{updateUser},#{createTime},#{createUser}) (#{tableId},#{columnName},#{columnComment},#{columnType},#{javaType},#{javaField},#{isPrimaryKey},#{isIncrement},#{isRequired},#{isInsert},#{isEdit},#{isList},#{isQuery},#{isExport},#{htmlType},#{queryType},#{defaultValue},#{sort},#{updateTime},#{updateUser},#{createTime},#{createUser})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_gentable_column insert into mortals_xhx_gentable_column
(tableId,columnName,columnComment,columnType,javaType,javaField,isPrimaryKey,isIncrement,isRequired,isInsert,isEdit,isList,isQuery,htmlType,defaultValue,sort,updateTime,updateUser,createTime,createUser) (tableId,columnName,columnComment,columnType,javaType,javaField,isPrimaryKey,isIncrement,isRequired,isInsert,isEdit,isList,isQuery,isExport,htmlType,queryType,defaultValue,sort,updateTime,updateUser,createTime,createUser)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.tableId},#{item.columnName},#{item.columnComment},#{item.columnType},#{item.javaType},#{item.javaField},#{item.isPrimaryKey},#{item.isIncrement},#{item.isRequired},#{item.isInsert},#{item.isEdit},#{item.isList},#{item.isQuery},#{item.htmlType},#{item.defaultValue},#{item.sort},#{item.updateTime},#{item.updateUser},#{item.createTime},#{item.createUser}) (#{item.tableId},#{item.columnName},#{item.columnComment},#{item.columnType},#{item.javaType},#{item.javaField},#{item.isPrimaryKey},#{item.isIncrement},#{item.isRequired},#{item.isInsert},#{item.isEdit},#{item.isList},#{item.isQuery},#{item.isExport},#{item.htmlType},#{item.queryType},#{item.defaultValue},#{item.sort},#{item.updateTime},#{item.updateUser},#{item.createTime},#{item.createUser})
</foreach> </foreach>
</insert> </insert>
<!-- 根据ParamDto更新 --> <!-- 根据ParamDto更新 -->
...@@ -181,12 +189,21 @@ ...@@ -181,12 +189,21 @@
<if test="(colPickMode==0 and data.containsKey('isQueryIncrement')) or (colPickMode==1 and !data.containsKey('isQueryIncrement'))"> <if test="(colPickMode==0 and data.containsKey('isQueryIncrement')) or (colPickMode==1 and !data.containsKey('isQueryIncrement'))">
a.isQuery=ifnull(a.isQuery,0) + #{data.isQueryIncrement}, a.isQuery=ifnull(a.isQuery,0) + #{data.isQueryIncrement},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('isExport')) or (colPickMode==1 and !data.containsKey('isExport'))">
a.isExport=#{data.isExport},
</if>
<if test="(colPickMode==0 and data.containsKey('isExportIncrement')) or (colPickMode==1 and !data.containsKey('isExportIncrement'))">
a.isExport=ifnull(a.isExport,0) + #{data.isExportIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('htmlType')) or (colPickMode==1 and !data.containsKey('htmlType'))"> <if test="(colPickMode==0 and data.containsKey('htmlType')) or (colPickMode==1 and !data.containsKey('htmlType'))">
a.htmlType=#{data.htmlType}, a.htmlType=#{data.htmlType},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('htmlTypeIncrement')) or (colPickMode==1 and !data.containsKey('htmlTypeIncrement'))"> <if test="(colPickMode==0 and data.containsKey('htmlTypeIncrement')) or (colPickMode==1 and !data.containsKey('htmlTypeIncrement'))">
a.htmlType=ifnull(a.htmlType,0) + #{data.htmlTypeIncrement}, a.htmlType=ifnull(a.htmlType,0) + #{data.htmlTypeIncrement},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('queryType')) or (colPickMode==1 and !data.containsKey('queryType'))">
a.queryType=#{data.queryType},
</if>
<if test="(colPickMode==0 and data.containsKey('defaultValue')) or (colPickMode==1 and !data.containsKey('defaultValue'))"> <if test="(colPickMode==0 and data.containsKey('defaultValue')) or (colPickMode==1 and !data.containsKey('defaultValue'))">
a.defaultValue=#{data.defaultValue}, a.defaultValue=#{data.defaultValue},
</if> </if>
...@@ -366,6 +383,19 @@ ...@@ -366,6 +383,19 @@
</foreach> </foreach>
</trim> </trim>
<trim prefix="isExport=(case" suffix="ELSE isExport end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('isExport')) or (colPickMode==1 and !item.containsKey('isExport'))">
when a.id=#{item.id} then #{item.isExport}
</when>
<when test="(colPickMode==0 and item.containsKey('isExportIncrement')) or (colPickMode==1 and !item.containsKey('isExportIncrement'))">
when a.id=#{item.id} then ifnull(a.isExport,0) + #{item.isExportIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="htmlType=(case" suffix="ELSE htmlType end),"> <trim prefix="htmlType=(case" suffix="ELSE htmlType end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<choose> <choose>
...@@ -379,6 +409,14 @@ ...@@ -379,6 +409,14 @@
</foreach> </foreach>
</trim> </trim>
<trim prefix="queryType=(case" suffix="ELSE queryType end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('queryType')) or (colPickMode==1 and !item.containsKey('queryType'))">
when a.id=#{item.id} then #{item.queryType}
</if>
</foreach>
</trim>
<trim prefix="defaultValue=(case" suffix="ELSE defaultValue end),"> <trim prefix="defaultValue=(case" suffix="ELSE defaultValue end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('defaultValue')) or (colPickMode==1 and !item.containsKey('defaultValue'))"> <if test="(colPickMode==0 and item.containsKey('defaultValue')) or (colPickMode==1 and !item.containsKey('defaultValue'))">
...@@ -794,6 +832,27 @@ ...@@ -794,6 +832,27 @@
${_conditionType_} a.isQuery <![CDATA[ <= ]]> #{${_conditionParam_}.isQueryEnd} ${_conditionType_} a.isQuery <![CDATA[ <= ]]> #{${_conditionParam_}.isQueryEnd}
</if> </if>
<if test="conditionParamRef.containsKey('isExport')">
<if test="conditionParamRef.isExport != null ">
${_conditionType_} a.isExport = #{${_conditionParam_}.isExport}
</if>
<if test="conditionParamRef.isExport == null">
${_conditionType_} a.isExport is null
</if>
</if>
<if test="conditionParamRef.containsKey('isExportList')">
${_conditionType_} a.isExport in
<foreach collection="conditionParamRef.isExportList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('isExportStart') and conditionParamRef.isExportStart != null">
${_conditionType_} a.isExport <![CDATA[ >= ]]> #{${_conditionParam_}.isExportStart}
</if>
<if test="conditionParamRef.containsKey('isExportEnd') and conditionParamRef.isExportEnd != null">
${_conditionType_} a.isExport <![CDATA[ <= ]]> #{${_conditionParam_}.isExportEnd}
</if>
<if test="conditionParamRef.containsKey('htmlType')"> <if test="conditionParamRef.containsKey('htmlType')">
<if test="conditionParamRef.htmlType != null "> <if test="conditionParamRef.htmlType != null ">
${_conditionType_} a.htmlType = #{${_conditionParam_}.htmlType} ${_conditionType_} a.htmlType = #{${_conditionParam_}.htmlType}
...@@ -816,6 +875,21 @@ ...@@ -816,6 +875,21 @@
</if> </if>
<if test="conditionParamRef.containsKey('queryType')">
<if test="conditionParamRef.queryType != null and conditionParamRef.queryType != ''">
${_conditionType_} a.queryType like #{${_conditionParam_}.queryType}
</if>
<if test="conditionParamRef.queryType == null">
${_conditionType_} a.queryType is null
</if>
</if>
<if test="conditionParamRef.containsKey('queryTypeList')">
${_conditionType_} a.queryType in
<foreach collection="conditionParamRef.queryTypeList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('defaultValue')"> <if test="conditionParamRef.containsKey('defaultValue')">
<if test="conditionParamRef.defaultValue != null and conditionParamRef.defaultValue != ''"> <if test="conditionParamRef.defaultValue != null and conditionParamRef.defaultValue != ''">
${_conditionType_} a.defaultValue like #{${_conditionParam_}.defaultValue} ${_conditionType_} a.defaultValue like #{${_conditionParam_}.defaultValue}
...@@ -994,11 +1068,21 @@ ...@@ -994,11 +1068,21 @@
<if test='orderCol.isQuery != null and "DESC".equalsIgnoreCase(orderCol.isQuery)'>DESC</if> <if test='orderCol.isQuery != null and "DESC".equalsIgnoreCase(orderCol.isQuery)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('isExport')">
a.isExport
<if test='orderCol.isExport != null and "DESC".equalsIgnoreCase(orderCol.isExport)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('htmlType')"> <if test="orderCol.containsKey('htmlType')">
a.htmlType a.htmlType
<if test='orderCol.htmlType != null and "DESC".equalsIgnoreCase(orderCol.htmlType)'>DESC</if> <if test='orderCol.htmlType != null and "DESC".equalsIgnoreCase(orderCol.htmlType)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('queryType')">
a.queryType
<if test='orderCol.queryType != null and "DESC".equalsIgnoreCase(orderCol.queryType)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('defaultValue')"> <if test="orderCol.containsKey('defaultValue')">
a.defaultValue a.defaultValue
<if test='orderCol.defaultValue != null and "DESC".equalsIgnoreCase(orderCol.defaultValue)'>DESC</if> <if test='orderCol.defaultValue != null and "DESC".equalsIgnoreCase(orderCol.defaultValue)'>DESC</if>
......
...@@ -47,6 +47,9 @@ ...@@ -47,6 +47,9 @@
t.cacheServiceType, t.cacheServiceType,
t.genType, t.genType,
t.dividedTableType, t.dividedTableType,
t.genFeign,
t.feignAppName,
t.genApi,
t.options, t.options,
t.remark, t.remark,
c.id, c.id,
...@@ -62,7 +65,9 @@ ...@@ -62,7 +65,9 @@
c.isEdit, c.isEdit,
c.isList, c.isList,
c.isQuery, c.isQuery,
c.isExport,
c.htmlType, c.htmlType,
c.queryType,
c.sort c.sort
FROM mortals_xhx_gentable t FROM mortals_xhx_gentable t
LEFT JOIN mortals_xhx_gentable_column c ON t.id = c.tableId LEFT JOIN mortals_xhx_gentable_column c ON t.id = c.tableId
......
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