UserQuestion.java 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. package com.qxgmat.data.dao.entity;
  2. import com.alibaba.fastjson.JSONObject;
  3. import java.io.Serializable;
  4. import java.util.Date;
  5. import javax.persistence.*;
  6. @Table(name = "user_question")
  7. public class UserQuestion implements Serializable {
  8. @Id
  9. @Column(name = "`id`")
  10. @GeneratedValue(strategy = GenerationType.IDENTITY)
  11. private Integer id;
  12. /**
  13. * 用户id
  14. */
  15. @Column(name = "`user_id`")
  16. private Integer userId;
  17. /**
  18. * 报告id
  19. */
  20. @Column(name = "`report_id`")
  21. private Integer reportId;
  22. /**
  23. * 题目id
  24. */
  25. @Column(name = "`question_id`")
  26. private Integer questionId;
  27. /**
  28. * 题目编号id
  29. */
  30. @Column(name = "`question_no_id`")
  31. private Integer questionNoId;
  32. /**
  33. * 系统定义时间
  34. */
  35. @Column(name = "`time`")
  36. private Integer time;
  37. /**
  38. * 用户用时
  39. */
  40. @Column(name = "`user_time`")
  41. private Integer userTime;
  42. @Column(name = "`create_time`")
  43. private Date createTime;
  44. /**
  45. * 系统答案:json
  46. */
  47. @Column(name = "`answer`")
  48. private JSONObject answer;
  49. /**
  50. * 用户答案:json
  51. */
  52. @Column(name = "`user_answer`")
  53. private JSONObject userAnswer;
  54. /**
  55. * 正确:0错误,1正确
  56. */
  57. @Column(name = "`is_correct`")
  58. private Integer isCorrect;
  59. private static final long serialVersionUID = 1L;
  60. /**
  61. * @return id
  62. */
  63. public Integer getId() {
  64. return id;
  65. }
  66. /**
  67. * @param id
  68. */
  69. public void setId(Integer id) {
  70. this.id = id;
  71. }
  72. /**
  73. * 获取用户id
  74. *
  75. * @return user_id - 用户id
  76. */
  77. public Integer getUserId() {
  78. return userId;
  79. }
  80. /**
  81. * 设置用户id
  82. *
  83. * @param userId 用户id
  84. */
  85. public void setUserId(Integer userId) {
  86. this.userId = userId;
  87. }
  88. /**
  89. * 获取报告id
  90. *
  91. * @return report_id - 报告id
  92. */
  93. public Integer getReportId() {
  94. return reportId;
  95. }
  96. /**
  97. * 设置报告id
  98. *
  99. * @param reportId 报告id
  100. */
  101. public void setReportId(Integer reportId) {
  102. this.reportId = reportId;
  103. }
  104. /**
  105. * 获取题目id
  106. *
  107. * @return question_id - 题目id
  108. */
  109. public Integer getQuestionId() {
  110. return questionId;
  111. }
  112. /**
  113. * 设置题目id
  114. *
  115. * @param questionId 题目id
  116. */
  117. public void setQuestionId(Integer questionId) {
  118. this.questionId = questionId;
  119. }
  120. /**
  121. * 获取题目编号id
  122. *
  123. * @return question_no_id - 题目编号id
  124. */
  125. public Integer getQuestionNoId() {
  126. return questionNoId;
  127. }
  128. /**
  129. * 设置题目编号id
  130. *
  131. * @param questionNoId 题目编号id
  132. */
  133. public void setQuestionNoId(Integer questionNoId) {
  134. this.questionNoId = questionNoId;
  135. }
  136. /**
  137. * 获取系统定义时间
  138. *
  139. * @return time - 系统定义时间
  140. */
  141. public Integer getTime() {
  142. return time;
  143. }
  144. /**
  145. * 设置系统定义时间
  146. *
  147. * @param time 系统定义时间
  148. */
  149. public void setTime(Integer time) {
  150. this.time = time;
  151. }
  152. /**
  153. * 获取用户用时
  154. *
  155. * @return user_time - 用户用时
  156. */
  157. public Integer getUserTime() {
  158. return userTime;
  159. }
  160. /**
  161. * 设置用户用时
  162. *
  163. * @param userTime 用户用时
  164. */
  165. public void setUserTime(Integer userTime) {
  166. this.userTime = userTime;
  167. }
  168. /**
  169. * @return create_time
  170. */
  171. public Date getCreateTime() {
  172. return createTime;
  173. }
  174. /**
  175. * @param createTime
  176. */
  177. public void setCreateTime(Date createTime) {
  178. this.createTime = createTime;
  179. }
  180. /**
  181. * 获取系统答案:json
  182. *
  183. * @return answer - 系统答案:json
  184. */
  185. public JSONObject getAnswer() {
  186. return answer;
  187. }
  188. /**
  189. * 设置系统答案:json
  190. *
  191. * @param answer 系统答案:json
  192. */
  193. public void setAnswer(JSONObject answer) {
  194. this.answer = answer;
  195. }
  196. /**
  197. * 获取用户答案:json
  198. *
  199. * @return user_answer - 用户答案:json
  200. */
  201. public JSONObject getUserAnswer() {
  202. return userAnswer;
  203. }
  204. /**
  205. * 设置用户答案:json
  206. *
  207. * @param userAnswer 用户答案:json
  208. */
  209. public void setUserAnswer(JSONObject userAnswer) {
  210. this.userAnswer = userAnswer;
  211. }
  212. /**
  213. * 获取正确:0错误,1正确
  214. *
  215. * @return is_correct - 正确:0错误,1正确
  216. */
  217. public Integer getIsCorrect() {
  218. return isCorrect;
  219. }
  220. /**
  221. * 设置正确:0错误,1正确
  222. *
  223. * @param isCorrect 正确:0错误,1正确
  224. */
  225. public void setIsCorrect(Integer isCorrect) {
  226. this.isCorrect = isCorrect;
  227. }
  228. @Override
  229. public String toString() {
  230. StringBuilder sb = new StringBuilder();
  231. sb.append(getClass().getSimpleName());
  232. sb.append(" [");
  233. sb.append("Hash = ").append(hashCode());
  234. sb.append(", id=").append(id);
  235. sb.append(", userId=").append(userId);
  236. sb.append(", reportId=").append(reportId);
  237. sb.append(", questionId=").append(questionId);
  238. sb.append(", questionNoId=").append(questionNoId);
  239. sb.append(", time=").append(time);
  240. sb.append(", userTime=").append(userTime);
  241. sb.append(", createTime=").append(createTime);
  242. sb.append(", answer=").append(answer);
  243. sb.append(", userAnswer=").append(userAnswer);
  244. sb.append(", isCorrect=").append(isCorrect);
  245. sb.append("]");
  246. return sb.toString();
  247. }
  248. public static UserQuestion.Builder builder() {
  249. return new UserQuestion.Builder();
  250. }
  251. public static class Builder {
  252. private UserQuestion obj;
  253. public Builder() {
  254. this.obj = new UserQuestion();
  255. }
  256. /**
  257. * @param id
  258. */
  259. public Builder id(Integer id) {
  260. obj.setId(id);
  261. return this;
  262. }
  263. /**
  264. * 设置用户id
  265. *
  266. * @param userId 用户id
  267. */
  268. public Builder userId(Integer userId) {
  269. obj.setUserId(userId);
  270. return this;
  271. }
  272. /**
  273. * 设置报告id
  274. *
  275. * @param reportId 报告id
  276. */
  277. public Builder reportId(Integer reportId) {
  278. obj.setReportId(reportId);
  279. return this;
  280. }
  281. /**
  282. * 设置题目id
  283. *
  284. * @param questionId 题目id
  285. */
  286. public Builder questionId(Integer questionId) {
  287. obj.setQuestionId(questionId);
  288. return this;
  289. }
  290. /**
  291. * 设置题目编号id
  292. *
  293. * @param questionNoId 题目编号id
  294. */
  295. public Builder questionNoId(Integer questionNoId) {
  296. obj.setQuestionNoId(questionNoId);
  297. return this;
  298. }
  299. /**
  300. * 设置系统定义时间
  301. *
  302. * @param time 系统定义时间
  303. */
  304. public Builder time(Integer time) {
  305. obj.setTime(time);
  306. return this;
  307. }
  308. /**
  309. * 设置用户用时
  310. *
  311. * @param userTime 用户用时
  312. */
  313. public Builder userTime(Integer userTime) {
  314. obj.setUserTime(userTime);
  315. return this;
  316. }
  317. /**
  318. * @param createTime
  319. */
  320. public Builder createTime(Date createTime) {
  321. obj.setCreateTime(createTime);
  322. return this;
  323. }
  324. /**
  325. * 设置系统答案:json
  326. *
  327. * @param answer 系统答案:json
  328. */
  329. public Builder answer(JSONObject answer) {
  330. obj.setAnswer(answer);
  331. return this;
  332. }
  333. /**
  334. * 设置用户答案:json
  335. *
  336. * @param userAnswer 用户答案:json
  337. */
  338. public Builder userAnswer(JSONObject userAnswer) {
  339. obj.setUserAnswer(userAnswer);
  340. return this;
  341. }
  342. /**
  343. * 设置正确:0错误,1正确
  344. *
  345. * @param isCorrect 正确:0错误,1正确
  346. */
  347. public Builder isCorrect(Integer isCorrect) {
  348. obj.setIsCorrect(isCorrect);
  349. return this;
  350. }
  351. public UserQuestion build() {
  352. return this.obj;
  353. }
  354. }
  355. }