src/main/resources/mapper/NoticeMapper.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.yj.oa.project.mapper.NoticeMapper">
    <resultMap id="BaseResultMap" type="com.yj.oa.project.po.Notice">
        <id column="id" property="id" jdbcType="INTEGER"/>
        <result column="title" property="title" jdbcType="VARCHAR"/>
        <result column="content" property="content"/>
        <result column="createBy" property="createBy" jdbcType="VARCHAR"/>
        <result column="type" property="type" jdbcType="INTEGER"/>
        <result column="status" property="status" jdbcType="INTEGER"/>
        <result column="createTime" property="createTime" jdbcType="TIMESTAMP"/>
    </resultMap>
    <sql id="Base_Column_List">
        id, title,content, createBy,type,status, createTime
    </sql>

    <!--根据主键查询-->
    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
        select
        <include refid="Base_Column_List"/>
        from t_notice
        where id = #{id,jdbcType=INTEGER}
    </select>

    <!--根据用户个字段查询-->
    <select id="selectNoticeList" parameterType="Notice" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_notice
        <where>
            <if test="id !=null and id!=''">
                and id=#{id}
            </if>
            <if test="title !=null and title!=''">
                and title like CONCAT('%',#{title},'%')
            </if>
            <if test="createBy !=null and createBy!=''">
                and createBy like CONCAT('%',#{createBy},'%')
            </if>
            <if test="status !=null and status!='' or status==0">
                and status=#{status}
            </if>
            <if test="beginTime !=null">
                <![CDATA[   and DATE_FORMAT(createTime, '%Y-%m-%d')>=  DATE_FORMAT(#{beginTime}, '%Y-%m-%d')   ]]>
            </if>
            <if test="overTime !=null">
                <![CDATA[  and DATE_FORMAT(createTime, '%Y-%m-%d') <= DATE_FORMAT(#{overTime}, '%Y-%m-%d')    ]]>
            </if>
        </where>
    </select>

    <!--根据Id批量删除-->
    <delete id="deleteByPrimaryKeys" parameterType="java.lang.Integer">
        delete from t_notice
        where id =IN
        <foreach collection="array" separator="," item="id">
            (#{id,jdbcType=INTEGER})
        </foreach>

    </delete>
后面还有 73 行代码,购买后查看完整代码

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

AI 解读 AI

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

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