1)DynamicTableMapper.xml
<select id="selectList" resultType="java.lang.String" parameterType="map" >
select
distinct(name)
from ${tableName}
where name is not null
</select>
2)接口
public interface DynamicTableMapper {
List<String> selectList(Map<String, String> map);
}
3)map参数
Map<String, String> map = new HashMap<String, String>();
map.put("tableName", "sca_tag");
4)
mapper注入dao
将map参数 传入到dao中
----------------end --------------------
时间: 2024-12-30 04:07:08