mybatis 在mysql查询条件日期在某两个日期之间

xiaoxiao2021-02-28  66

mybatis内sql语句,查询语句日期在两者之间 <select id="selectByParamCount" resultType="java.lang.Integer" parameterType="com.sss.fin.cif.vo.admin.BankCardAuditQuery"> select count(1) from tablename <where> <if test="operatorDateStart != null and operatorDateStart !='' " > operator_date >= #{operatorDateStart,jdbcType=VARCHAR} </if> <if test="operatorDateEnd != null and operatorDateEnd !='' " > <![CDATA[ and operator_date <= concat(#{operatorDateEnd,jdbcType=VARCHAR},'235959') ]]> </if> </where> </select> <![CDATA[ ]]> 转义< (小于号) sql语句中,默认把yyyyMMdd定位成该日期的零点整
转载请注明原文地址: https://www.6miu.com/read-53558.html

最新回复(0)