青岛老甜沫 2023-01-03 16:38 采纳率: 0%
浏览 5

mabatis注解形式转换插件

注解形式的sql语句如何快速转换为可读性强的sql语句
sql语句是注解的形式,可读性差,而且中间哪个字符有问题都不知道
具体代码类似这种,还有比这更复杂的,以前用xml里写的 直接粘出来一运行就知道哪里有问题了,现在粘出来还要挑" +的
@Select(value = " <script>" +
        " select a.id from at_account a " +
        " left join at_account_owner b " +
        " on a.owner_id = b.id " +
        " where a.dr=0 and b.dr=0 and b.customer_platform_Id in " +
        " <foreach item='customerPlatformId' index='index' collection='customerPlatformIds' open='(' separator=',' close=')'> " +
        " #{customerPlatformId} " +
        " </foreach>  " +
        " </script> ")
List<Long> queryIdByCustomerPlatformIds(@Param("customerPlatformIds") List<String> customerPlatformIds)
  • 写回答

3条回答 默认 最新

  • 夜郎king 2022博客之星IT其它领域TOP 12 2023-01-03 16:49
    关注

    上面的语句还算一般,如果觉得太复杂,也可以使用原来的xml的配置方式

    评论

报告相同问题?

问题事件

  • 创建了问题 1月3日