Mybatis的xml查询sql拼接
字符串模糊查询<if test="userName != null and userName!= ''">AND `user_name` LIKE CONCAT(CONCAT('%', #{userName}), '%')</if>日期时间范围查询<if test="dto.metaCreatedStart != null">AND `meta_cre..
·
字符串模糊查询
<if test="userName != null and userName!= ''">
AND `user_name` LIKE CONCAT(CONCAT('%', #{userName}), '%')
</if>
日期时间范围查询
<if test="dto.metaCreatedStart != null">
AND `meta_created` >= #{dto.metaCreatedStart}
</if>
<if test="dto.metaCreatedEnd != null">
AND `meta_created` <= #{dto.metaCreatedEnd}
</if>
集合范围查询
<if test="frameIds != null and frameIds.size> 0">
AND `frame_id ` IN (<foreach collection="frameIds" item="frameId" separator=","> #{frameId} </foreach>)
</if>
布尔类型查询
<if test="isNew != null and isNew == true">
AND `type` < 5
</if>
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)