Subversion Repositories SmartDukaan

Rev

Rev 4500 | Rev 5372 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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>
5361 mandeep.dh 26
 
27
  <select id="getScansFromOrderId" parameterType="java.lang.Long" resultType="scan">
28
    SELECT * 
29
    FROM scanNew
30
    WHERE orderId = #{orderId}
31
    ORDER BY scannedAt
32
  </select>
4500 mandeep.dh 33
</mapper>