UserQuestionAnswerValueServiceDaoImplMapper.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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="userQuestionAnswerValueServiceDaoImpl">
  6. <!-- 保存答卷答案信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveUserQuestionAnswerValueInfo" parameterType="Map">
  8. insert into user_question_answer_value(
  9. score,value_id,title_id,answer_type,obj_id,user_qa_id,value_content,person_id,obj_type,user_title_id,qa_id
  10. ) values (
  11. #{score},#{valueId},#{titleId},#{answerType},#{objId},#{userQaId},#{valueContent},#{personId},#{objType},#{userTitleId},#{qaId}
  12. )
  13. </insert>
  14. <!-- 查询答卷答案信息 add by wuxw 2018-07-03 -->
  15. <select id="getUserQuestionAnswerValueInfo" parameterType="Map" resultType="Map">
  16. select t.score,t.value_id,t.value_id valueId,t.title_id,t.title_id titleId,t.answer_type,t.answer_type answerType,t.obj_id,t.obj_id objId,t.user_qa_id,t.user_qa_id userQaId,t.value_content,t.value_content valueContent,t.person_id,t.person_id personId,t.status_cd,t.status_cd statusCd,t.obj_type,t.obj_type objType,t.user_title_id,t.user_title_id userTitleId,t.qa_id,t.qa_id qaId
  17. from user_question_answer_value t
  18. where 1 =1
  19. <if test="score !=null and score != ''">
  20. and t.score= #{score}
  21. </if>
  22. <if test="valueId !=null and valueId != ''">
  23. and t.value_id= #{valueId}
  24. </if>
  25. <if test="titleId !=null and titleId != ''">
  26. and t.title_id= #{titleId}
  27. </if>
  28. <if test="answerType !=null and answerType != ''">
  29. and t.answer_type= #{answerType}
  30. </if>
  31. <if test="objId !=null and objId != ''">
  32. and t.obj_id= #{objId}
  33. </if>
  34. <if test="userQaId !=null and userQaId != ''">
  35. and t.user_qa_id= #{userQaId}
  36. </if>
  37. <if test="valueContent !=null and valueContent != ''">
  38. and t.value_content= #{valueContent}
  39. </if>
  40. <if test="personId !=null and personId != ''">
  41. and t.person_id= #{personId}
  42. </if>
  43. <if test="statusCd !=null and statusCd != ''">
  44. and t.status_cd= #{statusCd}
  45. </if>
  46. <if test="objType !=null and objType != ''">
  47. and t.obj_type= #{objType}
  48. </if>
  49. <if test="userTitleId !=null and userTitleId != ''">
  50. and t.user_title_id= #{userTitleId}
  51. </if>
  52. <if test="qaId !=null and qaId != ''">
  53. and t.qa_id= #{qaId}
  54. </if>
  55. order by t.create_time desc
  56. <if test="page != -1 and page != null ">
  57. limit #{page}, #{row}
  58. </if>
  59. </select>
  60. <!-- 修改答卷答案信息 add by wuxw 2018-07-03 -->
  61. <update id="updateUserQuestionAnswerValueInfo" parameterType="Map">
  62. update user_question_answer_value t set t.status_cd = #{statusCd}
  63. <if test="newBId != null and newBId != ''">
  64. ,t.b_id = #{newBId}
  65. </if>
  66. <if test="score !=null and score != ''">
  67. , t.score= #{score}
  68. </if>
  69. <if test="valueId !=null and valueId != ''">
  70. , t.value_id= #{valueId}
  71. </if>
  72. <if test="titleId !=null and titleId != ''">
  73. , t.title_id= #{titleId}
  74. </if>
  75. <if test="answerType !=null and answerType != ''">
  76. , t.answer_type= #{answerType}
  77. </if>
  78. <if test="objId !=null and objId != ''">
  79. , t.obj_id= #{objId}
  80. </if>
  81. <if test="userQaId !=null and userQaId != ''">
  82. , t.user_qa_id= #{userQaId}
  83. </if>
  84. <if test="valueContent !=null and valueContent != ''">
  85. , t.value_content= #{valueContent}
  86. </if>
  87. <if test="personId !=null and personId != ''">
  88. , t.person_id= #{personId}
  89. </if>
  90. <if test="objType !=null and objType != ''">
  91. , t.obj_type= #{objType}
  92. </if>
  93. <if test="qaId !=null and qaId != ''">
  94. , t.qa_id= #{qaId}
  95. </if>
  96. where 1=1 <if test="userTitleId !=null and userTitleId != ''">
  97. and t.user_title_id= #{userTitleId}
  98. </if>
  99. </update>
  100. <!-- 查询答卷答案数量 add by wuxw 2018-07-03 -->
  101. <select id="queryUserQuestionAnswerValuesCount" parameterType="Map" resultType="Map">
  102. select count(1) count
  103. from user_question_answer_value t
  104. where 1 =1
  105. <if test="score !=null and score != ''">
  106. and t.score= #{score}
  107. </if>
  108. <if test="valueId !=null and valueId != ''">
  109. and t.value_id= #{valueId}
  110. </if>
  111. <if test="titleId !=null and titleId != ''">
  112. and t.title_id= #{titleId}
  113. </if>
  114. <if test="answerType !=null and answerType != ''">
  115. and t.answer_type= #{answerType}
  116. </if>
  117. <if test="objId !=null and objId != ''">
  118. and t.obj_id= #{objId}
  119. </if>
  120. <if test="userQaId !=null and userQaId != ''">
  121. and t.user_qa_id= #{userQaId}
  122. </if>
  123. <if test="valueContent !=null and valueContent != ''">
  124. and t.value_content= #{valueContent}
  125. </if>
  126. <if test="personId !=null and personId != ''">
  127. and t.person_id= #{personId}
  128. </if>
  129. <if test="statusCd !=null and statusCd != ''">
  130. and t.status_cd= #{statusCd}
  131. </if>
  132. <if test="objType !=null and objType != ''">
  133. and t.obj_type= #{objType}
  134. </if>
  135. <if test="userTitleId !=null and userTitleId != ''">
  136. and t.user_title_id= #{userTitleId}
  137. </if>
  138. <if test="qaId !=null and qaId != ''">
  139. and t.qa_id= #{qaId}
  140. </if>
  141. </select>
  142. </mapper>