AppraiseServiceDaoImplMapper.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="appraiseServiceDaoImpl">
  6. <!-- 保存评价信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveAppraiseInfo" parameterType="Map">
  8. insert into appraise(
  9. parent_appraise_id,appraise_user_name,appraise_id,appraise_score,appraise_type,context,obj_id,obj_type,appraise_user_id
  10. ) values (
  11. #{parentAppraiseId},#{appraiseUserName},#{appraiseId},#{appraiseScore},#{appraiseType},#{context},#{objId},#{objType},#{appraiseUserId}
  12. )
  13. </insert>
  14. <!-- 查询评价信息 add by wuxw 2018-07-03 -->
  15. <select id="getAppraiseInfo" parameterType="Map" resultType="Map">
  16. select t.parent_appraise_id,t.parent_appraise_id parentAppraiseId,t.appraise_user_name,t.appraise_user_name
  17. appraiseUserName,t.appraise_id,t.appraise_id appraiseId,t.appraise_score,t.appraise_score
  18. appraiseScore,t.appraise_type,t.appraise_type appraiseType,t.context,t.obj_id,t.obj_id
  19. objId,t.status_cd,t.status_cd statusCd,t.obj_type,t.obj_type objType,t.appraise_user_id,t.appraise_user_id
  20. appraiseUserId
  21. from appraise t
  22. where 1 =1
  23. <if test="parentAppraiseId !=null and parentAppraiseId != ''">
  24. and t.parent_appraise_id= #{parentAppraiseId}
  25. </if>
  26. <if test="appraiseUserName !=null and appraiseUserName != ''">
  27. and t.appraise_user_name= #{appraiseUserName}
  28. </if>
  29. <if test="appraiseId !=null and appraiseId != ''">
  30. and t.appraise_id= #{appraiseId}
  31. </if>
  32. <if test="appraiseScore !=null and appraiseScore != ''">
  33. and t.appraise_score= #{appraiseScore}
  34. </if>
  35. <if test="appraiseType !=null and appraiseType != ''">
  36. and t.appraise_type= #{appraiseType}
  37. </if>
  38. <if test="context !=null and context != ''">
  39. and t.context= #{context}
  40. </if>
  41. <if test="objId !=null and objId != ''">
  42. and t.obj_id= #{objId}
  43. </if>
  44. <if test="statusCd !=null and statusCd != ''">
  45. and t.status_cd= #{statusCd}
  46. </if>
  47. <if test="objType !=null and objType != ''">
  48. and t.obj_type= #{objType}
  49. </if>
  50. <if test="appraiseUserId !=null and appraiseUserId != ''">
  51. and t.appraise_user_id= #{appraiseUserId}
  52. </if>
  53. order by t.create_time desc
  54. <if test="page != -1 and page != null ">
  55. limit #{page}, #{row}
  56. </if>
  57. </select>
  58. <!-- 修改评价信息 add by wuxw 2018-07-03 -->
  59. <update id="updateAppraiseInfo" parameterType="Map">
  60. update appraise t set t.status_cd = #{statusCd}
  61. <if test="newBId != null and newBId != ''">
  62. ,t.b_id = #{newBId}
  63. </if>
  64. <if test="parentAppraiseId !=null and parentAppraiseId != ''">
  65. , t.parent_appraise_id= #{parentAppraiseId}
  66. </if>
  67. <if test="appraiseUserName !=null and appraiseUserName != ''">
  68. , t.appraise_user_name= #{appraiseUserName}
  69. </if>
  70. <if test="appraiseScore !=null and appraiseScore != ''">
  71. , t.appraise_score= #{appraiseScore}
  72. </if>
  73. <if test="appraiseType !=null and appraiseType != ''">
  74. , t.appraise_type= #{appraiseType}
  75. </if>
  76. <if test="context !=null and context != ''">
  77. , t.context= #{context}
  78. </if>
  79. <if test="objId !=null and objId != ''">
  80. , t.obj_id= #{objId}
  81. </if>
  82. <if test="objType !=null and objType != ''">
  83. , t.obj_type= #{objType}
  84. </if>
  85. <if test="appraiseUserId !=null and appraiseUserId != ''">
  86. , t.appraise_user_id= #{appraiseUserId}
  87. </if>
  88. where 1=1
  89. <if test="appraiseId !=null and appraiseId != ''">
  90. and t.appraise_id= #{appraiseId}
  91. </if>
  92. </update>
  93. <!-- 查询评价数量 add by wuxw 2018-07-03 -->
  94. <select id="queryAppraisesCount" parameterType="Map" resultType="Map">
  95. select count(1) count
  96. from appraise t
  97. where 1 =1
  98. <if test="parentAppraiseId !=null and parentAppraiseId != ''">
  99. and t.parent_appraise_id= #{parentAppraiseId}
  100. </if>
  101. <if test="appraiseUserName !=null and appraiseUserName != ''">
  102. and t.appraise_user_name= #{appraiseUserName}
  103. </if>
  104. <if test="appraiseId !=null and appraiseId != ''">
  105. and t.appraise_id= #{appraiseId}
  106. </if>
  107. <if test="appraiseScore !=null and appraiseScore != ''">
  108. and t.appraise_score= #{appraiseScore}
  109. </if>
  110. <if test="appraiseType !=null and appraiseType != ''">
  111. and t.appraise_type= #{appraiseType}
  112. </if>
  113. <if test="context !=null and context != ''">
  114. and t.context= #{context}
  115. </if>
  116. <if test="objId !=null and objId != ''">
  117. and t.obj_id= #{objId}
  118. </if>
  119. <if test="statusCd !=null and statusCd != ''">
  120. and t.status_cd= #{statusCd}
  121. </if>
  122. <if test="objType !=null and objType != ''">
  123. and t.obj_type= #{objType}
  124. </if>
  125. <if test="appraiseUserId !=null and appraiseUserId != ''">
  126. and t.appraise_user_id= #{appraiseUserId}
  127. </if>
  128. </select>
  129. </mapper>