| | |
| | | */ |
| | | MsgDeviceReadState selectByDeviceAndPlatformAndType(@Param("device") String device, @Param("platform") int platform, |
| | | @Param("type") String type); |
| | | |
| | | MsgDeviceReadState selectByDeviceAndPlatformAndTypeForUpdate(@Param("device") String device, @Param("platform") int platform, |
| | | @Param("type") String type); |
| | | |
| | | /** |
| | | * 设置所有消息已读 |
| | |
| | | |
| | | DeviceTokenIOS selectByDevice(String device); |
| | | |
| | | DeviceTokenIOS selectByDeviceForUpdate(String device); |
| | | |
| | | DeviceTokenIOS selectByDeviceToken(String deviceToken); |
| | | |
| | | List<DeviceTokenIOS> selectByUid( @Param("uid")Long uid, @Param("list")List<Integer> list); |
| | |
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.persistence.Entity;
|
| | | import javax.persistence.GeneratedValue;
|
| | | import javax.persistence.GenerationType;
|
| | | import javax.persistence.Id;
|
| | |
| | | from yeshi_ec_msg_device_read_state where mdrs_device=#{device} and |
| | | mdrs_platform=#{platform} and mdrs_type=#{type} |
| | | </select> |
| | | |
| | | <select id="selectByDeviceAndPlatformAndTypeForUpdate" resultMap="BaseResultMap" useCache="false" flushCache="true"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_msg_device_read_state where mdrs_device=#{device} and |
| | | mdrs_platform=#{platform} and mdrs_type=#{type} for update |
| | | </select> |
| | | |
| | | |
| | | <select id="listByDeviceAndPlatform" resultMap="BaseResultMap" useCache="false" flushCache="true"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_uid_devicetoken_ios where device = #{0} limit 1 |
| | | </select> |
| | | |
| | | <select id="selectByDeviceForUpdate" resultMap="BaseResultMap" |
| | | parameterType="java.lang.String"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_uid_devicetoken_ios where device = #{0} limit 1 for update |
| | | </select> |
| | | |
| | | <select id="selectByDeviceToken" resultMap="BaseResultMap" |
| | | parameterType="java.lang.String"> |
| | |
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.msg.MsgDeviceReadStateMapper;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public MsgDeviceReadState getByDeviceAndPlatformAndType(String type, String device, int platform) {
|
| | | MsgDeviceReadState state = msgDeviceReadStateMapper.selectByDeviceAndPlatformAndType(device, platform, type);
|
| | | MsgDeviceReadState state = msgDeviceReadStateMapper.selectByDeviceAndPlatformAndTypeForUpdate(device, platform,
|
| | | type);
|
| | | if (state == null) {
|
| | | state = new MsgDeviceReadState();
|
| | | state.setCreateTime(new Date());
|
| | |
| | | return;
|
| | |
|
| | | // 判断device是否存在
|
| | | DeviceTokenIOS deviceTokenIos = deviceTokenIOSMapper.selectByDevice(device);
|
| | | DeviceTokenIOS deviceTokenIos = deviceTokenIOSMapper.selectByDeviceForUpdate(device);
|
| | | if (deviceTokenIos == null) {
|
| | | deviceTokenIos = new DeviceTokenIOS();
|
| | | deviceTokenIos.setCreateTime(new Date());
|