zoukankan      html  css  js  c++  java
  • 单表的增删改查-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.lzl.dao.ShopDao">


    <select id="select" resultType="Shop">

    select * from shop

    </select>

    <!-- 删除 -->
    <delete id="del">
    delete from shop where sid in (${sids})
    </delete>
    <!-- 添加 -->
    <select id="toAdd" resultType="Shop">

    select * from shop

    </select>
    <!-- 添加 -->
    <insert id="add">

    INSERT INTO `zhoukao3`.`shop` (`sid`, `sname`, `sfenlei`, `sjifen`, `sduihuan`, `syiduihuan`) VALUES (null, #{sname}, #{sfenlei}, #{sjifen}, #{sduihuan}, #{syiduihuan});

    </insert>

    <select id="selectOne" resultType="Shop">

    select * from shop where sid = #{sid}

    </select>
    <update id="update">
    UPDATE `shop` SET `sname`=#{sname}, `sfenlei`=#{sfenlei}, `sjifen`=#{sjifen}, `sduihuan`=#{sduihuan}, `syiduihuan`=#{syiduihuan} WHERE (`sid`=#{sid});
    </update>
    </mapper>

  • 相关阅读:
    tyvj[1087]sumsets
    tyvj[1089]smrtfun
    [bzoj3289]Mato的文件管理
    luogu[2093]零件分组
    luogu[1135]奇怪的电梯
    codevs[1300]文件排版
    luogu[1140]相似基因
    动态规划练习题 胖男孩
    动态规划练习题 汇率
    vijos[1355]车队过桥问题
  • 原文地址:https://www.cnblogs.com/liuzhaolong/p/12880549.html
Copyright © 2011-2022 走看看