<?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="test2.area">
<select id="getAreaByAreaId" parameterType="int" resultType="hashmap">
select * from ts_area where area_id =#{area_id}
</select>
<select id="findByTitle" parameterType="String" resultType="hashmap">
select * from ts_area where title like #{title}
</select>
<select id="findByTitle_count" parameterType="String" resultType="hashmap">
select count(*) as totalRows from ts_area where title like #{title}
</select>
<select id="getAreasByPid" parameterType="int" resultType="hashmap">
select * from ts_area where pid =#{pid}
</select>
</mapper>
4、测试代码
public class Test {
public static void main(String[] args) {
AreaService areaService = new AreaService();
System.out.println(areaService.getAreasWithPage("县", 2, 791));
}
}