在Mapper。xml如下书写SQL文,其中 resultType告知MyBatis返回的类型:

<select >
         select distinct to_char(created_datetime,'yyyy-MM-dd') as dt from ${tableName} where created_datetime&lt;to_date(#{date},'yyyy-MM-dd') order by dt
</select>

 

在Java代码中如下书写: 

Map<String, String> para1=new HashMap<String, String>();
para1.put("tableName",tableName);
para1.put("date",dateExpiredStr);
List<String> ls=session.selectList("selectExpiredDate", para1);

 

上面黑体字部分是关键。

--END-- 2019.10.08 17:40

相关文章:

  • 2022-12-23
  • 2021-05-31
  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
相关资源
相似解决方案