sql

获取数据
select * from xd.video
传参
 select * from xd.video where id = #{id}
传2参
 select * from xd.video where point = #{ point } and title like concat('',#{title},'%')
新增 
INSERT INTO xd.video (`title`,`summary`,`price`,`point`) VALUES (#{title},#{summary},#{price},#{point})
<select id="listVideo" resultType="com.example.demoal.domain.Video">
     select * from xd.video where id = #{id}
 </select>
 <select id="selectByPoinAndTitleLike" resultType="Video">
     select * from xd.video where point = #{ point } and title like concat('%',#{title},'%')
 </select>
新增 

<insert id="addLike" parameterType="Video" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
    INSERT INTO xd.video (`title`,`summary`,`price`,`point`) VALUES (#{title},#{summary},#{price},#{point})
</insert>

  

posted @ 2022-06-13 15:03  zjxgdq  阅读(7)  评论(0编辑  收藏  举报