
接口:
package com.wzy.springcloud.service;import com.wzy.springcloud.Entities.Payment;import com.wzy.springcloud.dao.PaymentDao;import org.apache.ibatis.annotations.Mapper;import org.apache.ibatis.annotations.Param;import org.springframework.stereotype.Service;import javax.annotation.Resource;@Mapperpublic interface PaymentService {public int create(Payment payment);public Payment getPaymentById(@Param("id") Long id);}
实现类:
package com.wzy.springcloud.service.impl;import com.wzy.springcloud.Entities.Payment;import com.wzy.springcloud.dao.PaymentDao;import com.wzy.springcloud.service.PaymentService;import org.springframework.stereotype.Service;import javax.annotation.Resource;@Servicepublic class PaymentServiceImpl implements PaymentService {@Resourceprivate PaymentDao paymentDao;public int create(Payment payment){return paymentDao.create(payment);}public Payment getPaymentById(Long id){return paymentDao.getPaymentById(id);}}
