12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?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.mapper.PinglunMapper">
- <select id="findPinglunList"
- resultType="Pinglun">
- select * from pinglun
- </select>
-
- <select id="query" parameterType="java.util.Map" resultType="Pinglun">
- select * from pinglun
- <where>
- <if test="id!=null and id!=0">
- and id= #{id}
- </if>
- <if test="zid!=null and zid!=0">
- and zid= #{zid}
- </if>
- </where>
- order by id desc
- </select>
-
-
- <select id="queryPinglunById" parameterType="int" resultType="Pinglun">
- select * from pinglun where id=${value}
- </select>
-
- <!-- 添加评论 -->
- <insert id="insertPinglun" useGeneratedKeys="true" keyProperty="id" parameterType="Pinglun">
- insert into pinglun
- (contents,fbsj,uname,uhead,zid,huifu)
- values
- (#{contents},#{fbsj},#{uname},#{uhead},#{zid},#{huifu});
- </insert>
-
-
-
-
-
-
-
-
-
-
- <update id="updatePinglun" parameterType="Pinglun" >
- update pinglun set
- contents=#{contents},fbsj=#{fbsj},uname=#{uname},uhead=#{uhead},zid=#{zid},huifu=#{huifu}
- where
- id=#{id}
- </update>
-
-
-
- <delete id="deletePinglun" parameterType="int">
- delete from pinglun where id=${value}
- </delete>
- </mapper>
-
|