Browse Source

优化通行性能问题

longmeizhen@avic-s.com 2 years ago
parent
commit
8bbe395e7d

+ 2 - 2
src/main/java/com/palmnest/dao/estateserve/impl/VisitorInFoDaoImpl.java

@@ -33,7 +33,7 @@ public class VisitorInFoDaoImpl extends GenericDaoHibernate<Object, Integer> imp
 
 	@Override
 	public Integer getVisitorCodeMaxCount(String visitorStartTime) {
-		String strSQL="SELECT MAX(t1.codeNumber) from tb_VisitorCode t1 where DATE_FORMAT(t1.codeCreateTime,'%Y-%m-%d')='"+visitorStartTime+"'";
+		String strSQL="SELECT MAX(t1.codeNumber) from tb_VisitorCode t1 where t1.codeCreateTime >='"+visitorStartTime+" 00:00:00' and t1.codeCreateTime <= '"+visitorStartTime+" 23:59:59'";
 		Integer count=getJdbcTemplate().queryForInt(strSQL);
 		if(count==null){
 			return 0;
@@ -43,7 +43,7 @@ public class VisitorInFoDaoImpl extends GenericDaoHibernate<Object, Integer> imp
 
 	@Override
 	public Map<String, Object> getVisitorCode(String visitorStartTime) {
-		String strSQL="SELECT * from tb_VisitorCode t1 where DATE_FORMAT(t1.codeCreateTime,'%Y-%m-%d')='"+visitorStartTime+"'";
+		String strSQL="SELECT * from tb_VisitorCode t1 where t1.codeCreateTime >='"+visitorStartTime+" 00:00:00' and t1.codeCreateTime <= '"+visitorStartTime+" 23:59:59'";
 		List<Map<String,Object>> list=getJdbcTemplate().queryForList(strSQL);
 		if(list!=null && list.size()>0){
 			return list.get(0);