预警 标准实施日期子表
This commit is contained in:
+31
@@ -74,4 +74,35 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getWarningDate" resultType="com.adc.da.slrs.sarStandWarning.entity.WarningDate">
|
||||
|
||||
|
||||
SELECT lawId,timeName,DATE_FORMAT(SSRQ,'%Y-%m-%d') as SSRQ FROM
|
||||
(
|
||||
select attr.STAND_ID as lawId,'SSRQ' as timeName,
|
||||
substring_index(substring_index(attr.SSRQ,',',b.help_topic_id+1),',',-1) SSRQ
|
||||
from sar_stand_attr_info attr
|
||||
join mysql.help_topic b
|
||||
on b.help_topic_id < (length(attr.SSRQ) - length(replace(attr.SSRQ,',',''))+1)
|
||||
|
||||
UNION ALL
|
||||
|
||||
select attr.STAND_ID as lawId,'XCXSSRQ' as timeName,
|
||||
substring_index(substring_index(attr.SSRQ,',',b.help_topic_id+1),',',-1) SSRQ
|
||||
from sar_stand_attr_info attr
|
||||
join mysql.help_topic b
|
||||
on b.help_topic_id < (length(attr.XCXSSRQ) - length(replace(attr.SSRQ,',',''))+1)
|
||||
UNION ALL
|
||||
select attr.STAND_ID as lawId,'ZCCSSRQ' as timeName,
|
||||
substring_index(substring_index(attr.ZCCSSRQ,',',b.help_topic_id+1),',',-1) SSRQ
|
||||
from sar_stand_attr_info attr
|
||||
join mysql.help_topic b
|
||||
on b.help_topic_id < (length(attr.SSRQ) - length(replace(attr.SSRQ,',',''))+1)
|
||||
|
||||
) as T
|
||||
WHERE
|
||||
DATE_FORMAT(T.SSRQ,'%Y-%m-%d') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m-%d') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d')
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user