2018-07-09 08:44:52 +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="${package}.mapper.${className}Mapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="${className}" id="${className}Result">
|
|
|
|
|
#foreach ($column in $columns)
|
|
|
|
|
<result property="${column.attrname}" column="${column.columnName}" />
|
|
|
|
|
#end
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="select${className}Vo">
|
2018-12-07 22:23:03 +08:00
|
|
|
#foreach($column in $columns) $column.columnName#if($velocityCount != $columns.size()),#end#end
|
2018-07-09 08:44:52 +08:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="select${className}List" parameterType="${className}" resultMap="${className}Result">
|
2018-12-07 22:23:03 +08:00
|
|
|
select
|
2018-07-09 08:44:52 +08:00
|
|
|
<include refid="select${className}Vo"/>
|
2018-12-07 22:23:03 +08:00
|
|
|
from ${tableName}
|
2018-07-09 08:44:52 +08:00
|
|
|
<where>
|
|
|
|
|
#foreach($column in $columns)
|
2018-09-28 17:18:18 +08:00
|
|
|
<if test="$column.attrname != null #if($column.attrType == 'String' ) and $column.attrname.trim() != '' #end"> and $column.columnName = #{$column.attrname}</if>
|
2018-07-09 08:44:52 +08:00
|
|
|
#end
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
2018-07-24 00:20:01 +08:00
|
|
|
|
2018-07-09 08:44:52 +08:00
|
|
|
|
|
|
|
|
</mapper>
|