LocationMapper.xml
1.02 KB
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huaheng.pc.general.location.mapper.LocationMapper">
<select id="getEmptyContainerInLocation" resultType="com.huaheng.pc.general.location.domain.Location">
SELECT * FROM location t
<where>
t.warehouseId = #{warehouseId} AND t.containerCode !='' AND t.containerCode is not NULL
AND t.`code` NOT in (SELECT b.locationCode FROM inventory b WHERE b.warehouseId = #{warehouseId} )
<if test="containerCode != null and containerCode !=''">
<bind name="temp1" value="'%' + containerCode + '%'" />
and t.containerCode like #{temp1}
</if>
<if test="locationCode != null and locationCode !=''">
<bind name="temp2" value="'%' + locationCode + '%'" />
and t.`code` like #{temp2}
</if>
</where>
</select>
</mapper>