package com.liangjian.dataplatform.member.dao.tertiary;

import com.liangjian.dataplatform.member.dao.JpaLifeCycleRepository;
import com.liangjian.dataplatform.member.entity.po.tertiary.ProductUsage;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;


import java.util.List;
import java.util.Map;

public interface ProductUsageRepository extends JpaLifeCycleRepository<ProductUsage,String> {



    @Modifying
    @Transactional
    @Query(value = "UPDATE Mall.dbo.ProductUsage set UsageMethod = (:usageMethod),UsageFrequencyUnit = (:usageFrequencyUnit), UsageFrequencyStr = (:usageFrequencyStr), UsagePerUseCount = (:usagePerUseCount), UsagePerUseUnit = (:isagePerUseUnit) " +
            "where ProductCode = (:productCode)", nativeQuery = true)
    int updateByProductCode(@Param("usageMethod") String usageMethod,
                   @Param("usageFrequencyUnit") String usageFrequencyUnit,
                   @Param("usageFrequencyStr") String usageFrequencyStr,
                   @Param("usagePerUseCount") String usagePerUseCount,
                   @Param("isagePerUseUnit") String isagePerUseUnit,
                   @Param("productCode") Integer productCode);


}
