Commit faaeb2d4 by 向延琳

fix:sql error

1 parent f3acd267
......@@ -43,9 +43,12 @@
select
<include refid="Base_Column_List"/>
from t_device_power
<foreach collection="sn" item="sn" index="index" open="(" close=")" separator=",">
#{sn}
</foreach>
<where>
and sn in
<foreach collection="sn" item="sn" index="index" open="(" close=")" separator=",">
#{sn}
</foreach>
</where>
</select>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
......
......@@ -2,6 +2,7 @@ package cn.com.glsx.stdinterface.modules.mapper;
import cn.com.glsx.Application;
import cn.com.glsx.stdinterface.modules.entity.DevicePower;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
......@@ -38,4 +39,11 @@ class DevicePowerMapperTest {
devicePowerMapper.insertOrUpdateBatch(list);
}
@Test
public void listBySn(){
List<DevicePower> devicePowers = devicePowerMapper.listBySn(Lists.newArrayList("111"));
System.out.println(JSON.toJSONString(devicePowers));
}
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!