TGonggaoMapper.xml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <mapper namespace="com.mapper.TGonggaoMapper">
  5. <select id="findTGonggaoList"
  6. resultType="TGonggao">
  7. select * from gonggao
  8. </select>
  9. <select id="query" parameterType="java.util.Map" resultType="TGonggao">
  10. select * from gonggao
  11. <where>
  12. <if test="id!=null and id!=0">
  13. and id= #{id}
  14. </if>
  15. </where>
  16. </select>
  17. <select id="queryTGonggaoById" parameterType="string" resultType="TGonggao">
  18. select * from gonggao where id=${value}
  19. </select>
  20. <insert id="insertTGonggao" useGeneratedKeys="true" keyProperty="id" parameterType="TGonggao">
  21. insert into gonggao
  22. (title,content,shijian)
  23. values
  24. (#{title},#{content},#{shijian});
  25. </insert>
  26. <update id="updateTGonggao" parameterType="TGonggao" >
  27. update gonggao set
  28. title=#{title},content=#{content},shijian=#{shijian}
  29. where
  30. id=#{id}
  31. </update>
  32. <delete id="deleteTGonggao" parameterType="string">
  33. delete from gonggao where id=${value}
  34. </delete>
  35. </mapper>