mapper.xml与sql知识总结
1.已知生日,求年龄 TIMESTAMPDIFF(year,birthday,CURDATE()) age 2.根据字段内有无值,判断状态 ISNULL(die_date) status 3.mapper.xml里的date类型与mysql中的日期作比较 and a.diagnosed >= DATE_FORMAT(#{start_diagnosed}, '%Y-%m-%d') and a.diagnosed <= DATE_FORMAT(#{end_diagnosed}, '%Y-%m-%d') 注:if判断中date类型不能与空字符串做对比 作者:GraySakura
用户评论