src/com/javapandeng/mapper/UserMapper.xml

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?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.javapandeng.mapper.UserMapper">
    <!--实体类与数据库映射字段部分-->
    <resultMap id="ResultMapUser" type="com.javapandeng.po.User">
        <result property="id" column="id" jdbcType="INTEGER"/>
        <result property="userName" column="userName" jdbcType="VARCHAR"/>
        <result property="passWord" column="passWord" jdbcType="VARCHAR"/>
        <result property="phone" column="phone" jdbcType="VARCHAR"/>
        <result property="realName" column="realName" jdbcType="VARCHAR"/>
        <result property="sex" column="sex" jdbcType="VARCHAR"/>
        <result property="address" column="address" jdbcType="VARCHAR"/>
        <result property="email" column="email" jdbcType="VARCHAR"/>
    </resultMap>

    <!-- 声明数据库字段 -->
    <sql id="User_field">
        id,userName,passWord,phone,realName,sex,address,email
    </sql>

    <!-- 实体类属性-->
    <sql id="User_insert">
        #{id},#{userName},#{passWord},#{phone},#{realName},#{sex},#{address},#{email}
    </sql>

    <!-- 更新结果  -->
    <sql id="User_update">
        <if test="userName != null">
            userName = #{userName},
        </if>
        <if test="passWord != null">
            passWord = #{passWord},
        </if>
        <if test="phone != null">
            phone = #{phone},
        </if>
        <if test="realName != null">
            realName = #{realName},
        </if>
        <if test="sex != null">
            sex = #{sex},
        </if>
        <if test="address != null">
            address = #{address},
        </if>
        <if test="email != null">
            email = #{email}
        </if>

    </sql>

    <!-- 查询时条件   -->
    <sql id="User_where">
        <if test="id != null">
            and id = #{id}
        </if>
        <if test="userName != null">
            and userName = #{userName}
        </if>
        <if test="passWord != null">
后面还有 207 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。