UserQuestionAnswerValueV1ServiceDaoImplMapper.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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="userQuestionAnswerValueV1ServiceDaoImpl">
  6. <!-- 保存问卷答案信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveUserQuestionAnswerValueInfo" parameterType="Map">
  8. insert into user_question_answer_value(
  9. value_id,title_id,user_qa_id,value_content,community_id,user_title_id,qa_id
  10. ) values (
  11. #{valueId},#{titleId},#{userQaId},#{valueContent},#{communityId},#{userTitleId},#{qaId}
  12. )
  13. </insert>
  14. <!-- 查询问卷答案信息 add by wuxw 2018-07-03 -->
  15. <select id="getUserQuestionAnswerValueInfo" parameterType="Map" resultType="Map">
  16. select t.value_id,t.value_id valueId,t.title_id,t.title_id titleId,t.user_qa_id,t.user_qa_id userQaId,t.value_content,t.value_content valueContent,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,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="valueId !=null and valueId != ''">
  20. and t.value_id= #{valueId}
  21. </if>
  22. <if test="titleId !=null and titleId != ''">
  23. and t.title_id= #{titleId}
  24. </if>
  25. <if test="userQaId !=null and userQaId != ''">
  26. and t.user_qa_id= #{userQaId}
  27. </if>
  28. <if test="valueContent !=null and valueContent != ''">
  29. and t.value_content= #{valueContent}
  30. </if>
  31. <if test="statusCd !=null and statusCd != ''">
  32. and t.status_cd= #{statusCd}
  33. </if>
  34. <if test="communityId !=null and communityId != ''">
  35. and t.community_id= #{communityId}
  36. </if>
  37. <if test="userTitleId !=null and userTitleId != ''">
  38. and t.user_title_id= #{userTitleId}
  39. </if>
  40. <if test="qaId !=null and qaId != ''">
  41. and t.qa_id= #{qaId}
  42. </if>
  43. order by t.create_time desc
  44. <if test="page != -1 and page != null ">
  45. limit #{page}, #{row}
  46. </if>
  47. </select>
  48. <!-- 修改问卷答案信息 add by wuxw 2018-07-03 -->
  49. <update id="updateUserQuestionAnswerValueInfo" parameterType="Map">
  50. update user_question_answer_value t set t.status_cd = #{statusCd}
  51. <if test="newBId != null and newBId != ''">
  52. ,t.b_id = #{newBId}
  53. </if>
  54. <if test="valueId !=null and valueId != ''">
  55. , t.value_id= #{valueId}
  56. </if>
  57. <if test="titleId !=null and titleId != ''">
  58. , t.title_id= #{titleId}
  59. </if>
  60. <if test="userQaId !=null and userQaId != ''">
  61. , t.user_qa_id= #{userQaId}
  62. </if>
  63. <if test="valueContent !=null and valueContent != ''">
  64. , t.value_content= #{valueContent}
  65. </if>
  66. <if test="communityId !=null and communityId != ''">
  67. , t.community_id= #{communityId}
  68. </if>
  69. <if test="qaId !=null and qaId != ''">
  70. , t.qa_id= #{qaId}
  71. </if>
  72. where 1=1 <if test="userTitleId !=null and userTitleId != ''">
  73. and t.user_title_id= #{userTitleId}
  74. </if>
  75. </update>
  76. <!-- 查询问卷答案数量 add by wuxw 2018-07-03 -->
  77. <select id="queryUserQuestionAnswerValuesCount" parameterType="Map" resultType="Map">
  78. select count(1) count
  79. from user_question_answer_value t
  80. where 1 =1
  81. <if test="valueId !=null and valueId != ''">
  82. and t.value_id= #{valueId}
  83. </if>
  84. <if test="titleId !=null and titleId != ''">
  85. and t.title_id= #{titleId}
  86. </if>
  87. <if test="userQaId !=null and userQaId != ''">
  88. and t.user_qa_id= #{userQaId}
  89. </if>
  90. <if test="valueContent !=null and valueContent != ''">
  91. and t.value_content= #{valueContent}
  92. </if>
  93. <if test="statusCd !=null and statusCd != ''">
  94. and t.status_cd= #{statusCd}
  95. </if>
  96. <if test="communityId !=null and communityId != ''">
  97. and t.community_id= #{communityId}
  98. </if>
  99. <if test="userTitleId !=null and userTitleId != ''">
  100. and t.user_title_id= #{userTitleId}
  101. </if>
  102. <if test="qaId !=null and qaId != ''">
  103. and t.qa_id= #{qaId}
  104. </if>
  105. </select>
  106. </mapper>