src/com/marry/dao/PhotoMapper.xml

(开头部分) 2KB

这里只显示每个文件的开头 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.marry.dao.PhotoMapper">
  <resultMap id="BaseResultMap" type="com.marry.entity.Photo" autoMapping="true">
    <id column="pid" property="pid"/>
    <association property="grapher" column="gid" select="selectGrapher"/>
  </resultMap>
  <select id="selectGrapher" resultType="com.marry.entity.Grapher">
    select * from grapher where gid=#{id}
  </select>
  <select id="select" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select *
    from photo
    where pid = #{pid,jdbcType=INTEGER}
  </select>
  <delete id="delete" parameterType="java.lang.Integer">
    delete from photo
    where pid = #{pid,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.marry.entity.Photo">
    insert into photo
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="pid != null">
        pid,
      </if>
      <if test="title != null">
        title,
      </if>
      <if test="url != null">
        url,
      </if>
      <if test="gid != null">
        gid,
      </if>
      <if test="tid != null">
        tid,
      </if>
      <if test="uid != null">
        uid,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="pid != null">
        #{pid,jdbcType=INTEGER},
      </if>
      <if test="title != null">
        #{title,jdbcType=VARCHAR},
      </if>
      <if test="url != null">
        #{url,jdbcType=VARCHAR},
      </if>
      <if test="gid != null">
        #{gid,jdbcType=INTEGER},
      </if>
      <if test="tid != null">
        #{tid,jdbcType=INTEGER},
      </if>
      <if test="uid != null">
        #{uid,jdbcType=INTEGER},
      </if>
后面还有 41 行代码,购买后查看完整代码

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

AI 解读 AI

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

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