Commit 2abb8d31 by zhengxj

finish 订单controller,service on 20190123 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@16974 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent a7600d4b
/*
* Copyright (c) 2018, 2028, glsx and/or its affiliates. All rights reserved.
* GLSX PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.glsx.ordercenter.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.glsx.common.constants.ResultObject;
import com.glsx.ordercenter.service.IOrderService;
/**
* @ClassName: OrderController
* @Description: TODO(这里用一句话描述这个类的作用)
* @author Zheng Xiajun
* @date 2019年1月23日
*
*/
@RestController
@RequestMapping("/order")
public class OrderController {
@Autowired
private IOrderService orderService;
@RequestMapping(value = "/getByParams", method = { RequestMethod.GET, RequestMethod.POST },consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResultObject getByParams() {
return null;
}
@RequestMapping(value = "/add", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject add() {
return null;
}
@RequestMapping(value = "/deleteById", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject deleteById() {
return null;
}
@RequestMapping(value = "/update", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject update() {
return null;
}
}
/*
* Copyright (c) 2018, 2028, glsx and/or its affiliates. All rights reserved.
* GLSX PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.glsx.ordercenter.dto;
import java.io.Serializable;
import java.util.Date;
/**
* @ClassName: QueryOrderReq
* @Description: TODO(这里用一句话描述这个类的作用)
* @author Zheng Xiajun
* @date 2019年1月23日
*
*/
public class QueryOrderReq implements Serializable{
/**
*
*/
private static final long serialVersionUID = 3945235994796311064L;
private String orderSn;
private Integer orderChannel;
private String serviceType;
private Byte orderStatus;
private Date dateStart;
private Date dateEnd;
private String machanicInfo;
public String getOrderSn() {
return orderSn;
}
public void setOrderSn(String orderSn) {
this.orderSn = orderSn;
}
public Integer getOrderChannel() {
return orderChannel;
}
public void setOrderChannel(Integer orderChannel) {
this.orderChannel = orderChannel;
}
public String getServiceType() {
return serviceType;
}
public void setServiceType(String serviceType) {
this.serviceType = serviceType;
}
public Byte getOrderStatus() {
return orderStatus;
}
public void setOrderStatus(Byte orderStatus) {
this.orderStatus = orderStatus;
}
public Date getDateStart() {
return dateStart;
}
public void setDateStart(Date dateStart) {
this.dateStart = dateStart;
}
public Date getDateEnd() {
return dateEnd;
}
public void setDateEnd(Date dateEnd) {
this.dateEnd = dateEnd;
}
public String getMachanicInfo() {
return machanicInfo;
}
public void setMachanicInfo(String machanicInfo) {
this.machanicInfo = machanicInfo;
}
}
package com.glsx.ordercenter.mapper; package com.glsx.ordercenter.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
......
package com.glsx.ordercenter.pojo; package com.glsx.ordercenter.pojo;
import java.util.Date; import java.util.Date;
import java.util.List;
public class SysArea { public class SysArea {
private Integer id; private Integer id;
...@@ -12,8 +13,20 @@ public class SysArea { ...@@ -12,8 +13,20 @@ public class SysArea {
private Integer parentId; private Integer parentId;
private Date initDate; private Date initDate;
private List<SysArea> Children;
public Integer getId() {
public List<SysArea> getChildren() {
return Children;
}
public void setChildren(List<SysArea> children) {
Children = children;
}
public Integer getId() {
return id; return id;
} }
......
package com.glsx.ordercenter.pojo; package com.glsx.ordercenter.pojo;
import java.util.Date; import java.util.Date;
import java.util.List;
public class SysOrder { public class SysOrder {
private Integer id; private Integer id;
...@@ -55,7 +56,18 @@ public class SysOrder { ...@@ -55,7 +56,18 @@ public class SysOrder {
private String updateBy; private String updateBy;
public Integer getId() { private List<SysOrderRepair> children;
public List<SysOrderRepair> getChildren() {
return children;
}
public void setChildren(List<SysOrderRepair> children) {
this.children = children;
}
public Integer getId() {
return id; return id;
} }
......
/*
* Copyright (c) 2018, 2028, glsx and/or its affiliates. All rights reserved.
* GLSX PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.glsx.ordercenter.service;
/**
* @ClassName: IOrderService
* @Description: TODO(这里用一句话描述这个类的作用)
* @author Zheng Xiajun
* @date 2019年1月23日
*
*/
public interface IOrderService {
}
/*
* Copyright (c) 2018, 2028, glsx and/or its affiliates. All rights reserved.
* GLSX PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.glsx.ordercenter.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.glsx.ordercenter.mapper.SysAreaMapper;
import com.glsx.ordercenter.mapper.SysOrderRepairMapper;
import com.glsx.ordercenter.service.IOrderService;
/**
* @ClassName: OrderServiceImpl
* @Description: TODO(这里用一句话描述这个类的作用)
* @author Zheng Xiajun
* @date 2019年1月23日
*
*/
@Service
public class OrderServiceImpl implements IOrderService {
@Autowired
private SysAreaMapper orderDao;
@Autowired
private SysOrderRepairMapper orderRepairDao;
}
...@@ -140,4 +140,22 @@ ...@@ -140,4 +140,22 @@
init_date = #{initDate,jdbcType=TIMESTAMP} init_date = #{initDate,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<!-- //1.定义返回resultMap -->
<resultMap id="chargeItemSelectMap" type="com.glsx.ordercenter.pojo.SysArea" extends="BaseResultMap">
<collection property="children" ofType="com.glsx.ordercenter.pojo.SysArea" select="getSubChargeItem"
column="id"></collection>
</resultMap>
<!--2.定义查询父的方法 -->
<select id="getAllChargeItems" resultMap="chargeItemSelectMap">
SELECT
<include refid="Base_Column_List" />
sys_area WHERE parent_id = 0
</select>
<!-- 3.定义查询子的方法 -->
<select id="getSubChargeItem" resultMap="chargeItemSelectMap">
SELECT
<include refid="Base_Column_List" />
sys_area WHERE parent_id = #{id}
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!