Bladeren bron

更改sql

gaodd 2 jaren geleden
bovenliggende
commit
4df6713963

+ 7 - 6
src/main/java/com/chinaitop/depot/business/mapper/BusinessDrugStandingBookMapper.xml

@@ -631,10 +631,10 @@
631 631
 			        and org_id = #{orgId}
632 632
 			    </if>
633 633
 			    <if test="startDate !=null">
634
-			        and create_time >= to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss')
634
+			        and create_time >= DATE_FORMAT(#{startDate},'%Y-%m-%d %H:%i:%s')
635 635
 			    </if> 
636 636
 			    <if test="endDate !=null">
637
-			        and create_time &lt;= to_date(#{endDate},'yyyy-mm-dd hh24:mi:ss')
637
+			        and create_time &lt;= DATE_FORMAT(#{endDate},'%Y-%m-%d %H:%i:%s')
638 638
 			    </if>
639 639
 				GROUP BY
640 640
 					drug_kind,
@@ -668,7 +668,7 @@
668 668
 			        and create_time >= to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss')
669 669
 			    </if> -->
670 670
 			    <if test="startDate !=null">
671
-			        and create_time &lt; to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss')
671
+			        and create_time &lt; DATE_FORMAT(#{startDate},'%Y-%m-%d %H:%i:%s')
672 672
 			    </if>
673 673
 				GROUP BY
674 674
 					drug_kind,
@@ -753,7 +753,7 @@
753 753
 				AND drug_name = #{drug_name}
754 754
 				AND drug_specification = #{drug_specification}
755 755
 				AND drug_specification_unit = #{drug_specification_unit}
756
-				AND create_time &lt; to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss')				
756
+				AND create_time &lt; DATE_FORMAT(#{startDate},'%Y-%m-%d %H:%i:%s')		
757 757
 	           )a
758 758
 	        )b
759 759
     
@@ -873,7 +873,7 @@ select
873 873
 		                                   and org_id = #{orgId}
874 874
 		                                </if>
875 875
 		                                <if test="endDate !=null">
876
-			                               and create_time &lt;= to_date(#{endDate},'yyyy-mm-dd hh24:mi:ss')
876
+			                               and create_time &lt;= DATE_FORMAT(#{endDate},'%Y-%m-%d %H:%i:%s')
877 877
 			                            </if>
878 878
 										order by create_time desc
879 879
 								) a
@@ -909,7 +909,8 @@ select
909 909
 			        and org_id = #{orgId}
910 910
 			    </if>
911 911
 			    <if test="endDate !=null">
912
-			        and create_time &lt;= to_date(#{endDate},'yyyy-mm-dd hh24:mi:ss')
912
+			        <!-- and create_time &lt;= to_date(#{endDate},'yyyy-mm-dd hh24:mi:ss') -->
913
+			        and create_time &lt;= DATE_FORMAT(#{endDate},'%Y-%m-%d %H:%i:%s')
913 914
 			    </if>
914 915
 				GROUP BY
915 916
 					drug_kind,