UserQuestionAnswerServiceDaoImplMapper.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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="userQuestionAnswerServiceDaoImpl">
  6. <!-- 保存答卷信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveUserQuestionAnswerInfo" parameterType="Map">
  8. insert into user_question_answer(
  9. score,evaluation_score,obj_id,user_qa_id,person_id,state,obj_type,qa_id
  10. ) values (
  11. #{score},#{evaluationScore},#{objId},#{userQaId},#{personId},#{state},#{objType},#{qaId}
  12. )
  13. </insert>
  14. <!-- 查询答卷信息 add by wuxw 2018-07-03 -->
  15. <select id="getUserQuestionAnswerInfo" parameterType="Map" resultType="Map">
  16. select t.score,t.evaluation_score,t.evaluation_score evaluationScore,t.obj_id,t.obj_id objId,t.user_qa_id,t.user_qa_id userQaId,t.person_id,t.person_id personId,t.status_cd,t.status_cd statusCd,t.state,t.obj_type,t.obj_type objType,t.qa_id,t.qa_id qaId
  17. from user_question_answer t
  18. where 1 =1
  19. <if test="score !=null and score != ''">
  20. and t.score= #{score}
  21. </if>
  22. <if test="evaluationScore !=null and evaluationScore != ''">
  23. and t.evaluation_score= #{evaluationScore}
  24. </if>
  25. <if test="objId !=null and objId != ''">
  26. and t.obj_id= #{objId}
  27. </if>
  28. <if test="userQaId !=null and userQaId != ''">
  29. and t.user_qa_id= #{userQaId}
  30. </if>
  31. <if test="personId !=null and personId != ''">
  32. and t.person_id= #{personId}
  33. </if>
  34. <if test="statusCd !=null and statusCd != ''">
  35. and t.status_cd= #{statusCd}
  36. </if>
  37. <if test="state !=null and state != ''">
  38. and t.state= #{state}
  39. </if>
  40. <if test="objType !=null and objType != ''">
  41. and t.obj_type= #{objType}
  42. </if>
  43. <if test="qaId !=null and qaId != ''">
  44. and t.qa_id= #{qaId}
  45. </if>
  46. order by t.create_time desc
  47. <if test="page != -1 and page != null ">
  48. limit #{page}, #{row}
  49. </if>
  50. </select>
  51. <!-- 修改答卷信息 add by wuxw 2018-07-03 -->
  52. <update id="updateUserQuestionAnswerInfo" parameterType="Map">
  53. update user_question_answer t set t.status_cd = #{statusCd}
  54. <if test="newBId != null and newBId != ''">
  55. ,t.b_id = #{newBId}
  56. </if>
  57. <if test="score !=null and score != ''">
  58. , t.score= #{score}
  59. </if>
  60. <if test="evaluationScore !=null and evaluationScore != ''">
  61. , t.evaluation_score= #{evaluationScore}
  62. </if>
  63. <if test="objId !=null and objId != ''">
  64. , t.obj_id= #{objId}
  65. </if>
  66. <if test="personId !=null and personId != ''">
  67. , t.person_id= #{personId}
  68. </if>
  69. <if test="state !=null and state != ''">
  70. , t.state= #{state}
  71. </if>
  72. <if test="objType !=null and objType != ''">
  73. , t.obj_type= #{objType}
  74. </if>
  75. <if test="qaId !=null and qaId != ''">
  76. , t.qa_id= #{qaId}
  77. </if>
  78. where 1=1 <if test="userQaId !=null and userQaId != ''">
  79. and t.user_qa_id= #{userQaId}
  80. </if>
  81. </update>
  82. <!-- 查询答卷数量 add by wuxw 2018-07-03 -->
  83. <select id="queryUserQuestionAnswersCount" parameterType="Map" resultType="Map">
  84. select count(1) count
  85. from user_question_answer t
  86. where 1 =1
  87. <if test="score !=null and score != ''">
  88. and t.score= #{score}
  89. </if>
  90. <if test="evaluationScore !=null and evaluationScore != ''">
  91. and t.evaluation_score= #{evaluationScore}
  92. </if>
  93. <if test="objId !=null and objId != ''">
  94. and t.obj_id= #{objId}
  95. </if>
  96. <if test="userQaId !=null and userQaId != ''">
  97. and t.user_qa_id= #{userQaId}
  98. </if>
  99. <if test="personId !=null and personId != ''">
  100. and t.person_id= #{personId}
  101. </if>
  102. <if test="statusCd !=null and statusCd != ''">
  103. and t.status_cd= #{statusCd}
  104. </if>
  105. <if test="state !=null and state != ''">
  106. and t.state= #{state}
  107. </if>
  108. <if test="objType !=null and objType != ''">
  109. and t.obj_type= #{objType}
  110. </if>
  111. <if test="qaId !=null and qaId != ''">
  112. and t.qa_id= #{qaId}
  113. </if>
  114. </select>
  115. </mapper>