CommentInfo.xml 4.3 KB

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