CommentInfo.xml 4.1 KB

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