sql 报错 2

This commit is contained in:
GYJ
2024-12-30 19:21:19 +08:00
parent 6f1e9e34df
commit 4355b9f292
8 changed files with 53 additions and 62 deletions

View File

@@ -52,13 +52,13 @@
</if>
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
and date_format(u.create_time,'%Y-%m-%d') BETWEEN #{startTime} and #{endTime}
and u.create_time BETWEEN #{startTime} and #{endTime}
</if>
<if test="startTime!=null and startTime!='' and (endTime==null or endTime=='')">
and date_format(u.create_time,'%Y-%m-%d') &gt;= #{startTime}
and u.create_time &gt;= #{startTime}
</if>
<if test="endTime!=null and endTime!='' and (startTime==null or startTime=='')">
and date_format(u.create_time,'%Y-%m-%d') &lt;= #{endTime}
and u.create_time &lt;= #{endTime}
</if>
order by create_time desc
</select>
@@ -144,15 +144,7 @@
<if test="sysUserId!=null">
and sys_user_id=#{sysUserId}
</if>
<if test="type==1">
and date_format(o.create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
</if>
<if test="type==2">
and date_format(o.create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
</if>
<if test="type==3">
and date_format(o.create_time,'%Y')=date_format(#{date},'%Y')
</if>
and o.create_time between #{start} and #{end}
group by c.course_id
) a
order by a.coursenum desc
@@ -335,4 +327,4 @@
</update>
</mapper>
</mapper>