package com.xinelu.manage.mapper.personsubscribemessage;

import com.xinelu.manage.domain.personsubscribemessage.PersonSubscribeMessage;
import com.xinelu.manage.vo.personsubscribemessage.PersonSubscribeMessageVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * 泉医到家护理员微信小程序订阅消息记录Mapper接口
 *
 * @author xinyilu
 * @date 2023-03-29
 */
public interface PersonSubscribeMessageMapper {
    /**
     * 查询泉医到家护理员微信小程序订阅消息记录
     *
     * @param id 泉医到家护理员微信小程序订阅消息记录主键
     * @return 泉医到家护理员微信小程序订阅消息记录
     */
    PersonSubscribeMessage selectPersonSubscribeMessageById(Long id);

    /**
     * 查询泉医到家护理员微信小程序订阅消息记录列表
     *
     * @param personSubscribeMessage 泉医到家护理员微信小程序订阅消息记录
     * @return 泉医到家护理员微信小程序订阅消息记录集合
     */
    List<PersonSubscribeMessage> selectPersonSubscribeMessageList(PersonSubscribeMessage personSubscribeMessage);

    /**
     * 新增泉医到家护理员微信小程序订阅消息记录
     *
     * @param personSubscribeMessage 泉医到家护理员微信小程序订阅消息记录
     * @return 结果
     */
    int insertPersonSubscribeMessage(PersonSubscribeMessage personSubscribeMessage);

    /**
     * 修改泉医到家护理员微信小程序订阅消息记录
     *
     * @param personSubscribeMessage 泉医到家护理员微信小程序订阅消息记录
     * @return 结果
     */
    int updatePersonSubscribeMessage(PersonSubscribeMessage personSubscribeMessage);

    /**
     * 删除泉医到家护理员微信小程序订阅消息记录
     *
     * @param id 泉医到家护理员微信小程序订阅消息记录主键
     * @return 结果
     */
    int deletePersonSubscribeMessageById(Long id);

    /**
     * 批量删除泉医到家护理员微信小程序订阅消息记录
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    int deletePersonSubscribeMessageByIds(Long[] ids);

    /**
     * 根据用户id，openid，消息模板id查询微信小程序订阅消息记录
     *
     * @param nurseStationPersonId 护理员id
     * @param openid               openid
     * @param templateId           消息模板id
     * @return com.xinyilu.base.domain.subscribemessagerecord.SubscribeMessageRecord
     **/
    PersonSubscribeMessage selectPersonSubscribeMessageByPatientId(@Param("nurseStationPersonId") Long nurseStationPersonId, @Param("openid") String openid, @Param("templateId") String templateId);

    /**
     * 根据用户id查询微信小程序订阅消息记录次数
     *
     * @param personSubscribeMessage 微信小程序订阅消息记录
     * @return int
     **/
    int selectPersonSubscribeMessageByCount(PersonSubscribeMessage personSubscribeMessage);

    /**
     * 批量新增微信小程序订阅消息记录
     *
     * @param personSubscribeMessageList 新增微信小程序订阅消息记录
     * @return int
     **/
    int insertPersonSubscribeMessageList(List<PersonSubscribeMessage> personSubscribeMessageList);


    /**
     * 根据会员openid与templateId修改微信小程序订阅消息记录
     *
     * @param openId               微信openid
     * @param templateId           模板id
     * @param subscribeStatus      订阅状态
     * @param nurseStationPersonId 护理员id
     * @return int
     **/
    int updatePersonSubscribeMessageTemplateId(@Param("openId") String openId, @Param("templateId") String templateId, @Param("subscribeStatus") String subscribeStatus, @Param("nurseStationPersonId") Long nurseStationPersonId);

    /**
     * 查询
     *
     * @param ids             会员id
     * @param subscribeStatus 订阅状态
     * @param messageType     订阅消息类型
     * @return java.util.List<com.xinyilu.base.domain.personsubscribemessage.PersonSubscribeMessage>
     **/
    List<PersonSubscribeMessage> selectPersonSubscribeList(@Param("list") List<Long> ids, @Param("subscribeStatus") String subscribeStatus, @Param("messageType") String messageType);

    /**
     * 根据用户id，openid，消息模板id查询微信小程序订阅消息记录
     *
     * @param nurseStationId       护理站id
     * @param nurseStationPersonId 护理员人员id
     * @param openid               openid
     * @param templateId           消息模板id
     * @return com.xinyilu.base.domain.subscribemessagerecord.SubscribeMessageRecord
     **/
    List<PersonSubscribeMessageVO> selectPersonSubscribeMessageByPersonWechatId(@Param("nurseStationId") Long nurseStationId, @Param("nurseStationPersonId") Long nurseStationPersonId, @Param("openid") String openid, @Param("templateId") String templateId);

    /**
     * 查询
     *
     * @param ids             会员id
     * @param subscribeStatus 订阅状态
     * @param messageType     订阅消息类型
     * @return List<SubscribeMessageRecord>
     */
    List<PersonSubscribeMessage> selectPersonSubscribeMessageListByIds(@Param("list") List<Long> ids, @Param("subscribeStatus") String subscribeStatus, @Param("messageType") String messageType);
}
