傅行帆 5 år sedan
förälder
incheckning
d4d3a84118
1 ändrade filer med 10 tillägg och 10 borttagningar
  1. 10
    10
      src/main/resources/mapper/TaChannelMapper.xml

+ 10
- 10
src/main/resources/mapper/TaChannelMapper.xml Visa fil

127
 <!--        LEFT JOIN ta_person e ON t.share_person_id = e.person_id-->
127
 <!--        LEFT JOIN ta_person e ON t.share_person_id = e.person_id-->
128
         WHERE t.org_id = #{orgId}
128
         WHERE t.org_id = #{orgId}
129
         and t.is_org_first = 1
129
         and t.is_org_first = 1
130
-        and t.create_date >= DATE_FORMAT(#{startDate}, '%Y-%m-%d' ) and t.create_date &lt;= DATE_FORMAT(#{endDate},
130
+        and DATE_FORMAT(t.create_date, '%Y-%m-%d' )  >= DATE_FORMAT(#{startDate}, '%Y-%m-%d' ) and DATE_FORMAT(t.create_date, '%Y-%m-%d' ) &lt;= DATE_FORMAT(#{endDate},
131
         '%Y-%m-%d' )
131
         '%Y-%m-%d' )
132
         <if test="activityId != null and activityId != ''">
132
         <if test="activityId != null and activityId != ''">
133
             and t.target_id = #{activityId}
133
             and t.target_id = #{activityId}
185
             and t.building_id = #{buildingId}
185
             and t.building_id = #{buildingId}
186
         </if>
186
         </if>
187
         AND t.org_id = #{orgId}
187
         AND t.org_id = #{orgId}
188
-        AND t.visit_time >= DATE_FORMAT(#{startDate}, '%Y-%m-%d')
189
-        AND t.visit_time &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
188
+        AND DATE_FORMAT(t.visit_time, '%Y-%m-%d' )  >= DATE_FORMAT(#{startDate}, '%Y-%m-%d')
189
+        AND DATE_FORMAT(t.visit_time, '%Y-%m-%d' )  &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
190
         ) t
190
         ) t
191
         left join ta_person a on t.person_id = a.person_id
191
         left join ta_person a on t.person_id = a.person_id
192
         left join ta_person_from_record b on a.person_id = b.person_id and b.org_id = #{orgId}
192
         left join ta_person_from_record b on a.person_id = b.person_id and b.org_id = #{orgId}
229
         'house'
229
         'house'
230
         )
230
         )
231
         AND t.org_id = #{orgId}
231
         AND t.org_id = #{orgId}
232
-        AND t.visit_time >= DATE_FORMAT(#{startDate}, '%Y-%m-%d')
233
-        AND t.visit_time &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
232
+        AND DATE_FORMAT(t.visit_time, '%Y-%m-%d' ) >= DATE_FORMAT(#{startDate}, '%Y-%m-%d')
233
+        AND DATE_FORMAT(t.visit_time, '%Y-%m-%d' ) &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
234
         <if test="targetId != null and targetId != ''">
234
         <if test="targetId != null and targetId != ''">
235
             and t.target_id = #{targetId}
235
             and t.target_id = #{targetId}
236
         </if>
236
         </if>
290
         <!--        LEFT JOIN ta_person e ON t.share_person_id = e.person_id-->
290
         <!--        LEFT JOIN ta_person e ON t.share_person_id = e.person_id-->
291
         WHERE t.org_id = #{orgId}
291
         WHERE t.org_id = #{orgId}
292
         and t.is_org_first = 1
292
         and t.is_org_first = 1
293
-                and t.create_date >= DATE_FORMAT(#{startDate}, '%Y-%m-%d' ) and t.create_date &lt;= DATE_FORMAT(#{endDate},
293
+                and DATE_FORMAT(t.create_date, '%Y-%m-%d' ) >= DATE_FORMAT(#{startDate}, '%Y-%m-%d' ) and DATE_FORMAT(t.create_date, '%Y-%m-%d' ) &lt;= DATE_FORMAT(#{endDate},
294
                 '%Y-%m-%d' )
294
                 '%Y-%m-%d' )
295
         <if test="activityId != null and activityId != ''">
295
         <if test="activityId != null and activityId != ''">
296
             and t.target_id = #{activityId}
296
             and t.target_id = #{activityId}
349
             and t.building_id = #{buildingId}
349
             and t.building_id = #{buildingId}
350
         </if>
350
         </if>
351
         AND t.org_id = #{orgId}
351
         AND t.org_id = #{orgId}
352
-        AND t.visit_time >= DATE_FORMAT(#{startDate}, '%Y-%m-%d')
353
-        AND t.visit_time &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
352
+        AND DATE_FORMAT( t.visit_time, '%Y-%m-%d' ) >= DATE_FORMAT(#{startDate}, '%Y-%m-%d')
353
+        AND DATE_FORMAT( t.visit_time, '%Y-%m-%d' ) &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
354
         ) t
354
         ) t
355
         left join ta_person a on t.person_id = a.person_id
355
         left join ta_person a on t.person_id = a.person_id
356
         left join ta_person_from_record b on a.person_id = b.person_id and b.org_id = #{orgId}
356
         left join ta_person_from_record b on a.person_id = b.person_id and b.org_id = #{orgId}
393
         'house'
393
         'house'
394
         )
394
         )
395
         AND t.org_id = #{orgId}
395
         AND t.org_id = #{orgId}
396
-        AND t.visit_time >= DATE_FORMAT(#{startDate}, '%Y-%m-%d')
397
-        AND t.visit_time &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
396
+        AND DATE_FORMAT( t.visit_time, '%Y-%m-%d' ) >= DATE_FORMAT(#{startDate}, '%Y-%m-%d')
397
+        AND DATE_FORMAT( t.visit_time, '%Y-%m-%d' ) &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
398
         <if test="targetId != null and targetId != ''">
398
         <if test="targetId != null and targetId != ''">
399
             and t.target_id = #{targetId}
399
             and t.target_id = #{targetId}
400
         </if>
400
         </if>