package com.xzx.gc.role.service; import com.xzx.gc.entity.CityPartner; import com.xzx.gc.role.mapper.CityPartnerMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import tk.mybatis.mapper.entity.Example; @Service @Transactional public class CityPartnerService { @Autowired private CityPartnerMapper cityPartnerMapper; public CityPartner queryById(Long id) { return cityPartnerMapper.selectByPrimaryKey(id); } public void updatePartner(CityPartner partner){ Example example1 = new Example(CityPartner.class); example1.createCriteria().andEqualTo("id", partner.getId()); cityPartnerMapper.updateByExample(partner,example1); } public void updateById(CityPartner userParty) { cityPartnerMapper.updateByPrimaryKeySelective(userParty); } }