CoursePackage.java 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. package com.qxgmat.data.dao.entity;
  2. import com.alibaba.fastjson.JSONObject;
  3. import java.io.Serializable;
  4. import java.math.BigDecimal;
  5. import java.util.Date;
  6. import javax.persistence.*;
  7. @Table(name = "course_package")
  8. public class CoursePackage implements Serializable {
  9. @Id
  10. @Column(name = "`id`")
  11. @GeneratedValue(strategy = GenerationType.IDENTITY)
  12. private Integer id;
  13. /**
  14. * 学科
  15. */
  16. @Column(name = "`struct_id`")
  17. private Integer structId;
  18. /**
  19. * 套餐名称
  20. */
  21. @Column(name = "`title`")
  22. private String title;
  23. /**
  24. * 套餐价格
  25. */
  26. @Column(name = "`price`")
  27. private BigDecimal price;
  28. /**
  29. * 包含课程
  30. */
  31. @Column(name = "`course_ids`")
  32. private Integer[] courseIds;
  33. /**
  34. * 是否精选:首页推荐
  35. */
  36. @Column(name = "`is_special`")
  37. private Integer isSpecial;
  38. /**
  39. * 赠品:json
  40. */
  41. @Column(name = "`gift`")
  42. private JSONObject gift;
  43. /**
  44. * 销售数量
  45. */
  46. @Column(name = "`sale_number`")
  47. private Integer saleNumber;
  48. @Column(name = "`create_time`")
  49. private Date createTime;
  50. @Column(name = "`update_time`")
  51. private Date updateTime;
  52. /**
  53. * 套餐简介
  54. */
  55. @Column(name = "`description`")
  56. private String description;
  57. private static final long serialVersionUID = 1L;
  58. /**
  59. * @return id
  60. */
  61. public Integer getId() {
  62. return id;
  63. }
  64. /**
  65. * @param id
  66. */
  67. public void setId(Integer id) {
  68. this.id = id;
  69. }
  70. /**
  71. * 获取学科
  72. *
  73. * @return struct_id - 学科
  74. */
  75. public Integer getStructId() {
  76. return structId;
  77. }
  78. /**
  79. * 设置学科
  80. *
  81. * @param structId 学科
  82. */
  83. public void setStructId(Integer structId) {
  84. this.structId = structId;
  85. }
  86. /**
  87. * 获取套餐名称
  88. *
  89. * @return title - 套餐名称
  90. */
  91. public String getTitle() {
  92. return title;
  93. }
  94. /**
  95. * 设置套餐名称
  96. *
  97. * @param title 套餐名称
  98. */
  99. public void setTitle(String title) {
  100. this.title = title;
  101. }
  102. /**
  103. * 获取套餐价格
  104. *
  105. * @return price - 套餐价格
  106. */
  107. public BigDecimal getPrice() {
  108. return price;
  109. }
  110. /**
  111. * 设置套餐价格
  112. *
  113. * @param price 套餐价格
  114. */
  115. public void setPrice(BigDecimal price) {
  116. this.price = price;
  117. }
  118. /**
  119. * 获取包含课程
  120. *
  121. * @return course_ids - 包含课程
  122. */
  123. public Integer[] getCourseIds() {
  124. return courseIds;
  125. }
  126. /**
  127. * 设置包含课程
  128. *
  129. * @param courseIds 包含课程
  130. */
  131. public void setCourseIds(Integer[] courseIds) {
  132. this.courseIds = courseIds;
  133. }
  134. /**
  135. * 获取是否精选:首页推荐
  136. *
  137. * @return is_special - 是否精选:首页推荐
  138. */
  139. public Integer getIsSpecial() {
  140. return isSpecial;
  141. }
  142. /**
  143. * 设置是否精选:首页推荐
  144. *
  145. * @param isSpecial 是否精选:首页推荐
  146. */
  147. public void setIsSpecial(Integer isSpecial) {
  148. this.isSpecial = isSpecial;
  149. }
  150. /**
  151. * 获取赠品:json
  152. *
  153. * @return gift - 赠品:json
  154. */
  155. public JSONObject getGift() {
  156. return gift;
  157. }
  158. /**
  159. * 设置赠品:json
  160. *
  161. * @param gift 赠品:json
  162. */
  163. public void setGift(JSONObject gift) {
  164. this.gift = gift;
  165. }
  166. /**
  167. * 获取销售数量
  168. *
  169. * @return sale_number - 销售数量
  170. */
  171. public Integer getSaleNumber() {
  172. return saleNumber;
  173. }
  174. /**
  175. * 设置销售数量
  176. *
  177. * @param saleNumber 销售数量
  178. */
  179. public void setSaleNumber(Integer saleNumber) {
  180. this.saleNumber = saleNumber;
  181. }
  182. /**
  183. * @return create_time
  184. */
  185. public Date getCreateTime() {
  186. return createTime;
  187. }
  188. /**
  189. * @param createTime
  190. */
  191. public void setCreateTime(Date createTime) {
  192. this.createTime = createTime;
  193. }
  194. /**
  195. * @return update_time
  196. */
  197. public Date getUpdateTime() {
  198. return updateTime;
  199. }
  200. /**
  201. * @param updateTime
  202. */
  203. public void setUpdateTime(Date updateTime) {
  204. this.updateTime = updateTime;
  205. }
  206. /**
  207. * 获取套餐简介
  208. *
  209. * @return description - 套餐简介
  210. */
  211. public String getDescription() {
  212. return description;
  213. }
  214. /**
  215. * 设置套餐简介
  216. *
  217. * @param description 套餐简介
  218. */
  219. public void setDescription(String description) {
  220. this.description = description;
  221. }
  222. @Override
  223. public String toString() {
  224. StringBuilder sb = new StringBuilder();
  225. sb.append(getClass().getSimpleName());
  226. sb.append(" [");
  227. sb.append("Hash = ").append(hashCode());
  228. sb.append(", id=").append(id);
  229. sb.append(", structId=").append(structId);
  230. sb.append(", title=").append(title);
  231. sb.append(", price=").append(price);
  232. sb.append(", courseIds=").append(courseIds);
  233. sb.append(", isSpecial=").append(isSpecial);
  234. sb.append(", gift=").append(gift);
  235. sb.append(", saleNumber=").append(saleNumber);
  236. sb.append(", createTime=").append(createTime);
  237. sb.append(", updateTime=").append(updateTime);
  238. sb.append(", description=").append(description);
  239. sb.append("]");
  240. return sb.toString();
  241. }
  242. public static CoursePackage.Builder builder() {
  243. return new CoursePackage.Builder();
  244. }
  245. public static class Builder {
  246. private CoursePackage obj;
  247. public Builder() {
  248. this.obj = new CoursePackage();
  249. }
  250. /**
  251. * @param id
  252. */
  253. public Builder id(Integer id) {
  254. obj.setId(id);
  255. return this;
  256. }
  257. /**
  258. * 设置学科
  259. *
  260. * @param structId 学科
  261. */
  262. public Builder structId(Integer structId) {
  263. obj.setStructId(structId);
  264. return this;
  265. }
  266. /**
  267. * 设置套餐名称
  268. *
  269. * @param title 套餐名称
  270. */
  271. public Builder title(String title) {
  272. obj.setTitle(title);
  273. return this;
  274. }
  275. /**
  276. * 设置套餐价格
  277. *
  278. * @param price 套餐价格
  279. */
  280. public Builder price(BigDecimal price) {
  281. obj.setPrice(price);
  282. return this;
  283. }
  284. /**
  285. * 设置包含课程
  286. *
  287. * @param courseIds 包含课程
  288. */
  289. public Builder courseIds(Integer[] courseIds) {
  290. obj.setCourseIds(courseIds);
  291. return this;
  292. }
  293. /**
  294. * 设置是否精选:首页推荐
  295. *
  296. * @param isSpecial 是否精选:首页推荐
  297. */
  298. public Builder isSpecial(Integer isSpecial) {
  299. obj.setIsSpecial(isSpecial);
  300. return this;
  301. }
  302. /**
  303. * 设置赠品:json
  304. *
  305. * @param gift 赠品:json
  306. */
  307. public Builder gift(JSONObject gift) {
  308. obj.setGift(gift);
  309. return this;
  310. }
  311. /**
  312. * 设置销售数量
  313. *
  314. * @param saleNumber 销售数量
  315. */
  316. public Builder saleNumber(Integer saleNumber) {
  317. obj.setSaleNumber(saleNumber);
  318. return this;
  319. }
  320. /**
  321. * @param createTime
  322. */
  323. public Builder createTime(Date createTime) {
  324. obj.setCreateTime(createTime);
  325. return this;
  326. }
  327. /**
  328. * @param updateTime
  329. */
  330. public Builder updateTime(Date updateTime) {
  331. obj.setUpdateTime(updateTime);
  332. return this;
  333. }
  334. /**
  335. * 设置套餐简介
  336. *
  337. * @param description 套餐简介
  338. */
  339. public Builder description(String description) {
  340. obj.setDescription(description);
  341. return this;
  342. }
  343. public CoursePackage build() {
  344. return this.obj;
  345. }
  346. }
  347. }