| <?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.example.myproject.mapper.PromotionMapper"> |
| |
| <insert id="insert" parameterType="com.example.myproject.entity.Promotion"> |
| INSERT INTO promotion ( |
| name, description, start_time, end_time, discount_percentage, applicable_torrent_ids |
| ) VALUES ( |
| #{name}, #{description}, #{startTime}, #{endTime}, #{discountPercentage}, #{applicableTorrentIds} |
| ) |
| </insert> |
| <update id="updateById" parameterType="com.example.myproject.entity.Promotion"> |
| update promotion |
| set is_deleted = #{isDeleted}, |
| update_time = #{updateTime} |
| where id = #{id} |
| </update> |
| |
| |
| |
| </mapper> |