|
@@ -282,20 +282,31 @@
|
|
|
w.wspeed,
|
|
|
CASE WHEN w.startdate IS NULL THEN w.applyfirestarttime ELSE w.startdate END AS startdate,
|
|
|
CASE WHEN w.enddate IS NULL THEN w.applyfireendtime ELSE w.enddate END AS enddate,
|
|
|
- w.signatory,
|
|
|
CASE WHEN w.inceptdate IS NULL THEN w.signdate ELSE w.inceptdate END AS inceptdate,
|
|
|
- CASE WHEN w.fiatuser1 IS NULL THEN w.fiatuser ELSE w.fiatuser1 END AS fiatuser1,
|
|
|
- w.fiatdate,
|
|
|
+ w.signatory,
|
|
|
w.startworktime,
|
|
|
w.newdate,
|
|
|
- w.finaltime,
|
|
|
+ CASE WHEN w.finaltime IS NULL THEN w.fireendtime ELSE w.finaltime END AS finaltime,
|
|
|
w.status,
|
|
|
w.workdept,
|
|
|
w.remark3 persons,
|
|
|
e.description,
|
|
|
w.wtickettype,
|
|
|
- CASE WHEN w.finaltime IS NULL THEN '1' ELSE '0' END AS tag,
|
|
|
- CASE WHEN finaltime IS NULL THEN '不合格' ELSE '正常' END as tagdes
|
|
|
+ w.applyfirestarttime,
|
|
|
+ w.applyfireendtime,
|
|
|
+ w.fireendtime,
|
|
|
+ <if test="'风场动火' == type or '二级动火' == type">
|
|
|
+ w.fiatuser8 AS fiatuser1,
|
|
|
+ w.fiatdate1 as fiatdate1,
|
|
|
+ CASE WHEN w.fireendtime IS NULL THEN '1' ELSE '0' END AS tag,
|
|
|
+ CASE WHEN w.fireendtime IS NULL THEN '不合格' ELSE '正常' END as tagdes
|
|
|
+ </if>
|
|
|
+ <if test="'风场动火' != type and '二级动火' != type">
|
|
|
+ CASE WHEN w.fiatuser1 IS NULL THEN w.fiatuser ELSE w.fiatuser1 END AS fiatuser1,
|
|
|
+ w.fiatdate,
|
|
|
+ CASE WHEN w.finaltime IS NULL THEN '1' ELSE '0' END AS tag,
|
|
|
+ CASE WHEN w.finaltime IS NULL THEN '不合格' ELSE '正常' END as tagdes
|
|
|
+ </if>
|
|
|
FROM
|
|
|
workticket w
|
|
|
LEFT JOIN LOCATIONS e ON w.wtnum = e.LOCATION
|
|
@@ -304,17 +315,34 @@
|
|
|
<where>
|
|
|
<if test="st !=null and et !=null">
|
|
|
|
|
|
- and ((w.finaltime >= #{st} and w.finaltime <= #{et})
|
|
|
- or (w.startdate >= #{st} and w.startdate <= #{et}
|
|
|
- and w.enddate >= #{st} and w.enddate <= #{et}
|
|
|
- AND w.enddate <= CONVERT ( VARCHAR, GETDATE ( ), 20 )
|
|
|
- and w.finaltime is null
|
|
|
- and w.newdate is null)
|
|
|
- or ( w.newdate IS not null
|
|
|
- and w.startdate >= #{st} and w.startdate <= #{et}
|
|
|
- AND w.enddate >= #{st} and w.enddate <= #{et}
|
|
|
- AND w.newdate >= #{st} and w.newdate <= #{et}
|
|
|
- and w.newdate <= CONVERT ( VARCHAR, GETDATE ( ), 20 )))
|
|
|
+
|
|
|
+ <if test="'风场动火' == type or '二级动火' == type">
|
|
|
+ and ((w.fireendtime >= #{st} and w.fireendtime <= #{et})
|
|
|
+ or (w.applyfirestarttime >= #{st} and w.applyfirestarttime <= #{et}
|
|
|
+ and w.applyfireendtime >= #{st} and w.applyfireendtime <= #{et}
|
|
|
+ AND w.applyfireendtime <= CONVERT ( VARCHAR, GETDATE ( ), 20 )
|
|
|
+ and w.fireendtime is null
|
|
|
+ and w.newdate is null)
|
|
|
+ or ( w.newdate IS not null
|
|
|
+ and w.applyfirestarttime >= #{st} and w.applyfirestarttime <= #{et}
|
|
|
+ AND w.applyfireendtime >= #{st} and w.applyfireendtime <= #{et}
|
|
|
+ AND w.newdate >= #{st} and w.newdate <= #{et}
|
|
|
+ and w.newdate <= CONVERT ( VARCHAR, GETDATE (), 20 )))
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="'风场动火' != type and '二级动火' != type">
|
|
|
+ and ((w.finaltime >= #{st} and w.finaltime <= #{et})
|
|
|
+ or (w.startdate >= #{st} and w.startdate <= #{et}
|
|
|
+ and w.enddate >= #{st} and w.enddate <= #{et}
|
|
|
+ and w.enddate <= CONVERT ( VARCHAR, GETDATE (), 20 )
|
|
|
+ and w.finaltime is null
|
|
|
+ and w.newdate is null)
|
|
|
+ or ( w.newdate IS not null
|
|
|
+ and w.startdate >= #{st} and w.startdate <= #{et}
|
|
|
+ AND w.enddate >= #{st} and w.enddate <= #{et}
|
|
|
+ AND w.newdate >= #{st} and w.newdate <= #{et}
|
|
|
+ and w.newdate <= CONVERT ( VARCHAR, GETDATE ( ), 20 )))
|
|
|
+ </if>
|
|
|
|
|
|
</if>
|
|
|
|
|
@@ -345,7 +373,17 @@
|
|
|
w.finaltime,
|
|
|
w.status,
|
|
|
w.workdept,
|
|
|
- CASE WHEN w.finaltime IS NULL THEN '1' ELSE '0' END AS tag
|
|
|
+ w.applyfirestarttime,
|
|
|
+ w.applyfireendtime,
|
|
|
+ w.fireendtime,
|
|
|
+ <if test="'风场动火' == type or '二级动火' == type">
|
|
|
+ CASE WHEN w.fireendtime IS NULL THEN '1' ELSE '0' END AS tag,
|
|
|
+ CASE WHEN w.fireendtime IS NULL THEN '不合格' ELSE '正常' END as tagdes
|
|
|
+ </if>
|
|
|
+ <if test="'风场动火' != type and '二级动火' != type">
|
|
|
+ CASE WHEN w.finaltime IS NULL THEN '1' ELSE '0' END AS tag,
|
|
|
+ CASE WHEN w.finaltime IS NULL THEN '不合格' ELSE '正常' END as tagdes
|
|
|
+ </if>
|
|
|
FROM
|
|
|
workticket w
|
|
|
LEFT JOIN LOCATIONS e ON w.wtnum = e.LOCATION
|
|
@@ -353,26 +391,44 @@
|
|
|
<where>
|
|
|
<if test="st !=null and et !=null">
|
|
|
|
|
|
- and ((w.finaltime >= #{st} and w.finaltime <= #{et})
|
|
|
- or (w.startdate >= #{st} and w.startdate <= #{et}
|
|
|
- and w.enddate >= #{st} and w.enddate <= #{et}
|
|
|
- AND w.enddate <= CONVERT ( VARCHAR, GETDATE ( ), 20 )
|
|
|
- and w.finaltime is null
|
|
|
- and w.newdate is null)
|
|
|
- or ( w.newdate IS not null
|
|
|
- and w.startdate >= #{st} and w.startdate <= #{et}
|
|
|
- AND w.enddate >= #{st} and w.enddate <= #{et}
|
|
|
- AND w.newdate >= #{st} and w.newdate <= #{et}
|
|
|
- and w.newdate <= CONVERT ( VARCHAR, GETDATE ( ), 20 )))
|
|
|
+ <if test="'风场动火' == type or '二级动火' == type">
|
|
|
+ and ((w.fireendtime >= #{st} and w.fireendtime <= #{et})
|
|
|
+ or (w.applyfirestarttime >= #{st} and w.applyfirestarttime <= #{et}
|
|
|
+ and w.applyfireendtime >= #{st} and w.applyfireendtime <= #{et}
|
|
|
+ AND w.applyfireendtime <= CONVERT ( VARCHAR, GETDATE ( ), 20 )
|
|
|
+ and w.fireendtime is null
|
|
|
+ and w.newdate is null)
|
|
|
+ or ( w.newdate IS not null
|
|
|
+ and w.applyfirestarttime >= #{st} and w.applyfirestarttime <= #{et}
|
|
|
+ AND w.applyfireendtime >= #{st} and w.applyfireendtime <= #{et}
|
|
|
+ AND w.newdate >= #{st} and w.newdate <= #{et}
|
|
|
+ and w.newdate <= CONVERT ( VARCHAR, GETDATE (), 20 )))
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="'风场动火' != type and '二级动火' != type">
|
|
|
+ and ((w.finaltime >= #{st} and w.finaltime <= #{et})
|
|
|
+ or (w.startdate >= #{st} and w.startdate <= #{et}
|
|
|
+ and w.enddate >= #{st} and w.enddate <= #{et}
|
|
|
+ and w.enddate <= CONVERT ( VARCHAR, GETDATE ( ), 20 )
|
|
|
+ and w.finaltime is null
|
|
|
+ and w.newdate is null)
|
|
|
+ or ( w.newdate IS not null
|
|
|
+ and w.startdate >= #{st} and w.startdate <= #{et}
|
|
|
+ AND w.enddate >= #{st} and w.enddate <= #{et}
|
|
|
+ AND w.newdate >= #{st} and w.newdate <= #{et}
|
|
|
+ and w.newdate <= CONVERT ( VARCHAR, GETDATE ( ), 20 )))
|
|
|
+ </if>
|
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
<if test="null != type">
|
|
|
- and w.wtickettype in
|
|
|
+
|
|
|
+ and w.wtickettype = #{type}
|
|
|
+ <!-- and w.wtickettype in
|
|
|
<foreach item="item" collection="type" open="(" separator="," close=")">
|
|
|
#{item,jdbcType=VARCHAR}
|
|
|
- </foreach>
|
|
|
+ </foreach>-->
|
|
|
|
|
|
</if>
|
|
|
|