1.配置文件中的写法

<if test="startTime !=null and startTime !='' ">
         <![CDATA[ and createTime  >=  #{startTime}  ]]>
    </if>
    <if test="endTime !=null and endTime!='' "  >
         <![CDATA[ and createTime <=  #{endTime}  ]]>
    </if>

2.Java代码中参数的传递

》实体类中的成员变量

private Date startTime;

private Date endTime;

 

entity.setStartTime(startTime);
entity.setEndTime(endTime);

》使用map集合封装参数

Map<String, Object> map = new HashMap<String, Object>();
map.put("startTime", startTime);
map.put("endTime", endTime);

 

IT技术和行业交流群 417691667

相关文章:

  • 2022-12-23
  • 2022-01-29
  • 2021-12-13
  • 2022-12-23
  • 2021-12-18
  • 2021-12-28
  • 2021-06-19
  • 2021-09-21
猜你喜欢
  • 2021-12-12
  • 2022-12-23
  • 2021-12-12
  • 2021-12-12
  • 2022-12-23
  • 2021-12-18
相关资源
相似解决方案