zoukankan      html  css  js  c++  java
  • //增删改的配置文件如下

    //增删改的配置文件如下

    <?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">
    <!-- 写sql语句 -->
    <mapper namespace="jun">
    <!-- 通过id 查询一个用户 -->
    <select id="findUserById" parameterType="Integer" resultType="cn.lijin.mybatis.pojo.User">
    select * from user where id=#{lijun}
    </select>
    <!-- 根据用户名称模糊查询 -->
    <select id="findUserByUsername" parameterType="String" resultType="cn.lijin.mybatis.pojo.User">
    select * from user where username like "%"#{lijun}"%"
    </select>
    <!-- 添加用户 -->
    <insert id="inserUser" parameterType="cn.lijin.mybatis.pojo.User">
    insert into user(username,birthday,address,sex) values (#{username},#{birthday},#{address},#{sex})
    </insert>
    <!-- 更新操 -->
    <update id="lijun666" parameterType="cn.lijin.mybatis.pojo.User">
    update user
    set username= #{username},sex= #{sex},birthday= #{birthday},address= #{address}
    where id=#{id}
    </update>
    <!-- 删除掉 -->
    <delete id="deleteUser" parameterType="Integer">
    delete from user
    where id= #{jun}
    </delete>
    </mapper>

  • 相关阅读:
    AtCoder Regular Contest 093
    AtCoder Regular Contest 094
    G. Gangsters in Central City
    HGOI 20190711 题解
    HGOI20190710 题解
    HGOI 20190709 题解
    HGOI 20190708 题解
    HGOI20190707 题解
    HGOI20190706 题解
    HGOI 20190705 题解
  • 原文地址:https://www.cnblogs.com/lijun6/p/10586062.html
Copyright © 2011-2022 走看看