StudentAspirations.xml 3.6 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.StudentAspirationsDAO">
  6. <resultMap id="StudentAspirationsMap" type="com.jpsoft.employment.modules.base.entity.StudentAspirations">
  7. <id property="id" column="id_" />
  8. <result property="wishInfoId" column="wish_info_id" />
  9. <result property="name" column="name_" />
  10. <result property="studentName" column="student_name" />
  11. <result property="createBy" column="create_by" />
  12. <result property="createTime" column="create_time" />
  13. <result property="updateBy" column="update_by" />
  14. <result property="updateTime" column="update_time" />
  15. <result property="delFlag" column="del_flag" />
  16. </resultMap>
  17. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.StudentAspirations">
  18. <!--
  19. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  20. select sys_guid() from dual
  21. </selectKey>
  22. -->
  23. <![CDATA[
  24. insert into base_student_aspirations
  25. (id_,wish_info_id,name_,student_name,create_by,create_time,update_by,update_time,del_flag)
  26. values
  27. (
  28. #{id,jdbcType=VARCHAR}
  29. ,#{wishInfoId,jdbcType=VARCHAR}
  30. ,#{name,jdbcType=VARCHAR}
  31. ,#{studentName,jdbcType=VARCHAR}
  32. ,#{createBy,jdbcType=VARCHAR}
  33. ,#{createTime,jdbcType= TIMESTAMP }
  34. ,#{updateBy,jdbcType=VARCHAR}
  35. ,#{updateTime,jdbcType= TIMESTAMP }
  36. ,#{delFlag,jdbcType= NUMERIC }
  37. )
  38. ]]>
  39. </insert>
  40. <delete id="delete" parameterType="string">
  41. delete from base_student_aspirations where id_=#{id,jdbcType=VARCHAR}
  42. </delete>
  43. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.StudentAspirations">
  44. update base_student_aspirations
  45. <set>
  46. <if test="wishInfoId!=null">
  47. wish_info_id=#{wishInfoId,jdbcType=VARCHAR},
  48. </if>
  49. <if test="name!=null">
  50. name_=#{name,jdbcType=VARCHAR},
  51. </if>
  52. <if test="studentName!=null">
  53. student_name=#{studentName,jdbcType=VARCHAR},
  54. </if>
  55. <if test="createBy!=null">
  56. create_by=#{createBy,jdbcType=VARCHAR},
  57. </if>
  58. <if test="createTime!=null">
  59. create_time=#{createTime,jdbcType= TIMESTAMP },
  60. </if>
  61. <if test="updateBy!=null">
  62. update_by=#{updateBy,jdbcType=VARCHAR},
  63. </if>
  64. <if test="updateTime!=null">
  65. update_time=#{updateTime,jdbcType= TIMESTAMP },
  66. </if>
  67. <if test="delFlag!=null">
  68. del_flag=#{delFlag,jdbcType= NUMERIC },
  69. </if>
  70. </set>
  71. where id_=#{id}
  72. </update>
  73. <select id="get" parameterType="string" resultMap="StudentAspirationsMap">
  74. select * from base_student_aspirations where id_=#{0}
  75. </select>
  76. <select id="exist" parameterType="string" resultType="int">
  77. select count(*) from base_student_aspirations where id_=#{0}
  78. </select>
  79. <select id="list" resultMap="StudentAspirationsMap">
  80. select * from base_student_aspirations
  81. </select>
  82. <select id="findByWish" parameterType="string" resultMap="StudentAspirationsMap">
  83. SELECT * FROM base_student_aspirations
  84. WHERE del_flag = 0
  85. AND wish_info_id = #{0}
  86. AND id_ NOT IN (
  87. SELECT student_aspirations_id FROM base_wish_info_user_record
  88. WHERE del_flag = 0
  89. AND wish_info_id = #{0}
  90. GROUP BY student_aspirations_id
  91. )
  92. </select>
  93. <select id="search" parameterType="hashmap" resultMap="StudentAspirationsMap">
  94. <![CDATA[
  95. select * from base_student_aspirations
  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>