全员智慧中台知识赋能行动2.0版.xlsx
全员智慧中台知识赋能行动2.0版
溜客安全网WwWKuCoM溜客安全网WwWKuCoM溜客安全网WwWKuCoM溜客安全网WwWKuCoM溜客安全网WwWKuCoM溜客安全网WwWKuCoM
<?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.BlogDao"> <resultMap type="Blog" id="blogResult"> <id column="blog_id" property="id" /> <result column="blog_title" property="subject"/> <result column="content" property="content"/> <!-- 映射关联的对象 --> <association property="author" javaType="Author"> <id column="id" property="blog_author_id"/> <result column="userName" property="userName"/> <result column="password" property="password"/> </association> <collection property="comments" ofType="Comment"> <id property="id" column="post_id"/> <result property="subject" column="post_subject"/> <result property="content" column="content"/> </collection> </resultMap> <sql id="where"> <where>userName =#{userName}</where> </sql> <select id="countAll" resultType="int"> select count(*) c from blog; </select> <select id="countSome" resultType="int" parameterType="String"> select count(*) c from blog <include refid="where"/>; </select> <select id="selectAll" parameterType="int" resultMap="blogResult"> select B.id as blog_id, B.subject as blog_title, B.author as blog_author_id, P.id as post_id, P.subject as post_subject, P.content as content from Blog B left outer join Comment P on B.id = P.blogid </select> <insert id="insert" parameterType="com.beans.Blog"> insert into blog(subject,content,author) values(#{subject},#{content},#{author}) </insert> <update id="update" parameterType="com.beans.User"> update blog set subject=#{subject},content=#{content},author=#{author} where userName=#{userName} </update> <delete id="delete" parameterType="int"> delete from blog where subject=#{subject} </delete> </mapper>