♻️ Refactoring code. pigx-codegen 适配最新V5 UI

This commit is contained in:
lbw committed 2023-04-06 15:03:58 +08:00
1 parent 3c047a59de
commit e6838a19e1
93 files changed
+3219 -2736

No files matched your search

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.pig4cloud.pigx.codegen.mapper.GenDynamicMapper">
<!-- 动态SQL查询 -->
<select id="dynamicQuerySql" parameterType="String" resultType="java.util.LinkedHashMap">
${value}
</select>
</mapper>
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the pig4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.pig4cloud.pigx.codegen.mapper.GenFieldTypeMapper">
<resultMap id="fieldTypeMap" type="com.pig4cloud.pigx.codegen.entity.GenFieldType">
<id property="id" column="id"/>
<result property="columnType" column="column_type"/>
<result property="attrType" column="attr_type"/>
<result property="packageName" column="package_name"/>
<result property="createTime" column="create_time"/>
</resultMap>
<select id="getPackageByTableId" resultType="String">
select t1.package_name
from gen_field_type t1,
gen_table_column t2
where t1.attr_type = t2.attr_type
and t2.ds_name = #{dsName} and t2.table_name = #{tableName}
</select>
</mapper>
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.pig4cloud.pigx.codegen.mapper.GenGroupMapper">
<resultMap id="genGroupMap" type="com.pig4cloud.pigx.codegen.util.vo.GroupVo">
<id property="id" column="group_id"/>
<result property="groupName" column="group_name"/>
<result property="groupDesc" column="group_desc"/>
<collection property="templateList" ofType="com.pig4cloud.pigx.codegen.entity.GenTemplateEntity"
select="com.pig4cloud.pigx.codegen.mapper.GenTemplateMapper.listTemplateById" column="group_id">
</collection>
</resultMap>
<select id="getGroupVoById" resultMap="genGroupMap">
SELECT
g.id as group_id ,
g.group_name ,
g.group_desc
FROM
gen_group g
WHERE g.id = #{id}
</select>
</mapper>
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the pig4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.pig4cloud.pigx.codegen.mapper.GenTableMapper">
<resultMap id="tableMap" type="com.pig4cloud.pigx.codegen.entity.GenTable">
<id property="id" column="id"/>
<result property="tableName" column="table_name"/>
<result property="className" column="class_name"/>
<result property="tableComment" column="table_comment"/>
<result property="author" column="author"/>
<result property="email" column="email"/>
<result property="packageName" column="package_name"/>
<result property="version" column="version"/>
<result property="generatorType" column="generator_type"/>
<result property="backendPath" column="backend_path"/>
<result property="frontendPath" column="frontend_path"/>
<result property="moduleName" column="module_name"/>
<result property="functionName" column="function_name"/>
<result property="formLayout" column="form_layout"/>
<result property="datasourceId" column="datasource_id"/>
<result property="baseclassId" column="baseclass_id"/>
<result property="createTime" column="create_time"/>
</resultMap>
</mapper>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.pig4cloud.pigx.codegen.mapper.GenTemplateGroupMapper">
<resultMap id="genTemplateGroupMap" type="com.pig4cloud.pigx.codegen.entity.GenTemplateGroupEntity">
<id property="groupId" column="group_id"/>
<id property="templateId" column="template_id"/>
</resultMap>
</mapper>
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.pig4cloud.pigx.codegen.mapper.GenTemplateMapper">
<resultMap id="genTemplateMap" type="com.pig4cloud.pigx.codegen.entity.GenTemplateEntity">
<id property="id" column="id"/>
<result property="templateName" column="template_name"/>
<result property="generatorPath" column="generator_path"/>
<result property="templateDesc" column="template_desc"/>
<result property="templateCode" column="template_code"/>
</resultMap>
<select id="listTemplateById" resultType="com.pig4cloud.pigx.codegen.entity.GenTemplateEntity">
SELECT
t.id as id,t.template_name,t.generator_path,t.template_desc,t.template_code
FROM gen_template t ,
gen_template_group tg
WHERE t.id = tg.template_id
AND t.del_flag = '0'
and tg.group_id = #{groupId}
</select>
</mapper>
@@ -22,7 +22,6 @@
order by create_time desc
</select>
<sql id="queryColumn">
SELECT
column_name columnName,