首页 > 数据库 >sql

sql

时间:2023-05-28 21:01:57浏览次数:29  
标签:name item cove phone video sql id

<?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>

  

标签:name,item,cove,phone,video,sql,id
From: https://www.cnblogs.com/zjxzhj/p/17438831.html

相关文章

  • mysql从库执行同步后,查看状态显示"Authentication requires secure connection"异常
    问题描述:mysql从库执行同步后,查看状态显示"Authenticationrequiressecureconnection"异常,如下所示:数据库:mysql8.0.27系统:rhel7.31、异常重现mysql>changemastertomaster_host='192.168.133.111',master_user='repluser',master_password='repluser�......
  • [20230516]完善spsw.sql脚本.txt
    [20230516]完善spsw.sql脚本.txt--//以前写的spsw.sql脚本通过加入提示,产生好的执行计划(sql_id=good_sql_id),替换有问题的sql语句(bad_sql_id).--//现在遇到一个问题,就是现在的dg可以做只读查询,里面的sql语句没有在主库执行过,我抽取的脚本在sqlplus执行时里面的\r字符给--//......
  • Mybatis-plus中自定义的sql语句调用QueryWrapper实现查询
     一、引言MP自带的条件构造器虽然很强大,有时候也避免不了写稍微复杂一点业务的sql,那么今天说说MP怎么自定义sql语句吧。 二、具体实现使用注解实现:在我们Mapper接口中定义自定义方法即可。/***@Date:2019/6/1014:40*@Description</span>:User对象持久层*/p......
  • MYSQL提取
    数据库root权限获取方法MYSQL3306端口弱口令爆破sqlmap注入--sql-shell模式网站的数据库配置文件中拿到明文密码信息CVE-2012-2122漏洞一、CVE-2012-2122漏洞介绍当连接MariaDB/MYSQL时,输入的密码会与期望的正确密码比较,由于不正确的处理,会导致即使是memcmp()返回一个非......
  • 数据库 数据的删除 SQL
    --delete删除--deletefrom表名where条件--删除表中所有的数据deletefromstudent;deletefromstudentwheresid=7deletefromstudentwhereageisnulldeletefromstudentwhereage>28ortid=102--insertupdatedeletedml语言:数据操纵语言......
  • 数据库 建库建表 查看表结构 sql
    --sql结构化查询语言操作数据库的--注释--空格--创建数据库createdatabaseitquanmingxing;--创建数据库的时候设置编码createdatabaseitquanmingxing2CHARACTERsetutf8;--删除数据库dropdatabaseitquanmingxing;--删除数据库前先判断数据库是......
  • Java:SpringBoot整合Canal+RabbitMQ组合实现MySQL数据监听
    canal[kə’næl],译意为水道/管道/沟渠,主要用途是基于MySQL数据库增量日志解析,提供增量数据订阅和消费目录一、MySQL设置二、启动Canal服务端三、通过Canal客户端消费数据四、通过RabbitMQ消费数据1、启动RabbitMQ2、修改canal配置3、消费RabbitMQ中的数据文档资料github:https......
  • Mysql与PG对比
    参考:https://zhuanlan.zhihu.com/p/435829273https://blog.csdn.net/weixin_40983094/article/details/119027700  PG直接提供忽略大小写的模糊匹配ilike提供分组排序row_number()over(partitionbyxxxorderbyxxxdesc)通过多版本并发控制MVCC支持并发,这使得写......
  • 202305281631-《远程Linux服务器——安装tomcat8、jdk1.8、mysql5——mysql workerben
    bash已连接的上,但workerbench连不上,提示:1.FailedtoConnecttoMySQLat11.11.11.111:[email protected]'11.11.11.111'isnotallowedtoconnecttothisMySQLserver解决办法(为什么,我也不知道):1.登录mysql,一次执......
  • WEB漏洞—SQL注入之Oracle,MongoDB等注入
     1.明确注入数据库类型、权限2.明确提交方法、参数类型等高权限可以执行文件读取,低权限就老老实实获取数据,最终目的都是获取网站权限 常见数据库类型mysql,access,mssql,mongoDB,postgresql,sqlite,oracle,sybase等1、Access注入Access与mysql结构,除access之外,其他数据库结......