Commit faaeb2d4 by 向延琳

fix:sql error

1 parent f3acd267
...@@ -43,9 +43,12 @@ ...@@ -43,9 +43,12 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from t_device_power from t_device_power
<where>
and sn in
<foreach collection="sn" item="sn" index="index" open="(" close=")" separator=","> <foreach collection="sn" item="sn" index="index" open="(" close=")" separator=",">
#{sn} #{sn}
</foreach> </foreach>
</where>
</select> </select>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
......
...@@ -2,6 +2,7 @@ package cn.com.glsx.stdinterface.modules.mapper; ...@@ -2,6 +2,7 @@ package cn.com.glsx.stdinterface.modules.mapper;
import cn.com.glsx.Application; import cn.com.glsx.Application;
import cn.com.glsx.stdinterface.modules.entity.DevicePower; import cn.com.glsx.stdinterface.modules.entity.DevicePower;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
...@@ -38,4 +39,11 @@ class DevicePowerMapperTest { ...@@ -38,4 +39,11 @@ class DevicePowerMapperTest {
devicePowerMapper.insertOrUpdateBatch(list); 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 \ 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!