Feedback.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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.FeedbackDAO">
  6. <resultMap id="FeedbackMap" type="com.jpsoft.employment.modules.base.entity.Feedback">
  7. <id property="id" column="id_" />
  8. <result property="title" column="title_" />
  9. <result property="content" column="content_" />
  10. <result property="technicianId" column="technician_id" />
  11. <result property="createTime" column="create_time" />
  12. <result property="updateTime" column="update_time" />
  13. <result property="delFlag" column="del_flag" />
  14. <result property="createBy" column="create_by" />
  15. <result property="updateBy" column="update_by" />
  16. <result property="companyId" column="company_id" />
  17. <result property="image" column="image_" />
  18. <result property="type" column="type_" />
  19. </resultMap>
  20. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.Feedback">
  21. <!--
  22. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  23. select sys_guid() from dual
  24. </selectKey>
  25. -->
  26. <![CDATA[
  27. insert into base_feedback
  28. (id_,title_,content_,technician_id,create_time,update_time,del_flag,create_by,update_by,company_id,image_,type_)
  29. values
  30. (
  31. #{id,jdbcType=VARCHAR}
  32. ,#{title,jdbcType=VARCHAR}
  33. ,#{content,jdbcType=VARCHAR}
  34. ,#{technicianId,jdbcType=VARCHAR}
  35. ,#{createTime,jdbcType= TIMESTAMP }
  36. ,#{updateTime,jdbcType= TIMESTAMP }
  37. ,#{delFlag,jdbcType= NUMERIC }
  38. ,#{createBy,jdbcType=VARCHAR}
  39. ,#{updateBy,jdbcType=VARCHAR}
  40. ,#{companyId,jdbcType=VARCHAR}
  41. ,#{image,jdbcType=VARCHAR}
  42. ,#{type,jdbcType=VARCHAR}
  43. )
  44. ]]>
  45. </insert>
  46. <delete id="delete" parameterType="string">
  47. delete from base_feedback where id_=#{id,jdbcType=VARCHAR}
  48. </delete>
  49. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.Feedback">
  50. update base_feedback
  51. <set>
  52. <if test="title!=null">
  53. title_=#{title,jdbcType=VARCHAR},
  54. </if>
  55. <if test="content!=null">
  56. content_=#{content,jdbcType=VARCHAR},
  57. </if>
  58. <if test="technicianId!=null">
  59. technician_id=#{technicianId,jdbcType=VARCHAR},
  60. </if>
  61. <if test="createTime!=null">
  62. create_time=#{createTime,jdbcType= TIMESTAMP },
  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. <if test="createBy!=null">
  71. create_by=#{createBy,jdbcType=VARCHAR},
  72. </if>
  73. <if test="updateBy!=null">
  74. update_by=#{updateBy,jdbcType=VARCHAR},
  75. </if>
  76. <if test="companyId!=null">
  77. company_id=#{companyId,jdbcType=VARCHAR},
  78. </if>
  79. <if test="image!=null">
  80. image_=#{image,jdbcType=VARCHAR},
  81. </if>
  82. <if test="type!=null">
  83. type_=#{type,jdbcType=VARCHAR},
  84. </if>
  85. </set>
  86. where id_=#{id}
  87. </update>
  88. <select id="get" parameterType="string" resultMap="FeedbackMap">
  89. select * from base_feedback where id_=#{0}
  90. </select>
  91. <select id="exist" parameterType="string" resultType="int">
  92. select count(*) from base_feedback where id_=#{0}
  93. </select>
  94. <select id="list" resultMap="FeedbackMap">
  95. select * from base_feedback
  96. </select>
  97. <select id="search" parameterType="hashmap" resultMap="FeedbackMap">
  98. <![CDATA[
  99. select * from base_feedback
  100. ]]>
  101. <where>
  102. del_flag=false
  103. <if test="searchParams.companyId != null">
  104. and company_id = #{searchParams.companyId}
  105. </if>
  106. </where>
  107. <foreach item="sort" collection="sortList" open="order by" separator=",">
  108. ${sort.name} ${sort.order}
  109. </foreach>
  110. </select>
  111. </mapper>