@@ -319,9 +319,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
e.printStackTrace();
throw new BusinessException("转换异常");
}
- Long l=in.getReleaseEnd().getTime()-in.getReleaseStart().getTime();
- Date x=new Date(in.getReleaseStart().getTime()+(l/2));
- int i=publicReleaseMapper.checkTime(x);
+ int i=publicReleaseMapper.checkTime(in.getReleaseStart(),in.getReleaseEnd());
if (i>0) {
return true;
@@ -54,6 +54,6 @@ public interface PublicReleaseMapper {
OutPublicRelease selectDtails(@Param("id") Integer id,@Param("ufid")String ufid);
- int checkTime(Date x);
+ int checkTime(@Param("start")Date start, @Param("end")Date end);
@@ -614,7 +614,9 @@ a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.latitude ,
</select>
<select id="checkTime" resultType="java.lang.Integer">
- select count(*) from public_release where release_start > #{start} and release_start < #{end}
+ select count(*) from public_release where (release_start >= #{start} and release_start < #{end})
+ or (release_start < #{start} and release_end > #{start})
+ or (release_start < #{end} and release_end > #{end})
</mapper>