All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tpl.mapper.xml.vm Maven / Gradle / Ivy

The newest version!
<?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}.${table.mapperName}">
#if(${enableCache})
	<!-- 开启二级缓存 -->
	<cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>
#end

#if(${baseResultMap})
	<!-- 通用查询映射结果 -->
	<resultMap id="BaseResultMap" type="${package.Entity}.${entity}">
#foreach($field in ${table.fields})
#if(${field.keyFlag})
		<id column="${field.name}" property="${field.propertyName}" />
#else
		<result column="${field.name}" property="${field.propertyName}" />
#end
#end
	</resultMap>
#end

#if(${baseColumnList})
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        ${table.fieldNames}
    </sql>
#end

	<select id="selectIdPage" resultType="java.lang.Long">
		select id_ from ${table.name}
		<where>
#foreach($field in ${table.fields})
			<if test="cm.${field.propertyName} != null and cm.${field.propertyName} != ''">
					and ${field.name}=#{cm.${field.propertyName}}
			</if>
#end
			<if test="cm.keyword != null and cm.keyword != ''">
				and (
#foreach($field in ${table.fields})
					or ${field.name} like CONCAT('%',#{cm.keyword},'%')
#end
				)
			</if>
		</where>
	</select>
</mapper>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy