1234567891011121314151617181920212223 |
- <?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">
- <resultMap type="${ClassName}" id="${ClassName}Result">
- #foreach ($column in $columns)
- <result property="${column.javaField}" column="${column.columnName}" />
- #end
- </resultMap>
- #if($table.sub)
- <select id="select${subClassName}By${pkColumn.capJavaField}" parameterType="${pkColumn.javaType}" resultType="${packageName}.domain.${ClassName}">
- select * from ${subTableName} where ${subTableFkName} = #{${pkColumn.javaField}}
- </select>
- <delete id="delete${subClassName}By${subTableFkClassName}" parameterType="${pkColumn.javaType}">
- delete from ${subTableName} where ${subTableFkName} = #{${pkColumn.javaField}}
- </delete>
- #end
- </mapper>
|