|
|
@@ -105,7 +105,11 @@
|
|
|
LEFT JOIN kd_technician tech ON tech.id = COALESCE(get_xm_info(xm.id, 'XMFZR', #{ew.yearAndMonth}), xm.XMFZR) and tech.tenant_id = #{ew.tenantId}
|
|
|
LEFT JOIN kd_department d on d.id = COALESCE(get_xm_info(xm.id, 'XMSQDWID', #{ew.yearAndMonth}), xm.XMSQDWID)
|
|
|
WHERE xm.tenant_id = #{ew.tenantId}
|
|
|
- and #{ew.yearAndMonth} between DATE_FORMAT(xm.XMKSSJ, '%Y%m') and date_format(COALESCE(get_xm_info(xm.id, 'XMJSSJ', #{ew.yearAndMonth}),xm.XMJSSJ), '%Y%m')
|
|
|
+ and
|
|
|
+ (
|
|
|
+ #{ew.yearAndMonth} between DATE_FORMAT(xm.XMKSSJ, '%Y%m') and date_format(COALESCE(get_xm_info(xm.id, 'XMJSSJ', #{ew.yearAndMonth}),xm.XMJSSJ), '%Y%m')
|
|
|
+ or (xm.XMKSSJ is null and xm.status=0 and DATE_FORMAT(xm.create_time, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth})
|
|
|
+ )
|
|
|
<if test="ew.xmbh!=null and ew.xmbh!=''">and xm.XMBH like concat('%',#{ew.xmbh},'%')</if>
|
|
|
<if test="ew.xmmc!=null and ew.xmmc!=''">and COALESCE(get_xm_info(xm.id, 'XMMC', #{ew.yearAndMonth}), xm.XMMC) like concat('%',#{ew.xmmc},'%')</if>
|
|
|
<if test="ew.xmfzrxm!=null and ew.xmfzrxm!=''">and tech.name like concat('%', #{ew.xmfzrxm},'%')</if>
|