CooperationOrganMapper.xml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
  4. <mapper namespace="com.ym.mec.web.dal.dao.CooperationOrganDao">
  5. <resultMap type="com.ym.mec.web.dal.entity.CooperationOrgan"
  6. id="CooperationOrgan">
  7. <result column="id_" property="id" />
  8. <result column="name_" property="name" />
  9. <result column="linkman_" property="linkman" />
  10. <result column="job_" property="job" />
  11. <result column="mobile_no_" property="mobileNo" />
  12. <result column="address_" property="address" />
  13. <result column="create_time_" property="createTime" />
  14. <result column="update_time_" property="updateTime" />
  15. </resultMap>
  16. <!-- 根据主键查询一条记录 -->
  17. <select id="get" resultMap="CooperationOrgan">
  18. SELECT * FROM
  19. cooperation_organ WHERE id_ = #{id}
  20. </select>
  21. <!-- 全查询 -->
  22. <select id="findAll" resultMap="CooperationOrgan">
  23. SELECT * FROM cooperation_organ
  24. ORDER BY id_
  25. </select>
  26. <!-- 向数据库增加一条记录 -->
  27. <insert id="insert" parameterType="com.ym.mec.web.dal.entity.CooperationOrgan"
  28. useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  29. <!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval
  30. AS ID FROM DUAL </selectKey> -->
  31. INSERT INTO cooperation_organ
  32. (id_,name_,linkman_,job_,mobile_no_,address_,create_time_,update_time_)
  33. VALUES(#{id},#{name},#{linkman},#{job},#{mobileNo},#{address},#{createTime},#{updateTime})
  34. </insert>
  35. <!-- 根据主键查询一条记录 -->
  36. <update id="update" parameterType="com.ym.mec.web.dal.entity.CooperationOrgan">
  37. UPDATE cooperation_organ
  38. <set>
  39. <if test="address != null">
  40. address_ = #{address},
  41. </if>
  42. <if test="job != null">
  43. job_ = #{job},
  44. </if>
  45. <if test="id != null">
  46. id_ = #{id},
  47. </if>
  48. <if test="linkman != null">
  49. linkman_ = #{linkman},
  50. </if>
  51. <if test="updateTime != null">
  52. update_time_ = #{updateTime},
  53. </if>
  54. <if test="mobileNo != null">
  55. mobile_no_ = #{mobileNo},
  56. </if>
  57. <if test="name != null">
  58. name_ = #{name},
  59. </if>
  60. <if test="createTime != null">
  61. create_time_ = #{createTime},
  62. </if>
  63. </set>
  64. WHERE id_ = #{id}
  65. </update>
  66. <!-- 根据主键删除一条记录 -->
  67. <delete id="delete">
  68. DELETE FROM cooperation_organ WHERE id_ =
  69. #{id}
  70. </delete>
  71. <!-- 分页查询 -->
  72. <select id="queryPage" resultMap="CooperationOrgan"
  73. parameterType="map">
  74. SELECT * FROM cooperation_organ ORDER BY id_
  75. <include refid="global.limit" />
  76. </select>
  77. <!-- 查询当前表的总记录数 -->
  78. <select id="queryCount" resultType="int">
  79. SELECT COUNT(*) FROM
  80. cooperation_organ
  81. </select>
  82. </mapper>