wzy
2022-08-14 b141df9bf9764db8567efebed48006e12ab1f657
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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);
    }
}