public List <CustomData> GetAllObjectByType(CustomDataEnum customDataEnum)
        {
            List <CustomData> queryResult = new List <CustomData>();

            queryResult = customDataDAO.GetListByTypeID(customDataEnum);
            return(queryResult);
        }
        /// <summary>
        ///  模糊查询
        /// </summary>
        /// <param name="typeId"></param>
        /// <returns></returns>
        public List <CustomData> GetExistByValue(CustomDataEnum customDataEnum, string value)
        {
            using (var conn = DbUtil.getConn())
            {
                const string query = "select * from bdl_customdata where is_deleted = 0 and CD_Type = @CD_Type and CD_CustomName like @CD_CustomName";

                return((List <CustomData>)conn.Query <CustomData>(query, new { CD_Type = customDataEnum, CD_CustomName = "%" + value + "%" }));
            }
        }
        public CustomData GetListByTypeIDAndName(CustomDataEnum typeId, string Name)
        {
            using (var conn = DbUtil.getConn())
            {
                const string query = "select * from bdl_customdata where is_deleted = 0 and CD_Type = @CD_Type and CD_CustomName=@CD_CustomName";

                return(conn.QueryFirstOrDefault <CustomData>(query, new { CD_Type = typeId, CD_CustomName = Name }));
            }
        }
        /// <summary>
        /// 根据类型获得List<CustomData>
        /// </summary>
        /// <param name="typeId"></param>
        /// <returns></returns>
        public List <CustomData> GetListByTypeID(CustomDataEnum typeId)
        {
            using (var conn = DbUtil.getConn())
            {
                const string query = "select * from bdl_customdata where is_deleted = 0 and CD_Type = @CD_Type";

                return((List <CustomData>)conn.Query <CustomData>(query, new { CD_Type = typeId }));
            }
        }
        /// <summary>
        /// 根据value模糊查询获得对应的自定义的List<string>
        /// </summary>
        /// <param name="customDataEnum">枚举类型type</param>
        /// <returns></returns>
        public List <string> GetExistByValue(CustomDataEnum customDataEnum, string value)
        {
            List <string> queryResult = new List <string>();
            var           result      = customDataDAO.GetExistByValue(customDataEnum, value);

            foreach (var i in result)
            {
                queryResult.Add(i.CD_CustomName);
            }
            return(queryResult);
        }
        /// <summary>
        /// 根据type获得对应的某种自定义的全部List<string>
        /// </summary>
        /// <param name="customDataEnum">枚举类型type</param>
        /// <returns></returns>
        public List <string> GetAllByType(CustomDataEnum customDataEnum)
        {
            List <string> queryResult = new List <string>();
            var           result      = customDataDAO.GetListByTypeID(customDataEnum);

            foreach (var i in result)
            {
                queryResult.Add(i.CD_CustomName);
            }
            return(queryResult);
        }
        /// <summary>
        /// 插入自定义类型数据
        /// </summary>
        /// <param name="customDataEnum">自定义枚举类型</param>
        /// <param name="value">插入的值</param>
        public void InsertCustomData(CustomDataEnum customDataEnum, string value)
        {
            CustomData customData = new CustomData();

            customData.CD_Type       = (byte)customDataEnum;
            customData.CD_CustomName = value;
            customDataDAO.Insert(customData);
            //插入至上传表
            UploadManagementDAO uploadManagementDao = new UploadManagementDAO();

            uploadManagementDao.Insert(new UploadManagement(customData.Pk_CD_Id, "bdl_customdata", 0));
        }