sql
Posted zjxgdq
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql相关的知识,希望对你有一定的参考价值。
<?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.demotest.dao.VideoMapper"> <sql id="sele_fi"> name ,phone,cove </sql> <select id="selectById" resultType="video"> select * from video where id = #video_id; </select> <select id="selectByIdList" resultType="video"> select <include refid="sele_fi"></include> from video; </select> <insert id="add" parameterType="video" useGeneratedKeys="true" keyColumn="id" keyProperty="id"> insert into video (name, phone, cove) values (#name, #phone, #cove) </insert> <insert id="addHandle" parameterType="video"> insert into video (name, phone, cove) values <foreach collection="list" item="item" index="index" separator=","> (#item.name, #item.phone, #item.cove) </foreach> </insert> <update id="editUpdate" parameterType="video"> update video <trim prefix="set" suffixOverrides=","> <if test="name !=null"> name = #name, </if> <if test="phone !=null"> phone = #phone, </if> <if test="cove !=null"> cove = #cove, </if> </trim> where id = #id </update> <delete id="deleteId" parameterType="video"> delete from video where id = #id </delete> </mapper>
本文来自博客园,作者:zjxgdq,转载请注明原文链接:https://www.cnblogs.com/zjxzhj/p/17438831.html
sql sql.sql
以上是关于sql的主要内容,如果未能解决你的问题,请参考以下文章