You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.6 KiB
68 lines
1.6 KiB
package com.hfkj.api.impl;
|
|
|
|
import com.hfkj.api.ApiMerService;
|
|
import com.hfkj.dao.ApiMerMapper;
|
|
import com.hfkj.entity.ApiMer;
|
|
import com.hfkj.entity.ApiMerExample;
|
|
import com.hfkj.entity.BsOrderGoods;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import javax.annotation.Resource;
|
|
import java.util.Collections;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
|
|
@Service("apiMerService")
|
|
public class ApiMerServiceImpl implements ApiMerService {
|
|
|
|
@Resource
|
|
private ApiMerMapper apiMerMapper;
|
|
|
|
@Override
|
|
public void create(ApiMer apiMer) {
|
|
apiMerMapper.insert(apiMer);
|
|
}
|
|
|
|
@Override
|
|
public void update(ApiMer apiMer) {
|
|
apiMerMapper.updateByPrimaryKey(apiMer);
|
|
}
|
|
|
|
@Override
|
|
public void delete(Long id, Boolean fullDelete) {
|
|
if (fullDelete) {
|
|
apiMerMapper.deleteByPrimaryKey(id);
|
|
} else {
|
|
ApiMer apiMer = queryDetail(id);
|
|
apiMer.setStatus(0);
|
|
apiMer.setUpdateTime(new Date());
|
|
update(apiMer);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public ApiMer queryDetail(Long id) {
|
|
return apiMerMapper.selectByPrimaryKey(id);
|
|
}
|
|
|
|
@Override
|
|
public ApiMer queryDetail(String appId) {
|
|
ApiMerExample example = new ApiMerExample();
|
|
ApiMerExample.Criteria criteria = example.createCriteria();
|
|
|
|
criteria.andAppIdEqualTo(appId).andStatusEqualTo(1);
|
|
|
|
List<ApiMer> list = apiMerMapper.selectByExample(example);
|
|
|
|
if (!list.isEmpty()) {
|
|
return list.get(0);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
public List<ApiMer> queryList(ApiMer apiMer) {
|
|
return Collections.emptyList();
|
|
}
|
|
}
|
|
|