WebRoot/WEB-INF/classes/com/mapper/ArticleMapper.xml

(开头部分) 4KB

这里只显示每个文件的开头 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.dao.ArticleMapper">
  <resultMap id="BaseResultMap" type="com.entity.Article">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="title" jdbcType="VARCHAR" property="title" />
    <result column="contents" jdbcType="VARCHAR" property="contents" />
    <result column="addtime" jdbcType="VARCHAR" property="addtime" />
    <result column="hits" jdbcType="VARCHAR" property="hits" />
  </resultMap>
  <sql id="Base_Column_List">
    id, title, contents, addtime, hits
  </sql>
  <select id="checkUname"  parameterType="java.util.Map" resultMap="BaseResultMap" >
    select 
    <include refid="Base_Column_List" />
    from article
    where title = #{title,jdbcType=VARCHAR} 
  </select>
 <select id="getCount"   resultType="int" parameterType="java.util.Map" >
    select  count(*) from article  where 1=1
    <if test="title!=null">
    and title =#{title}
    </if>
  </select> 
  <select id="getAll"   resultMap="BaseResultMap" parameterType="java.util.Map" >
    select   <include refid="Base_Column_List" /> from article  where 1=1
    <if test="title!=null">
    and title =#{title}
    </if>
  </select> 
   <select id="getByPage" parameterType="java.util.Map" resultMap="BaseResultMap">
     select  <include refid="Base_Column_List" /> 
     from article where 1=1 
     <if test="title!=null">
    and title like  concat('%',#{title,jdbcType=VARCHAR},'%')
     </if>
     <if test="pageno!=null and pageSize!=null">
     limit #{pageno},#{pageSize}
     </if>
     </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from article
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from article
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.entity.Article">
    insert into article (id, title, contents, 
      addtime, hits)
    values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{contents,jdbcType=VARCHAR}, 
      #{addtime,jdbcType=VARCHAR}, #{hits,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.entity.Article">
    insert into article
    <trim prefix="(" suffix=")" suffixOverrides=",">
后面还有 61 行代码,购买后查看完整代码

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

AI 解读

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

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