py_mybatis
py_mybatis copied to clipboard
foreach,后面的内容没有被拼接上;
xml:
IF NOT EXISTS
(SELECT Id from [istrong_data_collection].[dbo].[FY_XjWeather] where CompanyId = #{SiteCodeList['CompanyId']} and SiteCode = #{SiteCodeList['SiteCode']} and DataTime=#{SiteCodeList['Time']})
BEGIN
INSERT INTO [istrong_data_collection].[dbo].[FY_XjWeather]
([CompanyId],[SiteCode],[SiteSource],[Rain],[DataTime],[Remark])
VALUES
($f{SiteCodeList['CompanyId']},$f{SiteCodeList['SiteCode']},#{SiteCodeList['SiteSource']},${SiteCodeList['Rain']},$f{SiteCodeList['Time']},#{SiteCodeList['DataSource']})
END
</foreach>
END
</insert>
IF NOT EXISTS
(SELECT Id from [istrong_data_collection].[dbo].[FY_XjWeather] where CompanyId = '64' and SiteCode = '58752' and DataTime='2020-08-03 13:00:00')
BEGIN
INSERT INTO [istrong_data_collection].[dbo].[FY_XjWeather]
([CompanyId],[SiteCode],[SiteSource],[Rain],[DataTime],[Remark])
VALUES
('64','58752','2',1.688,'2020-08-03 13:00:00','测试')
END
问题: foreach后的END没有拼接上,请教大神,这个是为什么?
完整的xml 发一下,你这个语法不太像sql啊