2024-04-22 08:45:46 +08:00
|
|
|
<?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="${packageName}.mapper.${ClassName}Mapper">
|
2024-04-23 09:01:15 +08:00
|
|
|
<resultMap type="${ClassName}" id="${ClassName}Result">
|
|
|
|
#foreach ($column in $columns)
|
|
|
|
<result property="${column.javaField}" column="${column.columnName}" />
|
|
|
|
#end
|
|
|
|
</resultMap>
|
|
|
|
#if($table.sub)
|
2024-04-22 08:45:46 +08:00
|
|
|
|
2024-04-23 09:01:15 +08:00
|
|
|
<resultMap id="${ClassName}${subClassName}Result" type="${ClassName}" extends="${ClassName}Result">
|
|
|
|
<collection property="${subclassName}List" notNullColumn="sub_${subTable.pkColumn.columnName}" javaType="java.util.List" resultMap="${subClassName}Result" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<resultMap type="${subClassName}" id="${subClassName}Result">
|
|
|
|
#foreach ($column in $subTable.columns)
|
|
|
|
<result property="${column.javaField}" column="sub_${column.columnName}" />
|
|
|
|
#end
|
|
|
|
</resultMap>
|
|
|
|
#end
|
|
|
|
|
|
|
|
<sql id="select${ClassName}Vo">
|
|
|
|
select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end from ${tableName}
|
|
|
|
</sql>
|
2024-04-22 08:45:46 +08:00
|
|
|
</mapper>
|