mybatis 执行传入的任意sql语句
dao类
/** * 自定义sql查询 * @param sqlContent * @return */ public List<LinkedHashMap<String, Object>> customQueryItem(String sqlContent);
mapper.xml
<select id="customQueryItem" parameterType="String" resultType="java.util.LinkedHashMap"> <![CDATA[ SELECT * FROM (${value}) obj ]]> </select>