CommentInfo.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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.CommentInfoDAO">
  6. <resultMap id="CommentInfoMap" type="com.jpsoft.employment.modules.base.entity.CommentInfo">
  7. <id property="id" column="id_" />
  8. <result property="companyId" column="company_id" />
  9. <result property="workOrderId" column="work_order_id" />
  10. <result property="starRating" column="star_rating" />
  11. <result property="content" column="content_" />
  12. <result property="image" column="image_" />
  13. <result property="dateTime" column="date_time" />
  14. <result property="createTime" column="create_time" />
  15. <result property="updateTime" column="update_time" />
  16. <result property="delFlag" column="del_flag" />
  17. <result property="createBy" column="create_by" />
  18. <result property="updateBy" column="update_by" />
  19. </resultMap>
  20. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.CommentInfo">
  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_comment_info
  28. (id_,company_id,work_order_id,star_rating,content_,image_,date_time,create_time,update_time,del_flag,create_by,update_by)
  29. values
  30. (
  31. #{id,jdbcType=VARCHAR}
  32. ,#{companyId,jdbcType=VARCHAR}
  33. ,#{workOrderId,jdbcType=VARCHAR}
  34. ,#{starRating,jdbcType=VARCHAR}
  35. ,#{content,jdbcType=VARCHAR}
  36. ,#{image,jdbcType=VARCHAR}
  37. ,#{dateTime,jdbcType= TIMESTAMP }
  38. ,#{createTime,jdbcType= TIMESTAMP }
  39. ,#{updateTime,jdbcType= TIMESTAMP }
  40. ,#{delFlag,jdbcType= NUMERIC }
  41. ,#{createBy,jdbcType=VARCHAR}
  42. ,#{updateBy,jdbcType=VARCHAR}
  43. )
  44. ]]>
  45. </insert>
  46. <delete id="delete" parameterType="string">
  47. delete from base_comment_info where id_=#{id,jdbcType=VARCHAR}
  48. </delete>
  49. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.CommentInfo">
  50. update base_comment_info
  51. <set>
  52. <if test="companyId!=null">
  53. company_id=#{companyId,jdbcType=VARCHAR},
  54. </if>
  55. <if test="workOrderId!=null">
  56. work_order_id=#{workOrderId,jdbcType=VARCHAR},
  57. </if>
  58. <if test="starRating!=null">
  59. star_rating=#{starRating,jdbcType=VARCHAR},
  60. </if>
  61. <if test="content!=null">
  62. content_=#{content,jdbcType=VARCHAR},
  63. </if>
  64. <if test="image!=null">
  65. image_=#{image,jdbcType=VARCHAR},
  66. </if>
  67. <if test="dateTime!=null">
  68. date_time=#{dateTime,jdbcType= TIMESTAMP },
  69. </if>
  70. <if test="createTime!=null">
  71. create_time=#{createTime,jdbcType= TIMESTAMP },
  72. </if>
  73. <if test="updateTime!=null">
  74. update_time=#{updateTime,jdbcType= TIMESTAMP },
  75. </if>
  76. <if test="delFlag!=null">
  77. del_flag=#{delFlag,jdbcType= NUMERIC },
  78. </if>
  79. <if test="createBy!=null">
  80. create_by=#{createBy,jdbcType=VARCHAR},
  81. </if>
  82. <if test="updateBy!=null">
  83. update_by=#{updateBy,jdbcType=VARCHAR},
  84. </if>
  85. </set>
  86. where id_=#{id}
  87. </update>
  88. <select id="get" parameterType="string" resultMap="CommentInfoMap">
  89. select
  90. id_,company_id,work_order_id,star_rating,content_,image_,date_time,create_time,update_time,del_flag,create_by,update_by from base_comment_info where id_=#{0}
  91. </select>
  92. <select id="exist" parameterType="string" resultType="int">
  93. select count(*) from base_comment_info where id_=#{0}
  94. </select>
  95. <select id="list" resultMap="CommentInfoMap">
  96. select * from base_comment_info
  97. </select>
  98. <select id="findByWorkOrderId" resultMap="CommentInfoMap">
  99. select * from base_comment_info where del_flag=false and work_order_id=#{0}
  100. </select>
  101. <select id="search" parameterType="hashmap" resultMap="CommentInfoMap">
  102. <![CDATA[
  103. select * from base_comment_info
  104. ]]>
  105. <where>
  106. <if test="searchParams.id != null">
  107. and ID_ like #{searchParams.id}
  108. </if>
  109. </where>
  110. <foreach item="sort" collection="sortList" open="order by" separator=",">
  111. ${sort.name} ${sort.order}
  112. </foreach>
  113. </select>
  114. </mapper>