src/com/cms/dao/NoticeDao.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.cms.dao.NoticeDao">
  <resultMap id="BaseResultMap" type="com.cms.entity.Notice">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="title" jdbcType="VARCHAR" property="title" />
    <result column="author" jdbcType="VARCHAR" property="author" />
    <result column="content" jdbcType="VARCHAR" property="content" />
    <result column="auth" jdbcType="INTEGER" property="auth" />
    <result column="date" jdbcType="DATE" property="date" />
  </resultMap>
  <sql id="Base_Column_List">
    id, title, author, content, auth, date
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from t_notice
    where id = #{id,jdbcType=INTEGER}
  </select>
  
  <!-- &lt;小于号       &gt;大于号   -->
  <select id="getTotalItemsCount" resultType="java.lang.Integer">
    select count(*) from t_notice
    where auth &lt;= #{param1, jdbcType=INTEGER}
    <if test="param2 != null and param2 != '' ">
    	and title like CONCAT('%', #{param2, jdbcType=VARCHAR}, '%')
    </if>
  </select>
  <select id="getNotice" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from t_notice
    where auth &lt;= #{param2, jdbcType=INTEGER}
    <if test="param3 != null and param3 != '' ">
    	and title like CONCAT('%', #{param3, jdbcType=VARCHAR}, '%')
    </if>
    <if test="param1 != null">
  		limit #{param1.start}, #{param1.pageSize}
  	</if>
  </select>
  
  <delete id="deleteBatch" parameterType="java.lang.Integer">
    delete from t_notice
    where id in
    <foreach collection="list" item="id" separator="," open="(" close=")" >
    	#{id,jdbcType=INTEGER}
    </foreach>
  </delete>
  
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from t_notice
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.cms.entity.Notice">
    insert into t_notice (id, title, author, 
      content, auth, date)
    values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{author,jdbcType=VARCHAR}, 
      #{content,jdbcType=VARCHAR}, #{auth,jdbcType=INTEGER}, CURDATE())
  </insert>
后面还有 72 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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