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

import com.liangjian.dataplatform.member.entity.po.fourthly.MemDataDictory;
import com.liangjian.dataplatform.member.entity.po.tertiary.DataDictory;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

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

public interface MemDataDictoryRepository extends JpaRepository<MemDataDictory, String>, JpaSpecificationExecutor<MemDataDictory> {

    List<MemDataDictory> findByParentId(Integer parentId);

    @Query(value = "select (Mall.dbo.DesEncryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',(:number))) as phone", nativeQuery = true)
    Map<String, Object> desEncryptFixKey(@Param("number") String number);

    @Query(value = "select (Mall.dbo.DesDecryptFixKey('123456','123456e10adc3949ba59abbe56e057f20f883e',(:number))) as phone", nativeQuery = true)
    Map<String, Object> desDecryptFixKey(@Param("number") String number);
}
