Mybatis动态sql,比较datetime类型大小及大于小于号转义

	<select id="fuzzySearchUserid" parameterType="String"
		resultType="com.joshvm.commons.bean.mysql.User">
		SELECT
		*
		FROM
		user
		<where>
			<if test="username!=null">
				username LIKE '%${username}%'
			</if>
			<if test="nickname!=null">
				AND nickname LIKE '%${nickname}%'
			</if>
			<if test="email!=null">
				AND email LIKE '%${email}%'
			</if>
			<if test="state!=null">
				AND state = ${state}
			</if>
			<if test="createTimeBetween!=null">
				AND UNIX_TIMESTAMP(create_time) &gt;= ${createTimeBetween}
			</if>
			<if test="createTimeTo!=null">
				AND UNIX_TIMESTAMP(create_time) &lt;= ${createTimeTo}
			</if>
		</where>
	</select>

 

相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页