瀏覽代碼

增加乐器与乐保查询接口

周箭河 4 年之前
父節點
當前提交
2a17776805

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentInstrumentDao.java

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.StudentInstrument;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface StudentInstrumentDao extends BaseDAO<Long, StudentInstrument> {
+
+}

+ 120 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentInstrument.java

@@ -0,0 +1,120 @@
+package com.ym.mec.biz.dal.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
+
+@ApiModel(value="com-ym-mec-biz-dal-entity-StudentInstrument")
+public class StudentInstrument {
+    @ApiModelProperty(value="")
+    private Long id;
+
+    /**
+    * 商品id
+    */
+    @ApiModelProperty(value="商品id")
+    private Integer goodsId;
+
+    /**
+    * 是否月保 0-不是 1-是
+    */
+    @ApiModelProperty(value="是否月保 0-不是 1-是")
+    private Integer status;
+
+    /**
+    * 月保开始时间
+    */
+    @ApiModelProperty(value="月保开始时间")
+    private Date startTime;
+
+    /**
+    * 月保结束时间
+    */
+    @ApiModelProperty(value="月保结束时间")
+    private Date endTime;
+
+    /**
+    * 添加时间
+    */
+    @ApiModelProperty(value="添加时间")
+    private Date createTime;
+
+    /**
+    * 更新时间
+    */
+    @ApiModelProperty(value="更新时间")
+    private Date updateTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Integer getGoodsId() {
+        return goodsId;
+    }
+
+    public void setGoodsId(Integer goodsId) {
+        this.goodsId = goodsId;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", goodsId=").append(goodsId);
+        sb.append(", status=").append(status);
+        sb.append(", startTime=").append(startTime);
+        sb.append(", endTime=").append(endTime);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentInstrumentService.java

@@ -0,0 +1,9 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.StudentInstrument;
+
+import com.ym.mec.common.service.BaseService;
+
+public interface StudentInstrumentService extends BaseService<Long, StudentInstrument> {
+
+}

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentInstrumentServiceImpl.java

@@ -0,0 +1,22 @@
+package com.ym.mec.biz.service.impl;
+
+
+import com.ym.mec.biz.dal.dao.StudentInstrumentDao;
+import com.ym.mec.biz.dal.entity.StudentInstrument;
+import com.ym.mec.biz.service.StudentInstrumentService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class StudentInstrumentServiceImpl extends BaseServiceImpl<Long, StudentInstrument> implements StudentInstrumentService {
+
+    @Autowired
+    private StudentInstrumentDao studentInstrumentDao;
+
+    @Override
+    public BaseDAO<Long, StudentInstrument> getDAO() {
+        return studentInstrumentDao;
+    }
+}

+ 83 - 0
mec-biz/src/main/resources/config/mybatis/StudentInstrumentMapper.xml

@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ym.mec.biz.dal.dao.StudentInstrumentDao">
+  <resultMap id="StudentInstrument" type="com.ym.mec.biz.dal.entity.StudentInstrument" extends="com.ym.mec.biz.dal.dao.GoodsDao.Goods">
+    <!--@mbg.generated-->
+    <!--@Table student_instrument-->
+    <id column="id_" property="id" />
+    <result column="goods_id_" property="goodsId" />
+    <result column="status_" property="status" />
+    <result column="start_time_" property="startTime" />
+    <result column="end_time_" property="endTime" />
+    <result column="create_time_" property="createTime" />
+    <result column="update_time" property="updateTime" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--@mbg.generated-->
+    id_, goods_id_, status_, start_time_, end_time_, create_time_, update_time
+  </sql>
+  <select id="get" parameterType="java.lang.Integer" resultMap="StudentInstrument">
+    <!--@mbg.generated-->
+    select 
+    <include refid="Base_Column_List" />
+    from student_instrument
+    where id_ = #{id}
+  </select>
+  <delete id="delete" parameterType="java.lang.Integer">
+    <!--@mbg.generated-->
+    delete from student_instrument
+    where id_ = #{id}
+  </delete>
+  
+  <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.StudentInstrument" useGeneratedKeys="true">
+    <!--@mbg.generated-->
+    insert into student_instrument (goods_id_, status_, start_time_, end_time_, create_time_, update_time
+      )
+    values (#{goodsId}, #{status}, #{startTime}, #{endTime}, #{createTime}, #{updateTime}
+      )
+  </insert>
+  <update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentInstrument">
+    <!--@mbg.generated-->
+    update student_instrument
+    <set>
+      <if test="goodsId != null">
+        goods_id_ = #{goodsId},
+      </if>
+      <if test="status != null">
+        status_ = #{status},
+      </if>
+      <if test="startTime != null">
+        start_time_ = #{startTime},
+      </if>
+      <if test="endTime != null">
+        end_time_ = #{endTime},
+      </if>
+      <if test="createTime != null">
+        create_time_ = #{createTime},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime},
+      </if>
+    </set>
+    where id_ = #{id}
+  </update>
+
+  <!-- 全查询 -->
+  <select id="findAll" resultMap="StudentInstrument">
+    SELECT *
+    FROM student
+  </select>
+
+  <!-- 分页查询 -->
+  <select id="queryPage" resultMap="StudentInstrument" parameterType="map">
+    SELECT * FROM student
+    <include refid="global.limit"/>
+  </select>
+
+  <!-- 查询当前表的总记录数 -->
+  <select id="queryCount" resultType="int">
+    SELECT COUNT(*)
+    FROM student
+  </select>
+
+</mapper>

+ 41 - 0
mec-student/src/main/java/com/ym/mec/student/controller/StudentInstrumentController.java

@@ -0,0 +1,41 @@
+package com.ym.mec.student.controller;
+
+
+import com.ym.mec.biz.dal.dto.RegisterPayDto;
+import com.ym.mec.biz.dal.entity.StudentInstrument;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.biz.service.StudentInstrumentService;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RequestMapping("studentInstrument")
+@Api(tags = "乐器与月保服务")
+@RestController
+public class StudentInstrumentController extends BaseController {
+    @Autowired
+    private StudentInstrumentService studentInstrumentService;
+
+
+    @ApiOperation(value = "获取乐器与月保列表")
+    @PostMapping("/getList")
+    public HttpResponseResult<PageInfo<StudentInstrument>> getList(QueryInfo queryInfo) {
+        return succeed(studentInstrumentService.queryPage(queryInfo));
+    }
+
+    @ApiOperation(value = "乐保支付")
+    @PostMapping("/pay")
+    @ApiImplicitParams({@ApiImplicitParam(name = "registerPayDto", value = "支付信息", required = true, dataType = "RegisterPayDto")})
+    public HttpResponseResult pay(@RequestBody RegisterPayDto registerPayDto) {
+        return null;
+    }
+}