时间段查询
xml:(where条件)
<iftest="Time1 !=null and Time1!='' and Time2 !=null and Time2!=''">
andSubmitTime<=#{Time2}andSubmitTime>=#{Time1}
</if>
entity:
@ApiModelProperty("开始时间")
privateStringTime1;
@ApiModelProperty("结束时间")
privateStringTime2;
impl:(时间分段处理)
StringTime1=null;
StringTime2=null;
if(teacherleaveinfo.getSubmitTime()!=null){
String[]submitTime=teacherleaveinfo.getSubmitTime().split("/");
Time1=submitTime[0];
Time2=submitTime[1];
}
teacherleaveinfo.setTime1(Time1);
teacherleaveinfo.setTime2(Time2);
sql替换符:(在Java的xml文件写sql是采用替换符)
用替换符号进行替换
mysql大于等于>=、小于等于<=、>、<的写法
大于等于 <![CDATA[ >= ]]>小于等于 <![CDATA[ <= ]]>
大于 <![CDATA[ > ]]>小于 <![CDATA[ < ]]>
时间分割转换: