| 4500 |
mandeep.dh |
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
2 |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
3 |
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
4 |
|
|
|
5 |
<mapper namespace="in.shop2020.warehouse.persistence.ScanMapper">
|
|
|
6 |
<resultMap type="scan" id="scanResult">
|
|
|
7 |
<id property="id" column="id"/>
|
|
|
8 |
</resultMap>
|
|
|
9 |
|
|
|
10 |
<insert id="insert" parameterType="scan" useGeneratedKeys="true" keyProperty="id">
|
|
|
11 |
INSERT INTO scanNew
|
|
|
12 |
(inventoryItemId, warehouseId, type, scannedAt, quantity, orderId)
|
|
|
13 |
VALUES
|
|
|
14 |
(#{inventoryItemId}, #{warehouseId}, #{type}, NOW(), #{quantity}, #{orderId})
|
|
|
15 |
</insert>
|
|
|
16 |
|
|
|
17 |
<select id="get" parameterType="map" resultType="scan">
|
|
|
18 |
SELECT *
|
|
|
19 |
FROM scanNew
|
|
|
20 |
WHERE inventoryItemId = #{inventoryItemId}
|
|
|
21 |
<if test="scanType != null">
|
|
|
22 |
AND type = #{scanType}
|
|
|
23 |
</if>
|
|
|
24 |
ORDER BY scannedAt
|
|
|
25 |
</select>
|
|
|
26 |
</mapper>
|