添加dao层
This commit is contained in:
@@ -0,0 +1,61 @@
|
|||||||
|
package com.cool.store.dao;
|
||||||
|
|
||||||
|
import com.cool.store.entity.HyExhibitionDO;
|
||||||
|
import com.cool.store.mapper.HyExhibitionMapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2023/11/30 15:06
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public class HyExhibitionDAO {
|
||||||
|
@Resource
|
||||||
|
HyExhibitionMapper hyExhibitionMapper;
|
||||||
|
|
||||||
|
public int insertSelective(HyExhibitionDO record){
|
||||||
|
if (record.getId() == null){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return hyExhibitionMapper.insertSelective(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 默认查询方法,通过主键获取所有字段的值
|
||||||
|
* dateTime:2023-11-30 01:38
|
||||||
|
*/
|
||||||
|
public HyExhibitionDO selectByPrimaryKey(Integer id){
|
||||||
|
if (id == null){
|
||||||
|
return new HyExhibitionDO();
|
||||||
|
}
|
||||||
|
return hyExhibitionMapper.selectByPrimaryKey(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||||
|
* dateTime:2023-11-30 01:38
|
||||||
|
*/
|
||||||
|
public int updateByPrimaryKeySelective(HyExhibitionDO record){
|
||||||
|
if (record.getId() == null){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return hyExhibitionMapper.updateByPrimaryKeySelective(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 默认更新方法,根据主键物理删除
|
||||||
|
* dateTime:2023-11-30 01:38
|
||||||
|
*/
|
||||||
|
public int deleteByPrimaryKey(Integer id){
|
||||||
|
if (id == null){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return hyExhibitionMapper.deleteByPrimaryKey(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.cool.store.dao;
|
||||||
|
|
||||||
|
import com.cool.store.entity.HyExhibitionGroupDO;
|
||||||
|
import com.cool.store.mapper.HyExhibitionGroupMapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2023/11/30 15:11
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public class HyExhibitionGroupDAO {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
HyExhibitionGroupMapper hyExhibitionGroupMapper;
|
||||||
|
|
||||||
|
public int insertSelective(HyExhibitionGroupDO record){
|
||||||
|
if (record.getId() == null){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return hyExhibitionGroupMapper.insertSelective(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 默认查询方法,通过主键获取所有字段的值
|
||||||
|
* dateTime:2023-11-30 01:38
|
||||||
|
*/
|
||||||
|
public HyExhibitionGroupDO selectByPrimaryKey(Integer id){
|
||||||
|
if (id == null){
|
||||||
|
return new HyExhibitionGroupDO();
|
||||||
|
}
|
||||||
|
return hyExhibitionGroupMapper.selectByPrimaryKey(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||||
|
* dateTime:2023-11-30 01:38
|
||||||
|
*/
|
||||||
|
public int updateByPrimaryKeySelective(HyExhibitionGroupDO record){
|
||||||
|
if (record.getId() == null){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return hyExhibitionGroupMapper.updateByPrimaryKeySelective(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 默认更新方法,根据主键物理删除
|
||||||
|
* dateTime:2023-11-30 01:38
|
||||||
|
*/
|
||||||
|
public int deleteByPrimaryKey(Integer id){
|
||||||
|
if (id == null){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return hyExhibitionGroupMapper.deleteByPrimaryKey(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package com.cool.store.dao;
|
||||||
|
|
||||||
|
import com.cool.store.entity.HyPartnerExhibitionDO;
|
||||||
|
import com.cool.store.mapper.HyPartnerExhibitionMapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author suzhuhong
|
||||||
|
* @Date 2023/11/30 15:13
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public class HyPartnerExhibitionDAO {
|
||||||
|
@Resource
|
||||||
|
HyPartnerExhibitionMapper hyPartnerExhibitionMapper;
|
||||||
|
|
||||||
|
public int insertSelective(HyPartnerExhibitionDO record){
|
||||||
|
if (record.getId() == null){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return hyPartnerExhibitionMapper.insertSelective(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 默认查询方法,通过主键获取所有字段的值
|
||||||
|
* dateTime:2023-11-30 01:38
|
||||||
|
*/
|
||||||
|
public HyPartnerExhibitionDO selectByPrimaryKey(Long id){
|
||||||
|
if (id == null){
|
||||||
|
return new HyPartnerExhibitionDO();
|
||||||
|
}
|
||||||
|
return hyPartnerExhibitionMapper.selectByPrimaryKey(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||||
|
* dateTime:2023-11-30 01:38
|
||||||
|
*/
|
||||||
|
public int updateByPrimaryKeySelective(HyPartnerExhibitionDO record){
|
||||||
|
if (record.getId() == null){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return hyPartnerExhibitionMapper.updateByPrimaryKeySelective(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 默认更新方法,根据主键物理删除
|
||||||
|
* dateTime:2023-11-30 01:38
|
||||||
|
*/
|
||||||
|
public int deleteByPrimaryKey(Long id){
|
||||||
|
if (id == null){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return hyPartnerExhibitionMapper.deleteByPrimaryKey(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.cool.store.service.impl.exhibition;
|
package com.cool.store.service.impl.exhibition;
|
||||||
|
|
||||||
|
import com.cool.store.dao.HyPartnerExhibitionDAO;
|
||||||
|
import com.cool.store.entity.HyPartnerExhibitionDO;
|
||||||
import com.cool.store.mapper.HyPartnerExhibitionMapper;
|
import com.cool.store.mapper.HyPartnerExhibitionMapper;
|
||||||
import com.cool.store.service.ExhibitionService;
|
import com.cool.store.service.ExhibitionService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -13,6 +15,6 @@ import org.springframework.stereotype.Service;
|
|||||||
public class ExhibitionServiceImpl implements ExhibitionService {
|
public class ExhibitionServiceImpl implements ExhibitionService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private HyPartnerExhibitionMapper exhibitionMapper;
|
private HyPartnerExhibitionDAO exhibitionDAO;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user