mitao
2025-03-14 392b42c4891cf2e6beda57ab32c51598f290f4b7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?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.ruoyi.seatademo.mapper.ProductMapper">
 
  <resultMap type="Product" id="ProductResult">
    <id     property="id"              column="id"                />
    <result property="price"           column="price"             />
    <result property="stock"           column="stock"             />
    <result property="lastUpdateTime"  column="last_update_time"  />
  </resultMap>
 
  <select id="selectById" parameterType="Product" resultMap="ProductResult">
    select id, price, stock, last_update_time
    from product where id = #{productId}
  </select>
 
  <update id="updateById" parameterType="Product">
    update product set price = #{price}, stock = #{stock}, last_update_time = sysdate() where id = #{id}
  </update>
 
</mapper>