解决springboot+swagger返回时间类型不匹配或者乱码问题

在mapping中针对数据库的查询时返回一个

<select id="getYiLiao" parameterType="java.util.Map" resultType="java.util.Map">
		SELECT
			ta.area_code as areaCode,
			ta.id as id,
			ta.number_show as numberShow,
			ta.org_code as orgCode,
			ta.type as type,
			ta.upload_url as uploadUrl,
			DATE_FORMAT(ta.`upload_time`,'%Y-%m-%d %H:%i:%S') as uploadTime
		from
		testuser ta
		where 1 = 1
		<if test="id!=null and id!=''">
			and ta.id=#{id}
		</if>
		<if test="stardTime!=null and stardTime!=''">
			AND DATE_FORMAT(ta.`upload_time`,'%Y-%m-%d') &gt;=DATE_FORMAT(#{stardTime},'%Y-%m-%d')
		</if>
		<if test="endTime!=null and endTime!=''">
			AND DATE_FORMAT(ta.`upload_time`,'%Y-%m-%d' )&lt;=DATE_FORMAT(#{endTime},'%Y-%m-%d')
		</if>
</select>
DATE_FORMAT(ta.`upload_time`,'%Y-%m-%d %H:%i:%S')对时间返回进行处理
>=对应 &gt;=
<=对应 &lt;=

否则报错Tag name expected
在这里插入图片描述

发布了32 篇原创文章 · 获赞 13 · 访问量 1527

猜你喜欢

转载自blog.csdn.net/weixin_38068605/article/details/103482442