Pārlūkot izejas kodu

客户信息表新增时间范围查询

cgp 2 dienas atpakaļ
vecāks
revīzija
dea3b8da3e

+ 13 - 0
fs-service/src/main/java/com/fs/handwrite/domain/HandwriteCollection.java

@@ -64,4 +64,17 @@ public class HandwriteCollection implements Serializable
 
     /** 销售名称*/
     private String companyUserName;
+
+    /**
+     * 开始日期
+     * */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "开始日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date startDate;
+    /**
+     * 结束日期
+     * */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "结束日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date endDate;
 }

+ 9 - 2
fs-service/src/main/resources/mapper/handwrite/HandwriteCollectionMapper.xml

@@ -25,8 +25,8 @@
 
     <select id="selectHandwriteCollectionList" parameterType="HandwriteCollection" resultMap="HandwriteCollectionResult">
         select hc.id, hc.patient_name, hc.patient_phone, hc.create_time, hc.update_time,
-               hc.bill_img_url, hc.order_code, hc.create_by, hc.update_by, hc.company_user_id,hc.extra_img_url,
-               cu.nick_name as companyUserName
+        hc.bill_img_url, hc.order_code, hc.create_by, hc.update_by, hc.company_user_id, hc.extra_img_url,
+        cu.nick_name as companyUserName
         from fs_handwrite_collection hc left join company_user cu on cu.user_id = hc.company_user_id
         <where>
             <if test="patientName != null and patientName != ''"> and hc.patient_name like concat('%', #{patientName}, '%')</if>
@@ -34,6 +34,13 @@
             <if test="companyUserName != null and companyUserName != ''"> and cu.nick_name like concat('%', #{companyUserName}, '%')</if>
             <if test="orderCode != null and orderCode != ''"> and hc.order_code = #{orderCode}</if>
             <if test="billImgUrl != null and billImgUrl != ''"> and hc.bill_img_url = #{billImgUrl}</if>
+            <!-- 创建时间范围过滤 -->
+            <if test="startDate != null">
+                and DATE(hc.create_time) >= #{startDate}
+            </if>
+            <if test="endDate != null">
+                and DATE(hc.create_time) <= #{endDate}
+            </if>
         </where>
         order by hc.create_time desc
     </select>