VolunteerTasks.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. <!-- namespace必须指向DAO接口 -->
  5. <mapper namespace="com.jpsoft.employment.modules.base.dao.VolunteerTasksDAO">
  6. <resultMap id="VolunteerTasksMap" type="com.jpsoft.employment.modules.base.entity.VolunteerTasks">
  7. <id property="id" column="id_" />
  8. <result property="introduce" column="introduce_" />
  9. <result property="volunteerRequirements" column="volunteer_requirements" />
  10. <result property="schoolContact" column="school_contact" />
  11. <result property="startTime" column="start_time" />
  12. <result property="endTime" column="end_time" />
  13. <result property="createBy" column="create_by" />
  14. <result property="createTime" column="create_time" />
  15. <result property="updateBy" column="update_by" />
  16. <result property="updateTime" column="update_time" />
  17. <result property="delFlag" column="del_flag" />
  18. </resultMap>
  19. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.VolunteerTasks">
  20. <!--
  21. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  22. select sys_guid() from dual
  23. </selectKey>
  24. -->
  25. <![CDATA[
  26. insert into base_volunteer_tasks
  27. (id_,introduce_,volunteer_requirements,school_contact,start_time,end_time,create_by,create_time,update_by,update_time,del_flag)
  28. values
  29. (
  30. #{id,jdbcType=VARCHAR}
  31. ,#{introduce,jdbcType=VARCHAR}
  32. ,#{volunteerRequirements,jdbcType=VARCHAR}
  33. ,#{schoolContact,jdbcType=VARCHAR}
  34. ,#{startTime,jdbcType= TIMESTAMP }
  35. ,#{endTime,jdbcType= TIMESTAMP }
  36. ,#{createBy,jdbcType=VARCHAR}
  37. ,#{createTime,jdbcType= TIMESTAMP }
  38. ,#{updateBy,jdbcType=VARCHAR}
  39. ,#{updateTime,jdbcType= TIMESTAMP }
  40. ,#{delFlag,jdbcType= NUMERIC }
  41. )
  42. ]]>
  43. </insert>
  44. <delete id="delete" parameterType="string">
  45. delete from base_volunteer_tasks where id_=#{id,jdbcType=VARCHAR}
  46. </delete>
  47. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.VolunteerTasks">
  48. update base_volunteer_tasks
  49. <set>
  50. <if test="introduce!=null">
  51. introduce_=#{introduce,jdbcType=VARCHAR},
  52. </if>
  53. <if test="volunteerRequirements!=null">
  54. volunteer_requirements=#{volunteerRequirements,jdbcType=VARCHAR},
  55. </if>
  56. <if test="schoolContact!=null">
  57. school_contact=#{schoolContact,jdbcType=VARCHAR},
  58. </if>
  59. <if test="startTime!=null">
  60. start_time=#{startTime,jdbcType= TIMESTAMP },
  61. </if>
  62. <if test="endTime!=null">
  63. end_time=#{endTime,jdbcType= TIMESTAMP },
  64. </if>
  65. <if test="createBy!=null">
  66. create_by=#{createBy,jdbcType=VARCHAR},
  67. </if>
  68. <if test="createTime!=null">
  69. create_time=#{createTime,jdbcType= TIMESTAMP },
  70. </if>
  71. <if test="updateBy!=null">
  72. update_by=#{updateBy,jdbcType=VARCHAR},
  73. </if>
  74. <if test="updateTime!=null">
  75. update_time=#{updateTime,jdbcType= TIMESTAMP },
  76. </if>
  77. <if test="delFlag!=null">
  78. del_flag=#{delFlag,jdbcType= NUMERIC },
  79. </if>
  80. </set>
  81. where id_=#{id}
  82. </update>
  83. <select id="get" parameterType="string" resultMap="VolunteerTasksMap">
  84. select
  85. id_,introduce_,volunteer_requirements,school_contact,start_time,end_time,create_by,create_time,update_by,update_time,del_flag from base_volunteer_tasks where id_=#{0}
  86. </select>
  87. <select id="exist" parameterType="string" resultType="int">
  88. select count(*) from base_volunteer_tasks where id_=#{0}
  89. </select>
  90. <select id="list" resultMap="VolunteerTasksMap">
  91. select * from base_volunteer_tasks
  92. </select>
  93. <select id="search" parameterType="hashmap" resultMap="VolunteerTasksMap">
  94. <![CDATA[
  95. select * from base_volunteer_tasks
  96. ]]>
  97. <where>
  98. <if test="searchParams.id != null">
  99. and ID_ like #{searchParams.id}
  100. </if>
  101. </where>
  102. <foreach item="sort" collection="sortList" open="order by" separator=",">
  103. ${sort.name} ${sort.order}
  104. </foreach>
  105. </select>
  106. </mapper>