LoveProject.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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.LoveProjectDAO">
  6. <resultMap id="LoveProjectMap" type="com.jpsoft.employment.modules.base.entity.LoveProject">
  7. <id property="id" column="id_" />
  8. <result property="title" column="title_" />
  9. <result property="secondTitle" column="second_title" />
  10. <result property="content" column="content_" />
  11. <result property="image" column="image_" />
  12. <result property="contactPhone" column="contact_phone" />
  13. <result property="contacts" column="contacts_" />
  14. <result property="type" column="type_" />
  15. <result property="createBy" column="create_by" />
  16. <result property="createTime" column="create_time" />
  17. <result property="updateBy" column="update_by" />
  18. <result property="updateTime" column="update_time" />
  19. <result property="delFlag" column="del_flag" />
  20. <result property="feedbackMethod" column="feedback_method" />
  21. </resultMap>
  22. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.LoveProject">
  23. <!--
  24. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  25. select sys_guid() from dual
  26. </selectKey>
  27. -->
  28. <![CDATA[
  29. insert into base_love_project
  30. (id_,title_,second_title,content_,image_,contact_phone,contacts_,type_,create_by,create_time,update_by,update_time,del_flag,feedback_method)
  31. values
  32. (
  33. #{id,jdbcType=VARCHAR}
  34. ,#{title,jdbcType=VARCHAR}
  35. ,#{secondTitle,jdbcType=VARCHAR}
  36. ,#{content,jdbcType=VARCHAR}
  37. ,#{image,jdbcType=VARCHAR}
  38. ,#{contactPhone,jdbcType=VARCHAR}
  39. ,#{contacts,jdbcType=VARCHAR}
  40. ,#{type,jdbcType=VARCHAR}
  41. ,#{createBy,jdbcType=VARCHAR}
  42. ,#{createTime,jdbcType= TIMESTAMP }
  43. ,#{updateBy,jdbcType=VARCHAR}
  44. ,#{updateTime,jdbcType= TIMESTAMP }
  45. ,#{delFlag,jdbcType= NUMERIC }
  46. ,#{feedbackMethod,jdbcType=VARCHAR}
  47. )
  48. ]]>
  49. </insert>
  50. <delete id="delete" parameterType="string">
  51. delete from base_love_project where id_=#{id,jdbcType=VARCHAR}
  52. </delete>
  53. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.LoveProject">
  54. update base_love_project
  55. <set>
  56. <if test="title!=null">
  57. title_=#{title,jdbcType=VARCHAR},
  58. </if>
  59. <if test="secondTitle!=null">
  60. second_title=#{secondTitle,jdbcType=VARCHAR},
  61. </if>
  62. <if test="content!=null">
  63. content_=#{content,jdbcType=VARCHAR},
  64. </if>
  65. <if test="image!=null">
  66. image_=#{image,jdbcType=VARCHAR},
  67. </if>
  68. <if test="contactPhone!=null">
  69. contact_phone=#{contactPhone,jdbcType=VARCHAR},
  70. </if>
  71. <if test="contacts!=null">
  72. contacts_=#{contacts,jdbcType=VARCHAR},
  73. </if>
  74. <if test="type!=null">
  75. type_=#{type,jdbcType=VARCHAR},
  76. </if>
  77. <if test="createBy!=null">
  78. create_by=#{createBy,jdbcType=VARCHAR},
  79. </if>
  80. <if test="createTime!=null">
  81. create_time=#{createTime,jdbcType= TIMESTAMP },
  82. </if>
  83. <if test="updateBy!=null">
  84. update_by=#{updateBy,jdbcType=VARCHAR},
  85. </if>
  86. <if test="updateTime!=null">
  87. update_time=#{updateTime,jdbcType= TIMESTAMP },
  88. </if>
  89. <if test="delFlag!=null">
  90. del_flag=#{delFlag,jdbcType= NUMERIC },
  91. </if>
  92. <if test="feedbackMethod!=null">
  93. feedback_method=#{feedbackMethod,jdbcType=VARCHAR},
  94. </if>
  95. </set>
  96. where id_=#{id}
  97. </update>
  98. <select id="get" parameterType="string" resultMap="LoveProjectMap">
  99. select * from base_love_project where id_=#{0}
  100. </select>
  101. <select id="exist" parameterType="string" resultType="int">
  102. select count(*) from base_love_project where id_=#{0}
  103. </select>
  104. <select id="countByType" parameterType="string" resultType="int">
  105. SELECT COUNT(*) FROM SELECT * FROM base_participate_project_info a
  106. LEFT JOIN base_love_project b ON a.love_project_id = b.id_
  107. WHERE a.del_flag = 0
  108. AND b.del_flag = 0
  109. AND a.status_ = 2
  110. <if test="type != null">
  111. AND b.type_ = #{type}
  112. </if>
  113. </select>
  114. <select id="list" resultMap="LoveProjectMap">
  115. select * from base_love_project
  116. </select>
  117. <select id="search" parameterType="hashmap" resultMap="LoveProjectMap">
  118. <![CDATA[
  119. select * from base_love_project
  120. ]]>
  121. <where>
  122. del_flag = 0
  123. <if test="searchParams.title != null">
  124. and title_ like #{searchParams.title}
  125. </if>
  126. <if test="searchParams.type != null">
  127. and type_ = #{searchParams.type}
  128. </if>
  129. </where>
  130. <foreach item="sort" collection="sortList" open="order by" separator=",">
  131. ${sort.name} ${sort.order}
  132. </foreach>
  133. </select>
  134. </mapper>