File was renamed from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/util/TypeConversionDistrict.java |
| | |
| | | package com.dy.pipIrrGlobal.util; |
| | | |
| | | import com.dy.common.mybatis.envm.Deleted; |
| | | import org.mapstruct.Named; |
| | | import org.springframework.stereotype.Component; |
| | | import java.util.Objects; |
| | |
| | | */ |
| | | @Component |
| | | @SuppressWarnings("") |
| | | public class TypeConversionDistrict { |
| | | public class TypeConversionEnum { |
| | | /** |
| | | * @param obj 参数 |
| | | * @return 转换成的对象 |
| | |
| | | return rObj ; |
| | | } |
| | | } |
| | | /** |
| | | * @param obj 参数 |
| | | * @return 转换成的对象 |
| | | */ |
| | | @Named("deletedByteToObj") |
| | | public Deleted converseDeleted(Object obj) { |
| | | if (Objects.isNull(obj)) { |
| | | return null; |
| | | }else{ |
| | | byte sourceObj = (obj instanceof Byte?(Byte)obj: Deleted.NO.code); |
| | | Deleted rObj ; |
| | | if(sourceObj == Deleted.NO.code){ |
| | | rObj = Deleted.NO ; |
| | | }else if(sourceObj == Deleted.YES.code){ |
| | | rObj = Deleted.YES ; |
| | | }else{ |
| | | rObj = Deleted.NO ; |
| | | } |
| | | return rObj ; |
| | | } |
| | | } |
| | | } |