public class SelectMapperTemplate extends AbstractMapperTemplate
xmlLanguageDriver| Constructor and Description |
|---|
SelectMapperTemplate() |
| Modifier and Type | Method and Description |
|---|---|
String |
selectByPrimaryKey(TableInfo tableInfo,
org.apache.ibatis.mapping.MappedStatement ms)
查询记录,生成 select 语句。
|
String |
selectCount(TableInfo tableInfo,
org.apache.ibatis.mapping.MappedStatement ms)
查询记录,生成 select 语句。
|
String |
selectCount2(TableInfo tableInfo,
org.apache.ibatis.mapping.MappedStatement ms)
查询记录,生成 select 语句。
|
String |
selectList(TableInfo tableInfo,
org.apache.ibatis.mapping.MappedStatement ms)
查询记录,生成 select 语句。
|
String |
selectListByPrimaryKey(TableInfo tableInfo,
org.apache.ibatis.mapping.MappedStatement ms)
查询记录,生成 select 语句。
|
String |
selectListWithPrimaryKey(TableInfo tableInfo,
org.apache.ibatis.mapping.MappedStatement ms)
查询记录,生成 select 语句。
|
String |
selectOne(TableInfo tableInfo,
org.apache.ibatis.mapping.MappedStatement ms)
查询记录,生成 select 语句。
|
String |
selectPage(TableInfo tableInfo,
org.apache.ibatis.mapping.MappedStatement ms)
查询记录,生成 select 语句。
|
String |
selectPage2(TableInfo tableInfo,
org.apache.ibatis.mapping.MappedStatement ms)
查询记录,生成 select 语句。
|
String |
selectWithPrimaryKey(TableInfo tableInfo,
org.apache.ibatis.mapping.MappedStatement ms)
查询记录,生成 select 语句。
|
dynamicSql, getNodeContent, getWhereExtend, getWhereExtendCondition, getWhereExtraConditionpublic String selectOne(TableInfo tableInfo, org.apache.ibatis.mapping.MappedStatement ms)
示例如下:
SELECT id,... FROM table_name
<where>
<if test="id != null">
and id = #{id}
</if>
and is_deleted = 'N'
</where>
tableInfo - 数据库表结构信息ms - sql语句节点信息,会将生成的sql语句替换掉原有的 MappedStatement.sqlSourceSelectOneMapper.selectOne(Object)public String selectList(TableInfo tableInfo, org.apache.ibatis.mapping.MappedStatement ms)
示例如下:
SELECT id,... FROM table_name
<where>
<if test="id != null">
and id = #{id}
</if>
and is_deleted = 'N'
</where>
tableInfo - 数据库表结构信息ms - sql语句节点信息,会将生成的sql语句替换掉原有的 MappedStatement.sqlSourceSelectListMapper.selectList(Object)public String selectCount(TableInfo tableInfo, org.apache.ibatis.mapping.MappedStatement ms)
示例如下:
SELECT COUNT(1) FROM table_name
<where>
<if test="id != null">
and id = #{id}
</if>
and is_deleted = 'N'
</where>
tableInfo - 数据库表结构信息ms - sql语句节点信息,会将生成的sql语句替换掉原有的 MappedStatement.sqlSourceSelectCountMapper.selectCount(Object)public String selectCount2(TableInfo tableInfo, org.apache.ibatis.mapping.MappedStatement ms)
示例如下:
SELECT COUNT(1) FROM table_name
<where>
<if test="condition != null">
<if test="condition.id != null">
and id = #{condition.id}
</if>
</if>
<if test="extraCondition != null">
<include refid="Where_Extra_Condition" />
</if>
and is_deleted = 'N'
</where>
tableInfo - 数据库表结构信息ms - sql语句节点信息,会将生成的sql语句替换掉原有的 MappedStatement.sqlSourceSelectCountMapper.selectCount2(Object, Map)public String selectPage(TableInfo tableInfo, org.apache.ibatis.mapping.MappedStatement ms)
示例如下:
SELECT id,... FROM table_name
<where>
<if test="id != null">
and id = #{id}
</if>
and is_deleted = 'N'
</where>
<if test="orders != null and orders.size > 0">
order by
<foreach collection="orders" item="item" separator=",">
${item.property} ${item.direction}
</foreach>
</if>
limit #{offset}, #{pageSize}
tableInfo - 数据库表结构信息ms - sql语句节点信息,会将生成的sql语句替换掉原有的 MappedStatement.sqlSourceSelectPageMapper.selectPage(Object, int, int, List)public String selectPage2(TableInfo tableInfo, org.apache.ibatis.mapping.MappedStatement ms)
示例如下:
SELECT id,... FROM table_name
<where>
<if test="condition.id != null">
and id = #{condition.id}
</if>
and is_deleted = 'N'
<if test="extraCondition != null">
<include refid="Where_Extra_Condition" />
</if>
</where>
<if test="orders != null and orders.size > 0">
order by
<foreach collection="orders" item="item" separator=",">
${item.property} ${item.direction}
</foreach>
</if>
limit #{offset}, #{pageSize}
tableInfo - 数据库表结构信息ms - sql语句节点信息,会将生成的sql语句替换掉原有的 MappedStatement.sqlSourceSelectPageMapper.selectPage2(Object, Map, int, int, List)public String selectByPrimaryKey(TableInfo tableInfo, org.apache.ibatis.mapping.MappedStatement ms)
示例如下:
SELECT id,... FROM table_name
<where>
AND id = #{id}
AND is_deleted = 'N'
</where>
tableInfo - 数据库表结构信息ms - sql语句节点信息,会将生成的sql语句替换掉原有的 MappedStatement.sqlSourceSelectByPrimaryKeyMapper.selectByPrimaryKey(Serializable),
SelectByPrimaryKeyMapper.selectWithPrimaryKey(Object)public String selectWithPrimaryKey(TableInfo tableInfo, org.apache.ibatis.mapping.MappedStatement ms)
示例如下:
SELECT id,... FROM table_name
<where>
AND id = #{id}
AND is_deleted = 'N'
</where>
tableInfo - 数据库表结构信息ms - sql语句节点信息,会将生成的sql语句替换掉原有的 MappedStatement.sqlSourceSelectByPrimaryKeyMapper.selectWithPrimaryKey(Object)public String selectListByPrimaryKey(TableInfo tableInfo, org.apache.ibatis.mapping.MappedStatement ms)
示例如下:
SELECT id,... FROM table_name
<where>
AND id in
<foreach collection="ids" item="item" separator="," open="(" close=")">
#{item}
</foreach>
AND is_deleted = 'N'
</where>
tableInfo - 数据库表结构信息ms - sql语句节点信息,会将生成的sql语句替换掉原有的 MappedStatement.sqlSourceSelectByPrimaryKeyMapper.selectListByPrimaryKey(Collection)public String selectListWithPrimaryKey(TableInfo tableInfo, org.apache.ibatis.mapping.MappedStatement ms)
示例如下:
SELECT id,... FROM table_name
<where>
AND id in
<foreach collection="ids" item="item" separator="," open="(" close=")">
#{item}
</foreach>
AND is_deleted = 'N'
</where>
tableInfo - 数据库表结构信息ms - sql语句节点信息,会将生成的sql语句替换掉原有的 MappedStatement.sqlSourceSelectByPrimaryKeyMapper.selectListWithPrimaryKey(Collection)Copyright © 2018–2021. All rights reserved.