/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the yifu4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.yifu.cloud.plus.v1.yifu.insurances.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePreQwDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreQwDetailService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 商险定时失败的企微
 *
 * @author hgw
 * @date 2025-08-07 17:49:14
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/temployeeinsurancepreqwdetail")
@Tag(name = "商险定时失败的企微管理")
public class TEmployeeInsurancePreQwDetailController {

	private final TEmployeeInsurancePreQwDetailService tEmployeeInsurancePreQwDetailService;

	/**
	 * 简单分页查询
	 *
	 * @param page                          分页对象
	 * @param tEmployeeInsurancePreQwDetail 商险定时失败的企微
	 * @return
	 */
	@Operation(description = "简单分页查询")
	@GetMapping("/page")
	public R<IPage<TEmployeeInsurancePreQwDetail>> getTEmployeeInsurancePreQwDetailPage(Page<TEmployeeInsurancePreQwDetail> page, TEmployeeInsurancePreQwDetail tEmployeeInsurancePreQwDetail) {
		if (tEmployeeInsurancePreQwDetail == null) {
			tEmployeeInsurancePreQwDetail = new TEmployeeInsurancePreQwDetail();
		}
		if (Common.isEmpty(tEmployeeInsurancePreQwDetail.getMainId())) {
			tEmployeeInsurancePreQwDetail.setMainId(CommonConstants.ZERO_STRING);
		}
		return new R<>(tEmployeeInsurancePreQwDetailService.getTEmployeeInsurancePreQwDetailPage(page, tEmployeeInsurancePreQwDetail));
	}

}
