接口名称
List<Info> findListByNos(List<String> nos);
Info findById(String id);
List<Info> findByEntityWithPagination(Info info, int offset, int count);//分页(第一个是对象,第二个是pageNo,第三个是pageSize)
List<Info> findByMap(Map<String, Object> map);
List<Link> findByEntity(Info info);
xml配置
<select id="findListByNos" parameterType="list" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM INFO
WHERE INFO_ID IN
<foreach collection="list" index="index" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
ORDER BY INFO_ID DESC
</select>
<select id="findById" resultMap="BaseResultMap" parameterType="java.lang.String" >
SELECT
<include refid="Base_Column_List" />
FROM INFO
WHERE INFO_ID = #{infoId,jdbcType=VARCHAR}
</select>
<select id="findByEntityWithPagination" resultMap="BaseResultMap" >
SELECT
<include refid="Base_Column_List" />
FROM INFO
<trim prefix="WHERE" suffixOverrides="AND" >
<if test="param1.infoType != null" >
INFO_TYPE = #{param1.infoType,jdbcType=VARCHAR} AND
</if>
<if test="param1.infoContent != null" >
INFO_CONTENT = #{param1.infoContent,jdbcType=LONGVARCHAR} AND
</if>
</trim>
LIMIT #{param2} , #{param3}
</select>
<select id="findByProperties" parameterType="map" resultMap="BaseResultMap" >
SELECT
<include refid="Base_Column_List" />
FROM INFO
<trim prefix="WHERE" suffixOverrides="AND" >
<if test="_parameter.containsKey('infoType')" >
INFO_TYPE = #{infoType,jdbcType=VARCHAR} AND
</if>
<if test="_parameter.containsKey('infoContent')" >
INFO_CONTENT = #{infoContent,jdbcType=LONGVARCHAR} AND
</if>
<if test="_parameter.containsKey('infoName')" >
INFO_NAME = #{infoName,jdbcType=VARCHAR} AND
</if>
</trim>
ORDER BY INFO_ID
</select>
<select id="findByEntity" resultMap="BaseResultMap" parameterType="com.cn.Info" >
SELECT
<include refid="Base_Column_List" />
FROM INFO
<trim prefix="WHERE" suffixOverrides="AND" >
<if test="infoType != null" >
INFO_TYPE = #{infoType,jdbcType=VARCHAR} AND
</if>
<if test="infoContent != null" >
INFO_CONTENT = #{infoContent,jdbcType=LONGVARCHAR} AND
</if>
</trim>
</select>