TenantApplyMapper.xml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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.keao.edu.user.dao.TenantApplyDao">
  5. <resultMap type="com.keao.edu.user.entity.TenantApply" id="TenantApply">
  6. <result column="id_" property="id" />
  7. <result column="name_" property="name" />
  8. <result column="city_" property="city" />
  9. <result column="linkman_" property="linkman" />
  10. <result column="mobile_no_" property="mobileNo" />
  11. <result column="student_num_level_" property="studentNumLevel" />
  12. <result column="create_time_" property="createTime" />
  13. <result column="call_back_time_" property="callBackTime" />
  14. <result column="call_back_log_" property="callBackLog" />
  15. </resultMap>
  16. <!-- 根据主键查询一条记录 -->
  17. <select id="get" resultMap="TenantApply">
  18. SELECT * FROM
  19. tenant_apply WHERE id_ = #{id}
  20. </select>
  21. <!-- 全查询 -->
  22. <select id="findAll" resultMap="TenantApply">
  23. SELECT * FROM tenant_apply ORDER
  24. BY id_
  25. </select>
  26. <!-- 向数据库增加一条记录 -->
  27. <insert id="insert" parameterType="com.keao.edu.user.entity.TenantApply"
  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 tenant_apply
  32. (id_,name_,city_,linkman_,mobile_no_,student_num_level_,create_time_,call_back_time_,call_back_log_)
  33. VALUES(#{id},#{name},#{city},#{linkman},#{mobileNo},#{studentNumLevel},#{createTime},#{callBackTime},#{callBackLog})
  34. </insert>
  35. <!-- 根据主键查询一条记录 -->
  36. <update id="update" parameterType="com.keao.edu.user.entity.TenantApply">
  37. UPDATE tenant_apply
  38. <set>
  39. <if test="city != null">
  40. city_ = #{city},
  41. </if>
  42. <if test="id != null">
  43. id_ = #{id},
  44. </if>
  45. <if test="linkman != null">
  46. linkman_ = #{linkman},
  47. </if>
  48. <if test="callBackLog != null">
  49. call_back_log_ = #{callBackLog},
  50. </if>
  51. <if test="mobileNo != null">
  52. mobile_no_ = #{mobileNo},
  53. </if>
  54. <if test="studentNumLevel != null">
  55. student_num_level_ = #{studentNumLevel},
  56. </if>
  57. <if test="callBackTime != null">
  58. call_back_time_ = #{callBackTime},
  59. </if>
  60. <if test="name != null">
  61. name_ = #{name},
  62. </if>
  63. <if test="createTime != null">
  64. create_time_ = #{createTime},
  65. </if>
  66. </set>
  67. WHERE id_ = #{id}
  68. </update>
  69. <!-- 根据主键删除一条记录 -->
  70. <delete id="delete">
  71. DELETE FROM tenant_apply WHERE id_ = #{id}
  72. </delete>
  73. <!-- 分页查询 -->
  74. <select id="queryPage" resultMap="TenantApply" parameterType="map">
  75. SELECT * FROM tenant_apply ORDER BY id_
  76. <include refid="global.limit" />
  77. </select>
  78. <!-- 查询当前表的总记录数 -->
  79. <select id="queryCount" resultType="int">
  80. SELECT COUNT(*) FROM
  81. tenant_apply
  82. </select>
  83. </mapper>