thymeleaf吧 关注:14贴子:21
  • 1回复贴,共1

复杂判断问题,求大佬

取消只看楼主收藏回复

<table>
<thead>
<tr>
<th>用户名</th>
<th>日期</th>
<th>签到时间</th>
</tr>
</thead>
<tbody>
<tr th:if="${signList!=null}" th:each="sign,sStat:${signList}">
<td th:text="${sign.getUserName()}"></td>
<td th:text="${#dates.format(sign.getSignDate(),'MM-dd')}"></td>
<!-- 这个判断怎么写
判断日期是否为今天

判断签到时间是否为空

显示签到按钮

显示签到时间

判断签到时间是否为空

显示'-'

显示签到时间
-->
</tr>
</tbody>
</table>
数据
签到情况列表
用户名 日期 签到时间
aaa 8-17 08:00
aaa 8-18 08:00
aaa 8-19 null
aaa 8-20 08:00
aaa 8-21 08:00
aaa 8-22 null
期望结果
用户名 日期 签到时间
aaa 8-17 08:00
aaa 8-18 08:00
aaa 8-19 -
aaa 8-20 08:00
aaa 8-21 08:00
aaa 8-22 签到按钮


1楼2020-08-22 20:30回复
    写了四个判断解决了
    1.日期是今天&&签到时间为空
    2.日期是今天&&签到时间不为空
    3.日期是不今天&&签到时间为空
    4.日期不是今天&&签到时间不为空


    2楼2020-08-23 12:30
    回复